Updated SFT2 to take byte for shift amount

This commit is contained in:
Andrew Alderwick 2021-05-23 16:27:15 +01:00
parent 99721ecc55
commit ea69dff8a8
13 changed files with 17 additions and 17 deletions

View File

@ -107,7 +107,7 @@ RTN
( save-x ) OVR #03 MOD TOS #0008 MUL2 .anchor/x LDZ2 ADD2 .Screen/x DEO2 ( 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 ( 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 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 tile ) #0008 MUL2 ;tiles ADD2
( set style ) .style LDZ #10 MUL TOS ADD2 ( set style ) .style LDZ #10 MUL TOS ADD2
.Screen/addr DEO2 .Screen/addr DEO2

View File

@ -2,9 +2,9 @@
%RTN { JMP2r } %RTN { JMP2r }
%++ { #0001 ADD2 } %++ { #0001 ADD2 }
%2/ { #0001 SFT2 } %2/ { #01 SFT2 }
%8+ { #0008 ADD2 } %8+ { #0008 ADD2 }
%STEP8 { #0033 SFT2 } %STEP8 { #33 SFT2 }
( devices ) ( devices )

View File

@ -43,10 +43,10 @@ RTN
@print-hexadecimal ( short -- ) @print-hexadecimal ( short -- )
LIT '0 .Console/char DEO LIT '0 .Console/char DEO
LIT 'x .Console/char DEO LIT 'x .Console/char DEO
DUP2 #000c SFT2 ,&digit JSR DUP2 #0c SFT2 ,&digit JSR
DUP2 #0008 SFT2 ,&digit JSR DUP2 #08 SFT2 ,&digit JSR
DUP2 #0004 SFT2 ,&digit JSR DUP2 #04 SFT2 ,&digit JSR
,&digit JSR ,&digit JSR
RTN RTN
&digit &digit

View File

@ -2,7 +2,7 @@
%RTN { JMP2r } %RTN { JMP2r }
%8+ { #0008 ADD2 } %8+ { #0008 ADD2 }
%8* { #0030 SFT2 } %8* { #30 SFT2 }
( devices ) ( devices )

View File

@ -2,7 +2,7 @@
%RTN { JMP2r } %RTN { JMP2r }
%MOD { DUP2 DIV MUL SUB } %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 } %SCALEX { #0002 DIV2 .Screen/width DEI2 #0002 DIV2 ADD2 #0040 SUB2 }
%SCALEY { #0002 DIV2 .Screen/height DEI2 #0002 DIV2 ADD2 #0040 SUB2 } %SCALEY { #0002 DIV2 .Screen/height DEI2 #0002 DIV2 ADD2 #0040 SUB2 }
%12HOURS { DUP #0c GTH #0c MUL SUB } %12HOURS { DUP #0c GTH #0c MUL SUB }

View File

@ -41,7 +41,7 @@
EQU2k ,&end JCN EQU2k ,&end JCN
LDAk LDAk
DUP #0a EQU ,&linefeed JCN DUP #0a EQU ,&linefeed JCN
#00 #0005 SFT2 ;font ADD2 #0005 SFT2 ;font ADD2
.Screen/addr DEO2 .Screen/addr DEO2
#29 .Screen/color DEO #29 .Screen/color DEO
.Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2

View File

@ -1,7 +1,7 @@
( dev/mouse ) ( dev/mouse )
%RTN { JMP2r } %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 } %LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 } %GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }

View File

@ -28,7 +28,7 @@ BRK
LDAk LDAk
DUP #00 EQU ,&end JCN DUP #00 EQU ,&end JCN
DUP #0a EQU ,&linefeed JCN DUP #0a EQU ,&linefeed JCN
#00 #0005 SFT2 ;font ADD2 #0005 SFT2 ;font ADD2
DUP2 .Screen/addr DEO2 DUP2 .Screen/addr DEO2
#29 .Screen/color DEO #29 .Screen/color DEO
,get-x-advance JSR .Screen/x DEI2 ADD2 STH2kr ADD2 .Screen/x DEO2 ,get-x-advance JSR .Screen/x DEI2 ADD2 STH2kr ADD2 .Screen/x DEO2

View File

@ -4,7 +4,7 @@
%++ { #0001 ADD2 } %++ { #0001 ADD2 }
%-- { #0001 SUB2 } %-- { #0001 SUB2 }
%8+ { #0008 ADD2 } %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 } %LTS2 { #8000 ADD2 SWP2 #8000 ADD2 GTH2 }
%GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 } %GTS2 { #8000 ADD2 SWP2 #8000 ADD2 LTH2 }

View File

@ -11,7 +11,7 @@
|0100 ( -> ) |0100 ( -> )
#90ff .System/r DEO2 #9000 .System/g DEO2 #900f .System/b DEO2 #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 #09b0 .scroll/y STZ2
;frame .Screen/vector DEO2 ;frame .Screen/vector DEO2
#30 .scroll/wait STZ #30 .scroll/wait STZ

View File

@ -432,7 +432,7 @@
STAr STAr
,&not-found JCN ,&not-found JCN
;asma-opcodes/_disasm SUB2 #0003 SFT2 ( 00 byte / end* ) ;asma-opcodes/_disasm SUB2 #03 SFT2 ( 00 byte / end* )
&loop &loop
LDAkr STHr LIT2r 0001 ADD2r ( 00 byte char / end* ) LDAkr STHr LIT2r 0001 ADD2r ( 00 byte char / end* )
DUP ,&not-end JCN DUP ,&not-end JCN

View File

@ -23,7 +23,7 @@
%RTN? { #00 EQU #02 JCN STH2r JMP2 } %RTN? { #00 EQU #02 JCN STH2r JMP2 }
%++ { #0001 ADD2 } %-- { #0001 SUB2 } %++ { #0001 ADD2 } %-- { #0001 SUB2 }
%8/ { #0003 SFT2 } %8* { #0030 SFT2 } %8/ { #03 SFT2 } %8* { #30 SFT2 }
%8- { #0008 SUB2 } %8+ { #0008 ADD2 } %8- { #0008 SUB2 } %8+ { #0008 ADD2 }
( devices ) ( devices )

View File

@ -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_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_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_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) = { void (*ops[])(Uxn *u) = {
op_brk, op_lit, op_nop, op_pop, op_dup, op_swp, op_ovr, op_rot, op_brk, op_lit, op_nop, op_pop, op_dup, op_swp, op_ovr, op_rot,