greg parsing

This commit is contained in:
Devine Lu Linvega 2023-05-25 11:33:43 -07:00
parent de083f7483
commit 1f5bafd50a
2 changed files with 23 additions and 9 deletions

View File

@ -40,6 +40,7 @@ BRK
DUP zlen phex/b #0a18 DEO DUP zlen phex/b #0a18 DEO
DUP zlen #05 EQU ?&on-arvgre DUP zlen #05 EQU ?&on-arvgre
DUP zlen #0a EQU ?&on-grearv
#1234 phex #0a18 DEO #1234 phex #0a18 DEO
( error ) ( error )
pztr #0a18 DEO pztr #0a18 DEO
@ -50,13 +51,32 @@ JMP2r
&on-arvgre ( ztr -- ) &on-arvgre ( ztr -- )
( month ) INCk INC LDZk LIT "A SUB #00 SWP #000e MUL2 STH2 ( month ) INCk INC LDZk LIT "A SUB #00 SWP #000e MUL2 STH2
( date ) INC LDZ2 bytedec #00 SWP STH2r ADD2 INC2 ( date ) INC LDZ2 bytedec STH2r ADD2 INC2
( year ) ROT LDZ2 bytedec #00 SWP #07d6 ADD2 ( year ) ROT LDZ2 bytedec #07d6 ADD2
print-greg print-greg
#010f DEO #010f DEO
JMP2r JMP2r
&on-grearv ( ztr -- )
( year )
STHk LDZ2 bytedec #0064 MUL2 INCr INCr
STHkr LDZ2 bytedec ADD2 pdec #0a18 DEO INCr INCr INCr
( month )
STHkr LDZ2 bytedec pdec #0a18 DEO INCr INCr INCr
( day )
STHr LDZ2 bytedec pdec #0a18 DEO
#010f DEO
JMP2r
@bytedec ( byte -- dec* )
LIT "0 SUB SWP LIT "0 SUB #0a MUL ADD #00 SWP
JMP2r
@print-greg ( doty* year* -- ) @print-greg ( doty* year* -- )
pdec #2018 DEO pdec #2018 DEO
@ -64,12 +84,6 @@ JMP2r
JMP2r JMP2r
@bytedec ( byte -- dec )
LIT "0 SUB SWP LIT "0 SUB #0a MUL ADD
JMP2r
@print-arvelie ( doty* year* -- ) @print-arvelie ( doty* year* -- )
#07d6 SUB2 NIP #07d6 SUB2 NIP

View File

@ -7,7 +7,7 @@ LIN="uxncli $HOME/roms/uxnlin.rom"
SRC="${ID}.tal" SRC="${ID}.tal"
DST="${ID}.rom" DST="${ID}.rom"
CPY="$HOME/roms" CPY="$HOME/roms"
ARG="17K04" ARG="2023-05-25"
if [[ "$*" == *"--lint"* ]] if [[ "$*" == *"--lint"* ]]
then then