commit ea69dff8a8f0b5eac6480fe9707be29654ec813c
parent 99721ecc55d5333cbaae8129aa1c84e9cc1e79cf
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Sun, 23 May 2021 16:27:15 +0100
Updated SFT2 to take byte for shift amount
Diffstat:
13 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/projects/demos/bifurcan.usm b/projects/demos/bifurcan.usm
@@ -107,7 +107,7 @@ RTN
( save-x ) OVR #03 MOD TOS #0008 MUL2 .anchor/x LDZ2 ADD2 .Screen/x DEO2
( save-y ) OVR #03 DIV TOS #0008 MUL2 .anchor/y LDZ2 ADD2 .Screen/y DEO2
( get digit* ) OVR STHkr #02 MUL TOS ;digits ADD2 LDA2
- ( get bit ) ROT #0e SWP SUB TOS SFT2 #0001 AND2
+ ( get bit ) ROT #0e SWP SUB SFT2 #0001 AND2
( set tile ) #0008 MUL2 ;tiles ADD2
( set style ) .style LDZ #10 MUL TOS ADD2
.Screen/addr DEO2
diff --git a/projects/demos/theme.usm b/projects/demos/theme.usm
@@ -2,9 +2,9 @@
%RTN { JMP2r }
%++ { #0001 ADD2 }
-%2/ { #0001 SFT2 }
+%2/ { #01 SFT2 }
%8+ { #0008 ADD2 }
-%STEP8 { #0033 SFT2 }
+%STEP8 { #33 SFT2 }
( devices )
diff --git a/projects/examples/devices/console.lib.usm b/projects/examples/devices/console.lib.usm
@@ -43,10 +43,10 @@ RTN
@print-hexadecimal ( short -- )
LIT '0 .Console/char DEO
LIT 'x .Console/char DEO
- DUP2 #000c SFT2 ,&digit JSR
- DUP2 #0008 SFT2 ,&digit JSR
- DUP2 #0004 SFT2 ,&digit JSR
- ,&digit JSR
+ DUP2 #0c SFT2 ,&digit JSR
+ DUP2 #08 SFT2 ,&digit JSR
+ DUP2 #04 SFT2 ,&digit JSR
+ ,&digit JSR
RTN
&digit
diff --git a/projects/examples/devices/controller.keys.usm b/projects/examples/devices/controller.keys.usm
@@ -2,7 +2,7 @@
%RTN { JMP2r }
%8+ { #0008 ADD2 }
-%8* { #0030 SFT2 }
+%8* { #30 SFT2 }
( devices )
diff --git a/projects/examples/devices/datetime.usm b/projects/examples/devices/datetime.usm
@@ -2,7 +2,7 @@
%RTN { JMP2r }
%MOD { DUP2 DIV MUL SUB }
-%ABS2 { DUP2 #000f SFT2 EQU #04 JCN #ffff MUL2 }
+%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 }
%SCALEX { #0002 DIV2 .Screen/width DEI2 #0002 DIV2 ADD2 #0040 SUB2 }
%SCALEY { #0002 DIV2 .Screen/height DEI2 #0002 DIV2 ADD2 #0040 SUB2 }
%12HOURS { DUP #0c GTH #0c MUL SUB }
diff --git a/projects/examples/devices/file.load.usm b/projects/examples/devices/file.load.usm
@@ -41,7 +41,7 @@
EQU2k ,&end JCN
LDAk
DUP #0a EQU ,&linefeed JCN
- #00 #0005 SFT2 ;font ADD2
+ #0005 SFT2 ;font ADD2
.Screen/addr DEO2
#29 .Screen/color DEO
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2
diff --git a/projects/examples/devices/mouse.usm b/projects/examples/devices/mouse.usm
@@ -1,7 +1,7 @@
( dev/mouse )
%RTN { JMP2r }
-%ABS2 { DUP2 #000f SFT2 EQU #04 JCN #ffff MUL2 }
+%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 }
%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
diff --git a/projects/examples/gui/proportional-font.usm b/projects/examples/gui/proportional-font.usm
@@ -28,7 +28,7 @@ BRK
LDAk
DUP #00 EQU ,&end JCN
DUP #0a EQU ,&linefeed JCN
- #00 #0005 SFT2 ;font ADD2
+ #0005 SFT2 ;font ADD2
DUP2 .Screen/addr DEO2
#29 .Screen/color DEO
,get-x-advance JSR .Screen/x DEI2 ADD2 STH2kr ADD2 .Screen/x DEO2
diff --git a/projects/examples/gui/shapes.usm b/projects/examples/gui/shapes.usm
@@ -4,7 +4,7 @@
%++ { #0001 ADD2 }
%-- { #0001 SUB2 }
%8+ { #0008 ADD2 }
-%ABS2 { DUP2 #000f SFT2 EQU #04 JCN #ffff MUL2 }
+%ABS2 { DUP2 #0f SFT2 EQU #04 JCN #ffff MUL2 }
%LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }
diff --git a/projects/examples/gui/wallpaper.usm b/projects/examples/gui/wallpaper.usm
@@ -11,7 +11,7 @@
|0100 ( -> )
#90ff .System/r DEO2 #9000 .System/g DEO2 #900f .System/b DEO2
- #08e0 .Screen/width DEI2 #0001 SFT2 SUB2 .scroll/x STZ2
+ #08e0 .Screen/width DEI2 #01 SFT2 SUB2 .scroll/x STZ2
#09b0 .scroll/y STZ2
;frame .Screen/vector DEO2
#30 .scroll/wait STZ
diff --git a/projects/software/asma.usm b/projects/software/asma.usm
@@ -432,7 +432,7 @@
STAr
,¬-found JCN
- ;asma-opcodes/_disasm SUB2 #0003 SFT2 ( 00 byte / end* )
+ ;asma-opcodes/_disasm SUB2 #03 SFT2 ( 00 byte / end* )
&loop
LDAkr STHr LIT2r 0001 ADD2r ( 00 byte char / end* )
DUP ,¬-end JCN
diff --git a/projects/software/left.usm b/projects/software/left.usm
@@ -23,7 +23,7 @@
%RTN? { #00 EQU #02 JCN STH2r JMP2 }
%++ { #0001 ADD2 } %-- { #0001 SUB2 }
-%8/ { #0003 SFT2 } %8* { #0030 SFT2 }
+%8/ { #03 SFT2 } %8* { #30 SFT2 }
%8- { #0008 SUB2 } %8+ { #0008 ADD2 }
( devices )
diff --git a/src/uxn.c b/src/uxn.c
@@ -98,7 +98,7 @@ void op_div16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->s
void op_and16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b & a); }
void op_ora16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b | a); }
void op_eor16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b ^ a); }
-void op_sft16(Uxn *u) { Uint16 a = pop16(u->src), b = pop16(u->src); push16(u->src, b >> (a & 0x000f) << ((a & 0x00f0) >> 4)); }
+void op_sft16(Uxn *u) { Uint8 a = pop8(u->src); Uint16 b = pop16(u->src); push16(u->src, b >> (a & 0x0f) << ((a & 0xf0) >> 4)); }
void (*ops[])(Uxn *u) = {
op_brk, op_lit, op_nop, op_pop, op_dup, op_swp, op_ovr, op_rot,