didn't understood. you mean li $t0, 024 ?
- ALUFTW
@ALUFTW: Yes, if you want to load immediate 24 (in octal) prefix de immediate with 0, i.e. li $t0, 024
- gusbro
For ASCII char values, you can just use li $t0, '$' in the first place, instead of needing a magic number and a comment. Octal could be useful for other cases, though, so I hope that's just a silly choice of example.
- Peter Cordes
2 Answers
0
votes
Just prefix the immediate with 0, like in C:
li $t0, 024
Thanks to @gusbro
0
votes
Unlike MARS, qtspim and pcspim don't support the leading-0 for octal. For example, 024 and 037 are treated as decimal constants, the same as 24 and 37
You must manually convert to a decimal or hex for SPIM's built-in assembler.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
0yet? - Ignacio Vazquez-Abrams0, i.e.li $t0, 024- gusbroli $t0, '$'in the first place, instead of needing a magic number and a comment. Octal could be useful for other cases, though, so I hope that's just a silly choice of example. - Peter Cordes