(uxn.c) Added microcode without assignment

This commit is contained in:
Devine Lu Linvega 2024-08-17 11:09:16 -07:00
parent d3e89bfe04
commit aead0cdca9
1 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ emu_deo(Uint8 addr, Uint8 value)
/* Microcode */ /* Microcode */
#define REM if(_r) uxn.rst.ptr -= 1 + _2; else uxn.wst.ptr -= 1 + _2;
#define JMI pc += uxn.ram[pc++] << 8 | uxn.ram[pc++]; #define JMI pc += uxn.ram[pc++] << 8 | uxn.ram[pc++];
#define JMP(j) if(_2) pc = (j); else pc += (Sint8)(j); #define JMP(j) if(_2) pc = (j); else pc += (Sint8)(j);
#define INC(s) uxn.s.dat[uxn.s.ptr++] #define INC(s) uxn.s.dat[uxn.s.ptr++]
@ -84,8 +85,8 @@ uxn_eval(Uint16 pc)
/* L2r */ case 0xe0: INC(rst) = uxn.ram[pc++]; /* L2r */ case 0xe0: INC(rst) = uxn.ram[pc++];
/* LIr */ case 0xc0: INC(rst) = uxn.ram[pc++]; break; /* LIr */ case 0xc0: INC(rst) = uxn.ram[pc++]; break;
/* INC */ OPC(0x01, POx(a),PUx(a + 1)) /* INC */ OPC(0x01, POx(a),PUx(a + 1))
/* POP */ OPC(0x02, GET(a,b),0) /* POP */ OPC(0x02, REM,0)
/* NIP */ OPC(0x03, GET(a,b) GET(c,d),PUT(a,b)) /* NIP */ OPC(0x03, GET(a,b) REM,PUT(a,b))
/* SWP */ OPC(0x04, GET(a,b) GET(c,d),PUT(a,b) PUT(c,d)) /* SWP */ OPC(0x04, GET(a,b) GET(c,d),PUT(a,b) PUT(c,d))
/* ROT */ OPC(0x05, GET(a,b) GET(c,d) GET(e,f),PUT(c,d) PUT(a,b) PUT(e,f)) /* ROT */ OPC(0x05, GET(a,b) GET(c,d) GET(e,f),PUT(c,d) PUT(a,b) PUT(e,f))
/* DUP */ OPC(0x06, GET(a,b),PUT(a,b) PUT(a,b)) /* DUP */ OPC(0x06, GET(a,b),PUT(a,b) PUT(a,b))