From 0ec6b2453194ca7d5ceb980f732a514417920efe Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 8 May 2016 15:49:33 -0700 Subject: [PATCH] use R# instead of REG# for registers --- README.md | 7 ++++--- lips/data.lua | 12 +++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4931d43..0362149 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,7 @@ Whether or not they output the proper machine code is another thing. 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. user may use freely if they're wary. @@ -196,8 +196,9 @@ In order of numerical value, with intended usage: * RA: subroutine return address. -* REG#: whereas # is a decimal number from 0 to 31. -aliased to the appropriate register. eg: REG0 is R0, REG1 is at, REG2 is V0. +* R#: whereas # is a decimal number from 0 to 31. +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. diff --git a/lips/data.lua b/lips/data.lua index 3969d22..b6221c1 100644 --- a/lips/data.lua +++ b/lips/data.lua @@ -2,10 +2,10 @@ local data = {} data.registers = { [0]= - 'R0', 'AT', 'V0', 'V1', 'A0', 'A1', 'A2', 'A3', - 'T0', 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', - 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7', - 'T8', 'T9', 'K0', 'K1', 'GP', 'SP', 'FP', 'RA', + 'ZERO', 'AT', 'V0', 'V1', 'A0', 'A1', 'A2', 'A3', + 'T0', 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', + 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7', + 'T8', 'T9', 'K0', 'K1', 'GP', 'SP', 'FP', 'RA', } data.sys_registers = { @@ -70,13 +70,11 @@ revtable(data.all_registers) revtable(data.all_directives) -- alternate register names -data.registers['ZERO'] = 0 -data.all_registers['ZERO'] = 0 data.registers['S8'] = 30 data.all_registers['S8'] = 30 for i=0, 31 do - local r = 'REG'..tostring(i) + local r = 'R'..tostring(i) data.registers[r] = i data.all_registers[r] = i end