Search code examples
assemblymipsmars-simulatoroctal

how to write octal constants in MIPS (MARS assembler)


I would like to specify to MARS that I'm entering an octal number as an immediate operand.

I know that it is possible with Hex- Something like:

li  $t0, 0x24    #this is ASCII '$'

Is it possible to do the same with Octal?


Solution

  • Just prefix the immediate with 0, like in C:

    li $t0, 024
    

    Thanks to @gusbro