mirror of
https://github.com/notwa/lips
synced 2025-03-09 19:32:49 -07:00
use R# instead of REG# for registers
This commit is contained in:
parent
e4e8e16ea5
commit
0ec6b24531
2 changed files with 9 additions and 10 deletions
|
@ -171,7 +171,7 @@ Whether or not they output the proper machine code is another thing.
|
||||||
|
|
||||||
In order of numerical value, with intended usage:
|
In order of numerical value, with intended usage:
|
||||||
|
|
||||||
* R0: always zero; cannot be changed. 'zero' is an acceptable alias.
|
* ZERO: always zero; cannot be changed.
|
||||||
|
|
||||||
* AT: assembler temporary. used by various pseudo-instructions.
|
* AT: assembler temporary. used by various pseudo-instructions.
|
||||||
user may use freely if they're wary.
|
user may use freely if they're wary.
|
||||||
|
@ -196,8 +196,9 @@ In order of numerical value, with intended usage:
|
||||||
|
|
||||||
* RA: subroutine return address.
|
* RA: subroutine return address.
|
||||||
|
|
||||||
* REG#: whereas # is a decimal number from 0 to 31.
|
* R#: whereas # is a decimal number from 0 to 31.
|
||||||
aliased to the appropriate register. eg: REG0 is R0, REG1 is at, REG2 is V0.
|
aliased to the appropriate register, for instance:
|
||||||
|
R0 is ZERO, R1 is at, R2 is V0, etc.
|
||||||
|
|
||||||
* F#: coprocessor 1 registers, whereas # is a decimal number from 0 to 31.
|
* F#: coprocessor 1 registers, whereas # is a decimal number from 0 to 31.
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ local data = {}
|
||||||
|
|
||||||
data.registers = {
|
data.registers = {
|
||||||
[0]=
|
[0]=
|
||||||
'R0', 'AT', 'V0', 'V1', 'A0', 'A1', 'A2', 'A3',
|
'ZERO', 'AT', 'V0', 'V1', 'A0', 'A1', 'A2', 'A3',
|
||||||
'T0', 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7',
|
'T0', 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7',
|
||||||
'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7',
|
'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7',
|
||||||
'T8', 'T9', 'K0', 'K1', 'GP', 'SP', 'FP', 'RA',
|
'T8', 'T9', 'K0', 'K1', 'GP', 'SP', 'FP', 'RA',
|
||||||
}
|
}
|
||||||
|
|
||||||
data.sys_registers = {
|
data.sys_registers = {
|
||||||
|
@ -70,13 +70,11 @@ revtable(data.all_registers)
|
||||||
revtable(data.all_directives)
|
revtable(data.all_directives)
|
||||||
|
|
||||||
-- alternate register names
|
-- alternate register names
|
||||||
data.registers['ZERO'] = 0
|
|
||||||
data.all_registers['ZERO'] = 0
|
|
||||||
data.registers['S8'] = 30
|
data.registers['S8'] = 30
|
||||||
data.all_registers['S8'] = 30
|
data.all_registers['S8'] = 30
|
||||||
|
|
||||||
for i=0, 31 do
|
for i=0, 31 do
|
||||||
local r = 'REG'..tostring(i)
|
local r = 'R'..tostring(i)
|
||||||
data.registers[r] = i
|
data.registers[r] = i
|
||||||
data.all_registers[r] = i
|
data.all_registers[r] = i
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue