From f9b262c1a028d63292b83fdfab534d8176294fad Mon Sep 17 00:00:00 2001 From: glenda Date: Fri, 7 Mar 2025 01:22:28 +0000 Subject: [PATCH] arvelie.tal --- .gitignore | 1 + arvelie.tal | 29 +++++++++++++++++++++++++++++ mkfile | 7 +++++++ 3 files changed, 37 insertions(+) create mode 100644 .gitignore create mode 100644 arvelie.tal create mode 100644 mkfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..eb8e39c694ae0b00f6d0146aa091a8087d15cbb0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.rom diff --git a/arvelie.tal b/arvelie.tal new file mode 100644 index 0000000000000000000000000000000000000000..1eef80374ede81ad009d8f0ca147fea94184dc21 --- /dev/null +++ b/arvelie.tal @@ -0,0 +1,29 @@ +|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1 +|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 + +|00 +@NumLen $1 @NumBuf $5 + +%start-year ( -- year* ) { #07e9 } ( y2025 ) + +%mod ( a b -- a%b ) { DIVk MUL SUB } + +|100 +@on-reset ( -> ) + .DateTime/year DEI2 start-year SUB2 NIP print2 ( print year ) + .DateTime/doty DEI2 #0e DIVk DUP print-month ( print month ) + MUL SUB print2 ( complete the modulo, print day ) + BRK + +@print2 ( num -- ) + #64 mod ( lock to 0..99 ) + #0a DIVk DUP #30 ADD .Console/write DEO ( print first digit ) + MUL SUB #30 ADD .Console/write DEO ( print second digit ) + JMP2r + +@print-month ( month -- ) + INC #1b mod ( map 26 in to 0, clamp to 0..26 ) + DUP ?{ #15 SUB } ( convert 0 to + ) + #40 ADD .Console/write DEO + JMP2r + diff --git a/mkfile b/mkfile new file mode 100644 index 0000000000000000000000000000000000000000..2ad56c9804975ae6d7cba8d6ce7b5831899957ec --- /dev/null +++ b/mkfile @@ -0,0 +1,7 @@ +roms=\ + arvelie.rom + +all:VQ: $roms + +%.rom: %.tal + games/uxnasm $stem.tal $stem.rom