From 2e9d70f93457c824ae8d9f4c673639cd648dcf5f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 11 Jan 2024 17:03:58 -0800 Subject: [PATCH] Assembles hello.tal --- makefile | 8 ++++---- src/drifloon.tal | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/makefile b/makefile index e982e46..b4e0c1e 100644 --- a/makefile +++ b/makefile @@ -18,10 +18,10 @@ run: all # @ ${EMU} ${ROM} src/${ID}.tal ${ROM} # @ ${EMU} ${ROM} examples/hello.tal bin/hello.rom # @ ${EMU} bin/hello.rom - @ uxnasm examples/hello.tal bin/res.rom - @ uxncli ~/roms/hx.rom bin/res.rom - @ cat examples/hello.tal | ${EMU} ${ROM} > bin/res.rom - @ uxncli ~/roms/hx.rom bin/res.rom + @ uxnasm examples/hello.tal bin/a.rom + @ uxncli ~/roms/hx.rom bin/a.rom + @ cat examples/hello.tal | ${EMU} ${ROM} > bin/b.rom + @ uxncli ~/roms/hx.rom bin/b.rom install: all @ cp ${ROM} ${DIR} uninstall: diff --git a/src/drifloon.tal b/src/drifloon.tal index b98d1e2..4b90497 100644 --- a/src/drifloon.tal +++ b/src/drifloon.tal @@ -309,17 +309,18 @@ POP2 POP2 #00 JMP2r &on-found ( name* bounds* -- byte ) ( LITk ) NIP DUP #00 EQU #70 SFT ORA STH - ( modes ) #0003 ADD2 STHr - ( flag ) [ LITr 00 ] + ( modes ) #0003 ADD2 &w ( -- ) - LDAk #20 OVR [ LIT "2 ] EQU ?&>end - DUP ADD OVR [ LIT "r ] EQU ?&>end - DUP ADD OVR [ LIT "k ] EQU ?&>end - DUP ADD OVR #00 EQU ?&>end - &>end - NIP STH - ORAr INC2 LDAk ?&w - POP2 STHr ADD JMP2r + LDAk ?{ POP2 STHr JMP2r } + LDAk get-mode-value STH ORAr + INC2 !&w + +@get-mode-value ( c -- byte ) + DUP [ LIT "2 ] NEQ ?{ POP #20 JMP2r } + DUP [ LIT "k ] NEQ ?{ POP #80 JMP2r } + DUP [ LIT "r ] NEQ ?{ POP #40 JMP2r } + POP #00 +JMP2r ( @|stdlib ) @@ -376,7 +377,7 @@ POP2 POP2r JMP2r @ ( str* -: ) - LDAk #18 DEO + LDAk #19 DEO INC2 & LDAk ? POP2 JMP2r @@ -394,7 +395,7 @@ &b ( -- ) DUP #04 SFT /c &c ( -- ) - #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO + #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #19 DEO JMP2r (