kocho84
kocho84

Reputation: 121

What does .word 123:4 do in MIPS assembly, with a colon and another number after a number?

I am trying to learn about memory and while I was researching I found a value that is stored like this in a sample program of a .data section:

.word 0x0049:4

I am guessing this is to store an ASCII character that isn't 32 bits as a word but what exactly is the ":4" doing to the hex value here. I know it has something to do with offsetting the different size of an ASCII character and a word, but I don't understand how, or what, it is actually doing.

I'm assuming you can use it in other situations too. How else would you use it and how could it be helpful?

Upvotes: 1

Views: 279

Answers (1)

Michael
Michael

Reputation: 58467

It repeats the value 4 times. So it's a more compact form of writing:

.word 0x0049, 0x0049, 0x0049, 0x0049

Upvotes: 4

Related Questions