(uxncore) starting opcodes

This commit is contained in:
Devine Lu Linvega 2024-06-29 16:55:04 -08:00
parent 19d07ee38f
commit 3d14583f74
1 changed files with 92 additions and 5 deletions

View File

@ -28,9 +28,10 @@
[ LIT2 "/ 18 ] DEO [ LIT2 "/ 18 ] DEO
#2018 DEO #2018 DEO
( | body ) ( | body )
;dict/break <pstr> #00 OVR #1f AND DUP ADD ;opc-lut ADD2 LDA2 JSR2
( ) ;dict/break <pstr>
#0a18 DEO #0a18 DEO
POP JMP2r JMP2r
@<name> ( byte -- ) @<name> ( byte -- )
( | special ) ( | special )
@ -75,6 +76,90 @@
[ LIT2 "x 18 ] DEO [ LIT2 "x 18 ] DEO
!<phex>/b !<phex>/b
(
@|body )
@opc-lut [
=op-brk =op-inc =op-pop =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk
=op-brk =op-brk =op-brk =op-brk ]
@op-brk ( byte -- )
;dict/return <pstr>
#2018 DEO
POP JMP2r
@op-inc ( byte -- )
<dat>
[ LIT2 "[ 18 ] DEO
<ptr>
#01 <minus>
[ LIT2 "] 18 ] DEO
<inc>
[ LIT2 "; 18 ] DEO
#2018 DEO
POP JMP2r
@op-pop ( byte -- )
<ptr>
<dec>
[ LIT2 "; 18 ] DEO
#2018 DEO
POP JMP2r
@<inc> ( -- )
[ LIT2 "+ 18 ] DEOk DEO
JMP2r
@<dec> ( -- )
[ LIT2 "- 18 ] DEOk DEO
JMP2r
@<t> ( -- )
[ LIT2 "t 18 ] DEO
<equ>
<ptr>
#01 <minus>
[ LIT2 "; 18 ] DEO
#2018 DEO
JMP2r
@<equ> ( -- )
#2018 DEO
[ LIT2 "= 18 ] DEO
#2018 DEO
JMP2r
@<minus> ( numchar -- )
#2018 DEO
[ LIT2 "- 18 ] DEO
#2018 DEO
[ LIT "0 ] ADD #18 DEO
JMP2r
@<plus> ( numchar -- )
#2018 DEO
[ LIT2 "+ 18 ] DEO
#2018 DEO
[ LIT "0 ] ADD #18 DEO
JMP2r
@<dat> ( -- )
;dict/uxn-wst-dat <pstr>
JMP2r
@<ptr> ( -- )
;dict/uxn-wst-ptr <pstr>
JMP2r
(
@|utils )
@<phex> ( short* -: ) @<phex> ( short* -: )
SWP /b SWP /b
&b ( byte -: ) &b ( byte -: )
@ -83,9 +168,6 @@
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
JMP2r JMP2r
(
@|utils )
@<pstr> ( str* -- ) @<pstr> ( str* -- )
LDAk #18 DEO LDAk #18 DEO
INC2 LDAk ?<pstr> INC2 LDAk ?<pstr>
@ -116,4 +198,9 @@
&end 09 "} 0a "} 0a $1 &end 09 "} 0a "} 0a $1
&case 09 "case 20 $1 &case 09 "case 20 $1
&break "break; $1 &break "break; $1
&return "return 20 "1; $1
&uxn-wst-dat "uxn.wst.dat $1
&uxn-wst-ptr "uxn.wst.ptr $1
&uxn-rst-dat "uxn.rst.dat $1
&uxn-rst-ptr "uxn.rst.ptr $1