mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 03:28:05 +11:00
pcat: implement number literals
This commit is contained in:
parent
a92864a595
commit
49979404a5
11
blk/813
11
blk/813
@ -2,14 +2,13 @@
|
||||
these words' offset need to be stable, so they're part of
|
||||
the "stable ABI" )
|
||||
'E' A, 'X' A, 'I' A, 'T' A,
|
||||
0 A,, ( prev )
|
||||
4 A,
|
||||
0 A,, ( prev ) 4 A, ( len )
|
||||
H@ XCURRENT ! ( set current tip of dict, 0x42 )
|
||||
0x17 A, ( nativeWord )
|
||||
DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS )
|
||||
;CODE
|
||||
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
|
||||
CODE FOO
|
||||
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
|
||||
PC ORG @ 0x20 + ! ( numberWord )
|
||||
PC ORG @ 0x24 + ! ( addrWord ) ( see B287 for comments )
|
||||
DI DX MOVxx, DI [DI] MOVx[], DI PUSHx,
|
||||
DX INCx, DX INCx,
|
||||
;CODE
|
||||
: BAR FOO FOO ; : BAZ BAR FOO BYE ;
|
||||
|
2
blk/815
2
blk/815
@ -1,6 +1,6 @@
|
||||
L4 BSET PC 3 - ORG @ 4 + ! ( find )
|
||||
( find word the same name as str in SI starting from tip in
|
||||
DI. Returns wordref in BX. Z if found, NZ if not. )
|
||||
DI. Returns wordref in DI. Z if found, NZ if not. )
|
||||
CH CH XORrr, CL [SI] MOVr[], ( CX -> strlen )
|
||||
SI INCx, ( first char ) AX AX XORxx, ( initial prev )
|
||||
BEGIN, ( loop )
|
||||
|
9
blk/817
9
blk/817
@ -1,10 +1,15 @@
|
||||
L3 BSET 3 A, 'B' A, 'A' A, 'Z' A,
|
||||
CODE BYE BEGIN, JMPs, AGAIN, ;CODE
|
||||
CODE EMIT
|
||||
AX POPx, AH 0x0e MOVri, ( print char ) 0x10 INT,
|
||||
;CODE
|
||||
: FOO 'X' EMIT ; : BAR FOO FOO BYE ;
|
||||
L3 BSET 3 A, 'B' A, 'A' A, 'R' A,
|
||||
PC 3 - ORG @ 1+ ! ( main )
|
||||
SP PS_ADDR MOVxI,
|
||||
BP RS_ADDR MOVxI,
|
||||
DI 0x08 MOVxm, ( LATEST )
|
||||
SI L3 @ MOVxI,
|
||||
CALLn, L4 @ RPCn, ( find )
|
||||
IFZ, JMPs, L1 @ RPCs, ( execute ) THEN,
|
||||
IFZ, JMPn, L1 @ RPCn, ( execute ) THEN,
|
||||
AH 0x0e MOVri, ( print char ) AL '!' MOVri, 0x10 INT,
|
||||
BEGIN, JMPs, AGAIN,
|
||||
|
Loading…
Reference in New Issue
Block a user