esop

Essential Stack-Operated Phone (concept)
git clone git://git.luxferre.top/esop.git
Log | Files | Refs | README | LICENSE

commit 948b81084a6e8daebff3bbb095f34e5947402b4c
parent cf6a6e42598682b829124be83c3bc13bec285cd5
Author: Luxferre <lux@ferre>
Date:   Sun, 31 Jul 2022 23:36:51 +0300

started implementing decimal output

Diffstat:
Mtal-lib/esop-lib-macro.tal | 1+
Mtal-lib/esop-lib-subs.tal | 36+++++++++++++++++++++---------------
Mtal-lib/moveme.tal | 4++++
3 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/tal-lib/esop-lib-macro.tal b/tal-lib/esop-lib-macro.tal @@ -3,6 +3,7 @@ |00 @Control [ &framevec $2 &io $2 &random $1 &status $1 &sound $1 &syscall $1 ] +( zero-page pseudo-vector to only be used with DATETIME-COMPAT macro ) |c0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &dst $1 ] ( control block macros ) diff --git a/tal-lib/esop-lib-subs.tal b/tal-lib/esop-lib-subs.tal @@ -75,27 +75,33 @@ INC2 ,&loop JMP &eof POP2 JMP2r -( convert true hex short value to BCD - up to 9999 represented by #270f coded into #9999 ) - -( convert BCD to hex value ) - -( output decimal short ) +( draw decimal short ) @print-dec ( x y value* -- x y ) - STH2 ( value* -- ) - #00 ,&zero STR + SWP2 ,&coords STR2 ( value* -- ) #2710 ,&parse JSR #03e8 ,&parse JSR #0064 ,&parse JSR #000a ,&parse JSR - ,&emit JSR POP - STH2r -JMP2r - &parse DIV2k DUP ,&emit JSR MUL2 SUB2 JMP2r - &emit - DUP [ LIT &zero $1 ] #0000 EQU2 ,&skip JCN - #01 ,&zero STR DUP #30 ADD STH2r ROT ;putc STH2 JSR2 &skip POP JMP2r + NIP ,&emit JSR + ,&coords LDR2 + JMP2r + &parse + DIV2k ( value* divisor* -- value* divisor* div* ) + DUP ( value* divisor* div* divlonib -- ) + ,&emit JSR ( value* divisor* div* -- ) + MUL2 ( value* divisor* div* -- value* wholevalue* ) + SUB2 ( value* wholevalue* -- rem* ) + JMP2r + &emit + #30 ADD + ,&coords LDR2 + ROT + ;putc JSR2 + ,&coords STR2 + JMP2r + LIT &coords $2 -( nanofont glyphs for ESOP, courtesy of Michaelangel007 ) +( the basic 96 nanofont glyphs for ESOP, courtesy of Michaelangel007 ) @nanofont 0000 4400 aa00 aee0 64c4 ce60 4c60 4000 4840 4240 6600 4e40 0088 0e00 0080 2480 diff --git a/tal-lib/moveme.tal b/tal-lib/moveme.tal @@ -14,6 +14,8 @@ BRK ;print-dec JSR2 ( mv-x mv-y year-x year-y -- ) POP2 ( mv-x mv-y -- ) ;moveme ;draw-str JSR2 + ( drawing static strings should always end with POP2 ) + #02 #2b ;addr ;draw-str JSR2 POP2 SWP #20 SUB SWP ( restore x coord between frames ) ;&adv KP-A JMPKEY ;&back KP-B JMPKEY @@ -27,6 +29,8 @@ BRK @moveme "MOVE 20 "ME! 00 +@addr "SR.HT/~LUXFERRE/ESOP 00 + ( include ESOP stdlib routines ) ~esop-lib-subs.tal