(uxn.c) Added micro opcode without assignment

This commit is contained in:
Devine Lu Linvega 2024-08-17 11:03:11 -07:00
parent b6d876ae4c
commit a98ba20d20
3 changed files with 5 additions and 4 deletions

View File

@ -24,6 +24,7 @@ WITH REGARD TO THIS SOFTWARE.
/* 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++]
@ -60,8 +61,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))

View File

@ -267,7 +267,7 @@ main(int argc, char **argv)
int i = 1; int i = 1;
char *rom; char *rom;
if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') { if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') {
fprintf(stdout, "Uxn11 - Varvara Emulator, 12 Aug 2024.\n"); fprintf(stdout, "Uxn11 - Varvara Emulator, 17 Aug 2024.\n");
i++; i++;
} }
rom = i == argc ? "boot.rom" : argv[i++]; rom = i == argc ? "boot.rom" : argv[i++];

View File

@ -68,7 +68,7 @@ main(int argc, char **argv)
int i = 1; int i = 1;
char *rom; char *rom;
if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') { if(i != argc && argv[i][0] == '-' && argv[i][1] == 'v') {
fprintf(stdout, "Uxncli - Console Varvara Emulator, 12 Aug 2024.\n"); fprintf(stdout, "Uxncli - Console Varvara Emulator, 17 Aug 2024.\n");
i++; i++;
} }
rom = i == argc ? "boot.rom" : argv[i++]; rom = i == argc ? "boot.rom" : argv[i++];