Updated expansion port example

This commit is contained in:
Devine Lu Linvega 2024-03-18 10:46:07 -07:00
parent 086b1d9a47
commit 250aecc920
1 changed files with 50 additions and 20 deletions

View File

@ -1,26 +1,56 @@
( usage: uxncli system.expansion.rom )
|00 @System &catch $2 &expansion $2 &pad $2 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &halt $1
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|0100
|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1
|100
@on-reset ( -> )
;cmd .System/expansion DEO2
;dst <print-str>
;buf <pstr>
#2018 DEO
;buf <pstr>
#0a18 DEO
( | copy left )
;buf #0006 ADD2 ;mmu-cpyl/a STA2
;buf #0003 ADD2 ;mmu-cpyl/b STA2
;mmu-cpyl .System/expansion DEO2
;buf <pstr>
#2018 DEO
;res1 <pstr>
#0a18 DEO
( | copy right )
;buf #0003 ADD2 ;mmu-cpyr/a STA2
;buf #0009 ADD2 ;mmu-cpyr/b STA2
;mmu-cpyr .System/expansion DEO2
;buf <pstr>
#2018 DEO
;res2 <pstr>
#0a18 DEO
( | copy left )
;buf #0009 ADD2 ;mmu-cpyl/a STA2
;buf #0006 ADD2 ;mmu-cpyl/b STA2
;mmu-cpyl .System/expansion DEO2
;buf <pstr>
#2018 DEO
;res3 <pstr>
#0a18 DEO
( | memset )
;buf #0003 ADD2 ;mmu-fill/a STA2
;mmu-fill .System/expansion DEO2
;buf <pstr>
#2018 DEO
;res4 <pstr>
#0a18 DEO
BRK
@cmd
[ 01 000c 0000 =src 0000 =dst ]
@src
"Hello 20 "World $1
@dst $c
@<print-str> ( str* -- )
&w ( -- )
LDAk #18 DEO
INC2 LDAk ?&w
@<pstr> ( str* -- )
LDAk #18 DEO
INC2 LDAk ?<pstr>
POP2 JMP2r
@buf [ "......[hello]..... $1 ]
@res1 [ "...[hello]o]...... $1 ]
@res2 [ "...[hello[hello].. $1 ]
@res3 [ "...[he[hello]lo].. $1 ]
@res4 [ "...-------------.. $1 ]
@mmu-fill [ 00 000d 0000 &a $2 2d ]
@mmu-cpyl [ 01 0007 0000 &a $2 0000 &b $2 ]
@mmu-cpyr [ 02 0007 0000 &a $2 0000 &b $2 ]