What are the differences between these directives in MIPS

I've seen the following directives, but I'm not sure exactly how to use and differentiate similarities.

  • .space
  • .byte
  • .word
  • ASCIIZ
  • .ascii
  • .align
+3


source to share


1 answer


  • .space

    reserves n bytes of memory. egarr: .space 100

  • .byte

    store n values ​​in consecutive bytes of memory. egnum: .byte 0x01, 0x03

  • .word

    store n 32-bit words in memory. egval: .word 10, -14, 30

  • .asciiz

    stores a string in memory with a null terminator. egstr: .asciiz "Hello, world"

  • .ascii

    stores a string in memory without a null terminator. egstr: .ascii "Hello, world"

  • .align

    aligns the following data on a byte boundary 2^n

    . for example .align 2

    aligns the next value on a word boundary. On the other hand, if n is 0, justification is turned off until the next data segment.


See assembly link for details .

+3


source







All Articles