Replaced CLR and SET with HLT and NOP.
h3rald h3rald@h3rald.com
Fri, 27 Feb 2026 07:02:58 +0100
4 files changed,
5 insertions(+),
7 deletions(-)
M
xyw-vscode/syntaxes/xyw.tmLanguage.json
→
xyw-vscode/syntaxes/xyw.tmLanguage.json
@@ -140,7 +140,7 @@ }
}, { "comment": "All other instructions with optional xyw modifiers", - "match": "\\b(PSH|POP|CLR|SET|LDB|LDW|STB|STW|INC|DEC|SHL|SHR|ADD|SUB|MUL|DIV|EQU|NEQ|GTH|LTH|AND|IOR|XOR|NOT|SWP|DUP)([xyw]*)\\b", + "match": "\\b(PSH|POP|HLT|NOP|LDB|LDW|STB|STW|INC|DEC|SHL|SHR|ADD|SUB|MUL|DIV|EQU|NEQ|GTH|LTH|AND|IOR|XOR|NOT|SWP|DUP)([xyw]*)\\b", "captures": { "1": { "name": "variable.other.instruction.xyw"
M
xyw.vim
→
xyw.vim
@@ -43,7 +43,7 @@ " Instructions - JMP, JCN, JSR support x or y (not both) and w
syntax match xywInstruction "\<\(JMP\|JCN\|JSR\)\([xy]\?w\?\)\>" " Instructions - All other instructions with optional xyw modifiers -syntax match xywInstruction "\<\(PSH\|POP\|CLR\|SET\|LDB\|LDW\|STB\|STW\|INC\|DEC\|SHL\|SHR\|ADD\|SUB\|MUL\|DIV\|EQU\|NEQ\|GTH\|LTH\|AND\|IOR\|XOR\|NOT\|SWP\|DUP\)\([xyw]*\)\>" +syntax match xywInstruction "\<\(PSH\|POP\|HLT\|NOP\|LDB\|LDW\|STB\|STW\|INC\|DEC\|SHL\|SHR\|ADD\|SUB\|MUL\|DIV\|EQU\|NEQ\|GTH\|LTH\|AND\|IOR\|XOR\|NOT\|SWP\|DUP\)\([xyw]*\)\>" " Define highlight groups highlight default link xywComment Comment
M
xywrun.c
→
xywrun.c
@@ -417,10 +417,8 @@ XYW_DBG(" -- PC: %04X -> %02X (%s) [U:%02X|S:%02X|X:%02X|Y:%02X|XW:%04X|YW:%04X]\n", *pc, xyw_memory[*pc], xyw_instructions[xyw_memory[*pc] & 0x1F], *u, *s, *x, *y, *xw, *yw);
switch (xyw_memory[*pc]) { // clang-format off - /* CLR */ OPC_SR1(0x00, , if (rx||ry) { SET(0); } else { *x = saved_x; *y = saved_y; *xw = saved_xw; *yw = saved_yw; return 0; }); - /* CLR */ OPC_SR1r(0x00, if (w) { *xw = 0; *yw = 0; } else { *x = 0; *y = 0; } ); - /* SET */ OPC_SR1(0x01, , if (w) { SET(0xFFFF); } else { SET(0xFF); }); - /* SET */ OPC_SR1r(0x01, if (w) { *xw = 0xFFFF; *yw = 0xFFFF; } else { *x = 0xFF; *y = 0xFF; } ); + /* HLT */ case 0x00: return 0; + /* NOP */ case 0x01: break; /* PSH */ OPC_SR1(0x02, , if (rx||ry) { PUSH(ARG); } else { (*pc)++; PUSH(READ(*pc)); if (w) { (*pc)++; } }) /* PSH */ OPC_SR1r(0x02, PUSH(a); PUSH(b); ) /* POP */ OPC_SR1(0x03, , if (rx||ry) { SET(POP()); } else { POP(); } );