assemblymipsmips32spim

MIPS: Size of .asciiz?


When determining the size of .asciiz string, should I take into consideration the terminating character ?

For example:

.data
string: .asciiz "Hello"

The size of "string" is 5 or 6 (byte) ?


Solution

  • if you are asking about how many bytes in memory the string is stored in then it's 6 bytes

    if you are asking about what should be returned by a function that count the string length (strlen C function for example) it should be 5