gateware

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit ede20da576e18b5d89e9144eecec397d23a972e6
parent 34c05bff2d4c3bc0e1c60eece88b0ef116a05a9d
Author: Brian Swetland <swetland@frotz.net>
Date:   Sat, 24 Nov 2018 23:44:25 -0800

a16/d16: use the "true" nop rather than the alu nop

The alu nop is Rx = Rx + 0 which actually writes to the
register file and until we sort out hazards it is a bit
annoying.

Diffstat:
Msrc/a16v4.c | 8+++++---
Msrc/d16v4.c | 4++--
2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/a16v4.c b/src/a16v4.c @@ -440,6 +440,7 @@ void expect_register(unsigned got) { #define OP_ALU_RC_RA_RB 0x0000 +#define OP_EXPANSION 0x0001 #define OP_EXT 0x0002 #define OP_MOV_RC_S9 0x0003 #define OP_LW_RC_RA_S6 0x0004 @@ -451,7 +452,8 @@ void expect_register(unsigned got) { #define OP_B_RA 0x0027 #define OP_BL_RA 0x0037 #define OP_ALU_RC_RA_S6 0x0008 -#define OP_NOP 0x0008 +#define OP_NOP_EXP 0x0001 +#define OP_NOP_ALU 0x0008 #define ALU_ADD 0 #define ALU_SUB 1 @@ -491,7 +493,7 @@ void assemble_line(int n, unsigned *tok, unsigned *num, char **str) { /* blank lines are fine */ return; case tNOP: - emit(OP_NOP); + emit(OP_NOP_EXP); return; case tNOT: /* XOR rX, rX, -1 */ @@ -573,7 +575,7 @@ void assemble_line(int n, unsigned *tok, unsigned *num, char **str) { expect_register(T1); expect(tCOMMA, T2); expect(tNUMBER, T3); - emit(OP_NOP); //TODO + emit(OP_NOP_EXP); //TODO return; case tHALT: emit(0xFFFF); diff --git a/src/d16v4.c b/src/d16v4.c @@ -151,7 +151,7 @@ struct { const char *fmt; } decode[] = { { 0b0000000000001111, 0b0000000000000000, "@F @C, @A, @B" }, - { 0b0000000000001111, 0b0000000000000001, "UND" }, + { 0b0000000000001111, 0b0000000000000001, "NOP (EXT)" }, { 0b0000000000001111, 0b0000000000000010, "EXT @e" }, { 0b0000000000001111, 0b0000000000000011, "MOV @C, +@9" }, { 0b0000000000001111, 0b0000000000000100, "LW @C, [@A, @6]" }, @@ -162,7 +162,7 @@ struct { { 0b0000000000111111, 0b0000000000010111, "BNZ @A, @7" }, { 0b1111110001111111, 0b0000000000100111, "B @A" }, { 0b1111110001111111, 0b0000000000110111, "BL @A" }, - { 0b1111111111111111, 0b0000000000001000, "NOP" }, // ADD R0, R0, 0 + { 0b1111111111111111, 0b0000000000001000, "NOP (ALU)" }, // ADD R0, R0, 0 { 0b1111110000001111, 0b0000000000001000, "MOV @C, @A" }, // ADD Rc, Ra, 0 { 0b1111110000001111, 0b1111110000001100, "NOT @C, @A" }, // XOR Rc, Ra, -1 { 0b0000000000001000, 0b0000000000001000, "@f @C, @A, +@6" },