ascii - Determining number of bytes in MIPS code segment -
so, understand mips runs 32-bit , words 8 bits (4 bytes).
if have following code,
.data .word 5 .asciiz "hi"
i know there 1 word being stored , must 4 bytes, how determine number of bytes in third line? i've asked instructor keeps referencing me following example:
.asciiz "help"
apparently 5 bytes, i'm not able see how or why 5 bytes. appreciate clarification, instructor reluctant share techniques , can't find information on in textbook
.asciiz
creates zero-terminated ascii string, i.e. string of ascii characters followed byte value 0 (terminator).
so the number of bytes required number of characters plus 1. hence asciiz "help"
-> 5 bytes, , asciiz "hi"
-> 3 bytes.
Comments
Post a Comment