From b8df2847aa60728b72a9a48769c8662214ba30c8 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Wed, 8 Jan 2014 19:42:07 +0100 Subject: Remove useless D initialization, remove LA instruction (actually, it is LI) --- asm/asmlex.mll | 1 - asm/asmpars.mly | 3 +-- asm/test.asm | 3 +-- cpu/prog_test1.rom | 9 ++++----- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/asm/asmlex.mll b/asm/asmlex.mll index 1c7e3e7..22f77d7 100644 --- a/asm/asmlex.mll +++ b/asm/asmlex.mll @@ -23,7 +23,6 @@ "liu",LIU; "liuz",LIUZ; "lra",LRA; - "la",LA; "li",LI; "move",MOVE; "jz",JZ; diff --git a/asm/asmpars.mly b/asm/asmpars.mly index 8dbf665..d15c8af 100644 --- a/asm/asmpars.mly +++ b/asm/asmpars.mly @@ -38,7 +38,7 @@ %} %token EOF,COLON,TEXT,DATA,BYTE,WORD,ASCIIZ,MINUS,MOVE,JZ,JNZ,LP,RP -%token POP,PUSH,INCRI,SHI,JJ,JAL,JR,JALR,LW,SW,LB,SB,NOT,LIL,LILZ,LIU,LIUZ,LRA,LA,LI +%token POP,PUSH,INCRI,SHI,JJ,JAL,JR,JALR,LW,SW,LB,SB,NOT,LIL,LILZ,LIU,LIUZ,LRA,LI %token REG %token ROP,RIOP %token ID @@ -120,7 +120,6 @@ _instr: | LRA i=int { assert (i > -(1 lsl 10) && i < 1 lsl 10); add pc 2; [Lra (Imm i)] } | LRA l=ID { add pc 2; [Lra (Lab l)] } - | LA r=REG l=ID { li false r (Lab l) } | LIL r=REG i=int { add pc 2; [Lil (r,Imm i)] } | LILZ r=REG i=int { add pc 2; [Lilz (r,Imm i)] } | LIU r=REG i=int { add pc 2; [Liu (r,Imm i)] } diff --git a/asm/test.asm b/asm/test.asm index 78a56c4..2a9dd80 100644 --- a/asm/test.asm +++ b/asm/test.asm @@ -1,12 +1,11 @@ .text - add D Z Z init: liuz B 0x40 lw B 0(B) jz B init add D D B push D - la A msgtick + li A msgtick jal ser_out_msg pop D j init diff --git a/cpu/prog_test1.rom b/cpu/prog_test1.rom index 2604833..c6db00e 100644 --- a/cpu/prog_test1.rom +++ b/cpu/prog_test1.rom @@ -1,15 +1,14 @@ -56 8 -00000000 00100000 # add D Z Z +54 8 # init: 00000010 01011011 # liuz B 64 00000010 01000001 # lw B 0(B) -01000000 10110011 # lilz E init +00000000 10110011 # lilz E init 00000000 10101011 # liu E init 01000010 10101010 # jer E B Z 00010001 00100000 # add D D B 01111111 11101100 # incri SP -2 00000111 00110001 # sw D 0(SP) -01001100 10010011 # lilz A msgtick +00001100 10010011 # lilz A msgtick 00000000 10001011 # liu A msgtick 00010000 00010010 # jal ser_out_msg 00000111 00100001 # lw D 0(SP) @@ -20,7 +19,7 @@ 01000000 11000011 # lil C 2 # ser_out_msg_loop: 00000100 01001001 # lb B 0(A) -00001100 10110011 # lilz E ser_out_msg_ret +01110100 10110011 # lilz E ser_out_msg_ret 00000000 10101011 # liu E ser_out_msg_ret 01000010 10101010 # jer E B Z 00000110 01011001 # sb B 0(C) -- cgit v1.2.3