From 9f7e0edb84af4787811502e31a9276d1c8edd42c Mon Sep 17 00:00:00 2001 From: neauoire Date: Fri, 19 Mar 2021 20:41:45 -0700 Subject: [PATCH] Renamed SHR for SFT --- assembler.c | 2 +- build.sh | 2 +- projects/examples/dev.controller.usm | 8 ++++---- projects/examples/gui.editor.usm | 2 +- projects/software/left.usm | 24 ++++++++++++------------ projects/software/nasu.usm | 14 +++++++------- projects/software/noodle.usm | 22 +++++++++++----------- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/assembler.c b/assembler.c index 85e84ee..c5656d8 100644 --- a/assembler.c +++ b/assembler.c @@ -46,7 +46,7 @@ Program p; char ops[][4] = { "BRK", "NOP", "LIT", "LDR", "STR", "---", "JMP", "JSR", - "EQU", "NEQ", "GTH", "LTH", "AND", "ORA", "SHL", "SHR", + "EQU", "NEQ", "GTH", "LTH", "AND", "ORA", "SHL", "SFT", "POP", "DUP", "SWP", "OVR", "ROT", "---", "CLN", "STH", "ADD", "SUB", "MUL", "DIV", "---", "---", "---", "XOR" }; diff --git a/build.sh b/build.sh index 9bc2dea..a65f69a 100755 --- a/build.sh +++ b/build.sh @@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator # run -./bin/assembler projects/software/left.usm bin/boot.rom +./bin/assembler projects/software/noodle.usm bin/boot.rom ./bin/emulator bin/boot.rom diff --git a/projects/examples/dev.controller.usm b/projects/examples/dev.controller.usm index 40e74a5..1e6c0a9 100644 --- a/projects/examples/dev.controller.usm +++ b/projects/examples/dev.controller.usm @@ -34,13 +34,13 @@ BRK ( detect movement ) ~Controller.buttons #f0 AND - DUP #04 SHR #01 AND #01 NEQ ,$no-up ROT JMP2? + DUP #04 SFT #01 AND #01 NEQ ,$no-up ROT JMP2? ( move ) ~Sprite.y -- =Sprite.y ,up_icn =Sprite.addr $no-up - DUP #05 SHR #01 AND #01 NEQ ,$no-down ROT JMP2? + DUP #05 SFT #01 AND #01 NEQ ,$no-down ROT JMP2? ( move ) ~Sprite.y ++ =Sprite.y ,down_icn =Sprite.addr $no-down - DUP #06 SHR #01 AND #01 NEQ ,$no-left ROT JMP2? + DUP #06 SFT #01 AND #01 NEQ ,$no-left ROT JMP2? ( move ) ~Sprite.x -- =Sprite.x ,left_icn =Sprite.addr $no-left - DUP #07 SHR #01 AND #01 NEQ ,$no-right ROT JMP2? + DUP #07 SFT #01 AND #01 NEQ ,$no-right ROT JMP2? ( move ) ~Sprite.x ++ =Sprite.x ,right_icn =Sprite.addr $no-right POP diff --git a/projects/examples/gui.editor.usm b/projects/examples/gui.editor.usm index 244f3f3..c158c83 100644 --- a/projects/examples/gui.editor.usm +++ b/projects/examples/gui.editor.usm @@ -81,7 +81,7 @@ RTN $hor ( get bit ) ,cell0_icn #00 - ~editor.addr #00 ~pixel.y ADD2 LDR #07 ~pixel.x SUB SHR #01 AND ( get bit ) + ~editor.addr #00 ~pixel.y ADD2 LDR #07 ~pixel.x SUB SFT #01 AND ( get bit ) #0008 MUL2 ADD2 =Sprite.addr ( add *8 ) ( draw ) #08 =Sprite.color ( incr ) ~Sprite.x #0008 ADD2 =Sprite.x diff --git a/projects/software/left.usm b/projects/software/left.usm index 9bf5065..8e64694 100644 --- a/projects/software/left.usm +++ b/projects/software/left.usm @@ -19,7 +19,7 @@ %RTN? { JMP2r? } %++ { #0001 ADD2 } %-- { #0001 SUB2 } -%8/ { #0003 SHR2 } %8* { #0003 SHL2 } +%8/ { #0003 SFT2 } %8* { #0003 SHL2 } %8- { #0008 SUB2 } %8+ { #0008 ADD2 } ;lock { byte 1 } @@ -78,37 +78,37 @@ BRK @no-ctrl-right ( alt ) ,no-alt ~Controller #0f AND #02 NEQ JMP2? - ,no-aup ~Controller #04 SHR #01 NEQ JMP2? + ,no-aup ~Controller #04 SFT #01 NEQ JMP2? ,find-wordstart JSR2 =selection.to ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-aup - ,no-adown ~Controller #04 SHR #02 NEQ JMP2? + ,no-adown ~Controller #04 SFT #02 NEQ JMP2? ,find-wordend JSR2 =selection.to ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-adown - ,no-aleft ~Controller #04 SHR #04 NEQ JMP2? + ,no-aleft ~Controller #04 SFT #04 NEQ JMP2? ~selection.to -- =selection.to ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-aleft - ,no-aright ~Controller #04 SHR #08 NEQ JMP2? + ,no-aright ~Controller #04 SFT #08 NEQ JMP2? ~selection.to ++ =selection.to ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-aright @no-alt ( ctrl ) ,no-ctrl ~Controller #0f AND #01 NEQ JMP2? - ,no-cup ~Controller #04 SHR #01 NEQ JMP2? + ,no-cup ~Controller #04 SFT #01 NEQ JMP2? #0004 ,scroll-up JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-cup - ,no-cdown ~Controller #04 SHR #02 NEQ JMP2? + ,no-cdown ~Controller #04 SFT #02 NEQ JMP2? #0004 ,scroll-down JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-cdown - ,no-cleft ~Controller #04 SHR #04 NEQ JMP2? + ,no-cleft ~Controller #04 SFT #04 NEQ JMP2? ,goto-linestart JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-cleft - ,no-cright ~Controller #04 SHR #08 NEQ JMP2? + ,no-cright ~Controller #04 SFT #08 NEQ JMP2? ,goto-lineend JSR2 ,redraw JSR2 ,ctrl-end JMP2 @no-cright @no-ctrl @@ -468,13 +468,13 @@ RTN @draw-short ( short ) =addr - ,font_hex #00 ,addr LDR #f0 AND #04 SHR #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ,addr LDR #f0 AND #04 SFT #08 MUL ADD2 =Sprite.addr ( draw ) #0e =Sprite.color ~Sprite.x 8+ =Sprite.x ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =Sprite.addr ( draw ) #0e =Sprite.color ~Sprite.x 8+ =Sprite.x - ,font_hex #00 ,addr ++ LDR #f0 AND #04 SHR #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ,addr ++ LDR #f0 AND #04 SFT #08 MUL ADD2 =Sprite.addr ( draw ) #0e =Sprite.color ~Sprite.x 8+ =Sprite.x ,font_hex #00 ,addr ++ LDR #0f AND #08 MUL ADD2 =Sprite.addr @@ -556,7 +556,7 @@ RTN #0000 =Sprite.x ~scroll.y ~Sprite.y 8/ ADD2 DUP2 SWP POP =k ~position.y EQU2 #0c MUL =l - ,font_hex #00 ~k #f0 AND #04 SHR #08 MUL ADD2 =Sprite.addr + ,font_hex #00 ~k #f0 AND #04 SFT #08 MUL ADD2 =Sprite.addr #02 ~l ADD =Sprite.color #0008 =Sprite.x ,font_hex #00 ~k #0f AND #08 MUL ADD2 =Sprite.addr diff --git a/projects/software/nasu.usm b/projects/software/nasu.usm index bc827dc..6d8947f 100644 --- a/projects/software/nasu.usm +++ b/projects/software/nasu.usm @@ -8,11 +8,11 @@ %RTN { JMP2r } %RTN? { JMP2r? } -%STEP8 { #0003 SHR2 #0003 SHL2 } +%STEP8 { #0003 SFT2 #0003 SHL2 } %++ { #0001 ADD2 } -%2/ { #0001 SHR2 } %2* { #0001 SHL2 } -%8/ { #0003 SHR2 } %8* { #0003 SHL2 } +%2/ { #0001 SFT2 } %2* { #0001 SHL2 } +%8/ { #0003 SFT2 } %8* { #0003 SHL2 } %8- { #0008 SUB2 } %8+ { #0008 ADD2 } ;bankview { x 2 y 2 mode 1 addr 2 } @@ -359,7 +359,7 @@ RTN #00 =i $bytes ~tileview.x #0088 ADD2 =SPRT.x - ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #f0 AND #04 SHR #08 MUL ADD2 =SPRT.addr + ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #f0 AND #04 SFT #08 MUL ADD2 =SPRT.addr ( draw ) #02 =SPRT.color ~SPRT.x 8+ =SPRT.x ,font_hex #00 ~tileview.addr #00 ~i ADD2 LDR #0f AND #08 MUL ADD2 =SPRT.addr @@ -404,7 +404,7 @@ RTN $hor ( get bit ) ,blank_icn #00 - ~tileview.addr #00 ~pt.y ADD2 LDR #07 ~pt.x SUB SHR #01 AND ( get bit ) + ~tileview.addr #00 ~pt.y ADD2 LDR #07 ~pt.x SUB SFT #01 AND ( get bit ) 8* ADD2 =SPRT.addr ( add *8 ) ( draw ) #01 =SPRT.color ( incr ) ~SPRT.x 8+ =SPRT.x @@ -445,13 +445,13 @@ RTN @draw-short ( short ) =addr - ,font_hex #00 ,addr LDR #f0 AND #04 SHR #08 MUL ADD2 =SPRT.addr + ,font_hex #00 ,addr LDR #f0 AND #04 SFT #08 MUL ADD2 =SPRT.addr ( draw ) #02 =SPRT.color ~SPRT.x 8+ =SPRT.x ,font_hex #00 ,addr LDR #0f AND #08 MUL ADD2 =SPRT.addr ( draw ) #02 =SPRT.color ~SPRT.x 8+ =SPRT.x - ,font_hex #00 ,addr ++ LDR #f0 AND #04 SHR #08 MUL ADD2 =SPRT.addr + ,font_hex #00 ,addr ++ LDR #f0 AND #04 SFT #08 MUL ADD2 =SPRT.addr ( draw ) #02 =SPRT.color ~SPRT.x 8+ =SPRT.x ,font_hex #00 ,addr ++ LDR #0f AND #08 MUL ADD2 =SPRT.addr diff --git a/projects/software/noodle.usm b/projects/software/noodle.usm index bb847a1..3bd99ee 100644 --- a/projects/software/noodle.usm +++ b/projects/software/noodle.usm @@ -21,8 +21,8 @@ %RTN { JMP2r } %RTN? { JMP2r? } %++ { #0001 ADD2 } %-- { #0001 SUB2 } -%2/ { #0001 SHR2 } -%8/ { #0003 SHR2 } %8* { #0003 SHL2 } +%2/ { #0001 SFT2 } +%8/ { #0003 SFT2 } %8* { #0003 SHL2 } %8+ { #0008 ADD2 } %MOD8 { #0007 AND2 } @@ -149,13 +149,13 @@ BRK $no-touch ~Controller.buttons #f0 AND - DUP #04 SHR #01 AND #01 NEQ ,$no-up ROT JMP2? + DUP #04 SFT #01 AND #01 NEQ ,$no-up ROT JMP2? ( move ) ~zoom.y -- =zoom.y $no-up - DUP #05 SHR #01 AND #01 NEQ ,$no-down ROT JMP2? + DUP #05 SFT #01 AND #01 NEQ ,$no-down ROT JMP2? ( move ) ~zoom.y ++ =zoom.y $no-down - DUP #06 SHR #01 AND #01 NEQ ,$no-left ROT JMP2? + DUP #06 SFT #01 AND #01 NEQ ,$no-left ROT JMP2? ( move ) ~zoom.x -- =zoom.x $no-left - DUP #07 SHR #01 AND #01 NEQ ,$no-right ROT JMP2? + DUP #07 SFT #01 AND #01 NEQ ,$no-right ROT JMP2? ( move ) ~zoom.x ++ =zoom.x $no-right #00 NEQ ,draw-canvas ROT JSR2? @@ -231,7 +231,7 @@ RTN #00 =px.x $hor ( addr ) ,size_icn #00 ~cursor.size 8* ADD2 - ( byte ) #00 ~px.y ADD2 LDR #07 ~px.x SUB SHR #01 AND + ( byte ) #00 ~px.y ADD2 LDR #07 ~px.x SUB SFT #01 AND #00 EQU ,$no-pixel ROT JMP2? ,$no-pixel ,patternize JSR2 #00 EQU JMP2? ~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ,add-pixel JSR2 @@ -267,7 +267,7 @@ RTN #00 =px.x $hor ( addr ) ,size_icn #00 ~cursor.size 8* ADD2 - ( byte ) #00 ~px.y ADD2 LDR #07 ~px.x SUB SHR #01 AND + ( byte ) #00 ~px.y ADD2 LDR #07 ~px.x SUB SFT #01 AND #00 EQU ,$no-pixel ROT JMP2? ,$no-pixel ,patternize JSR2 #00 EQU JMP2? ~pt0.x #00 ~px.x ADD2 ~pt0.y #00 ~px.y ADD2 ,remove-pixel JSR2 @@ -336,7 +336,7 @@ RTN SWP POP #07 AND =px.x ( get tile ) ~pt1.x 8/ ~pt1.y 8/ ~canvas.w MUL2 ADD2 8* ( add addr ) ,data ADD2 - #00 ~px.y ADD2 LDR #07 ~px.x SUB SHR #01 AND + #00 ~px.y ADD2 LDR #07 ~px.x SUB SFT #01 AND RTN @@ -517,14 +517,14 @@ RTN ( draw width ) ~Screen.width #0048 SUB2 =Sprite.x - ,font_hex ~canvas.w #f0 AND #04 SHR #08 MUL ADD2 =Sprite.addr + ,font_hex ~canvas.w #f0 AND #04 SFT #08 MUL ADD2 =Sprite.addr ( draw ) #02 =Sprite.color ~Sprite.x 8+ =Sprite.x ,font_hex ~canvas.w #0f AND #08 MUL ADD2 =Sprite.addr ( draw ) #02 =Sprite.color ~Sprite.x 8+ =Sprite.x ( draw height ) - ,font_hex ~canvas.h #f0 AND #04 SHR #08 MUL ADD2 =Sprite.addr + ,font_hex ~canvas.h #f0 AND #04 SFT #08 MUL ADD2 =Sprite.addr ( draw ) #02 =Sprite.color ~Sprite.x 8+ =Sprite.x ,font_hex ~canvas.h #0f AND #08 MUL ADD2 =Sprite.addr