assemblymipsspim

Why do we use .globl main in MIPS assembly language?


       .text
.globl main
.ent   main

I don't know what .globl and .ent do. What is the role? Do I need to use globl. main and .ent main all the time?


Solution

  • In your case, .globl is an assembler directive that tells the assembler that the main symbol will be accessible from outside the current file (that is, it can be referenced from other files), and .ent is a debugger (pseudo) operation that marks the entry of main.