spl

systems programming language
git clone http://frotz.net/git/spl.git
Log | Files | Refs | README | LICENSE

commit 2b08a98c9591dc233151995fddb3cbafb36ee035
parent 94462befc2a71448fc013d053a6753dc6b482949
Author: Brian Swetland <swetland@frotz.net>
Date:   Sun, 29 Jun 2025 18:42:40 -0700

sr32asm: call pseudo-instruction

Diffstat:
Msoftrisc32/src/assemble-sr32.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/softrisc32/src/assemble-sr32.c b/softrisc32/src/assemble-sr32.c @@ -239,7 +239,7 @@ enum tokens { tLDW, tLDH, tLDB, tLDX, tLUI, tLDHU, tLDBU, tAUIPC, tSTW, tSTH, tSTB, tSTX, tJAL, tSYSCALL, tBREAK, tSYSRET, - tNOP, tMV, tLI, tLA, tJ, tJR, tRET, + tNOP, tMV, tLI, tLA, tJ, tJR, tCALL, tRET, tNOT, tNEG, tSEQZ, tSNEZ, tSLTZ, tSGTZ, tBEQZ, tBNEZ, tBLEZ, tBGEZ, tBLTZ, tBGTZ, tBGT, tBLE, tBGTU, tBLEU, @@ -259,7 +259,7 @@ char *tnames[] = { "<EOF>", "<EOL>", "IDENT", "REGISTER", "NUMBER", "STRING", "STW", "STH", "STB", "STX", "JAL", "SYSCALL", "BREAK", "SYSRET", // pseudo instructions - "NOP", "MV", "LI", "LA", "J", "JR", "RET", + "NOP", "MV", "LI", "LA", "J", "JR", "CALL", "RET", "NOT", "NEG", "SEQZ", "SNEZ", "SLTZ", "SGTZ", "BEQZ", "BNEZ", "BLEZ", "BGEZ", "BLTZ", "BGTZ", "BGT", "BLE", "BGTU", "BLEU", @@ -701,6 +701,10 @@ int parse_line(State *s) { parse_rel(s, TYPE_PCREL_S21, &i); emit(ins_j(J_JAL, 0, i)); break; + case tCALL: + parse_rel(s, TYPE_PCREL_S21, &i); + emit(ins_j(J_JAL, 1, i)); + break; case tEQU: require(s, tIDENT); name = strdup(s->str);