added register names, base on no$ docs
parent
19e844f43e
commit
d5fbe1a89b
35
assembler.rb
35
assembler.rb
|
@ -22,6 +22,39 @@ def string(s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# # # REGISTER NAMES # # #
|
||||||
|
def at() 1 end # assembler temporary
|
||||||
|
|
||||||
|
# subroutine return values, may be changed by subroutines
|
||||||
|
def v0() 2 end ; def v0() 3 end
|
||||||
|
|
||||||
|
# subroutine arguments, may be changed by subroutines
|
||||||
|
def a0() 4 end ; def a1() 5 end
|
||||||
|
def a2() 6 end ; def a3() 7 end
|
||||||
|
|
||||||
|
# temporaries, may be changed by subroutines
|
||||||
|
def t0() 8 end ; def t1() 9 end
|
||||||
|
def t2() 10 end ; def t3() 11 end
|
||||||
|
def t4() 12 end ; def t5() 13 end
|
||||||
|
def t6() 14 end ; def t7() 15 end
|
||||||
|
|
||||||
|
# static variables, must be saved by subs
|
||||||
|
def s0() 16 end ; def s1() 17 end
|
||||||
|
def s2() 18 end ; def s3() 19 end
|
||||||
|
def s4() 20 end ; def s5() 21 end
|
||||||
|
def s6() 22 end ; def s7() 23 end
|
||||||
|
|
||||||
|
# temporaries, may be changed by subroutines
|
||||||
|
def t8() 24 end ; def t9() 25 end
|
||||||
|
|
||||||
|
# reserved for kernel, detroyed by some irq handlers
|
||||||
|
def k0() 26 end ; def k1() 27 end
|
||||||
|
|
||||||
|
def gp() 28 end # global pointer, rarely used
|
||||||
|
def sp() 29 end # stack pointer
|
||||||
|
def fp() 30 end # frame pointer
|
||||||
|
def ra() 31 end # return address
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# # # INSTRUCTIONS # # #
|
# # # INSTRUCTIONS # # #
|
||||||
|
@ -113,7 +146,7 @@ end
|
||||||
|
|
||||||
# # # CONSTANTS # # #
|
# # # CONSTANTS # # #
|
||||||
$base_addr = 0x80010000 # 0x10000 # 0x80010000
|
$base_addr = 0x80010000 # 0x10000 # 0x80010000
|
||||||
$file_size = 0x800
|
$file_size = 0x800 * 3
|
||||||
$gp0 = 0x1F801810
|
$gp0 = 0x1F801810
|
||||||
|
|
||||||
# # # EXE HEADER # # #
|
# # # EXE HEADER # # #
|
||||||
|
|
Loading…
Reference in New Issue