Browse Source

pcat: begin structuring around words

pull/119/head
Virgil Dupras 4 years ago
parent
commit
a72322df31
8 changed files with 30 additions and 9 deletions
  1. +1
    -1
      blk/750
  2. +1
    -0
      blk/753
  3. +4
    -3
      blk/755
  4. +4
    -0
      blk/756
  5. +1
    -1
      blk/812
  6. +13
    -2
      blk/813
  7. +2
    -0
      blk/814
  8. +4
    -2
      recipes/pcat/xcomp.fs

+ 1
- 1
blk/750 View File

@@ -1 +1 @@
1 5 LOADR+
1 6 LOADR+

+ 1
- 0
blk/753 View File

@@ -3,6 +3,7 @@
0xf4 OP1 HLT, 0xfc OP1 CLD, 0xfd OP1 STD,
( no argument, jumps with relative addrs are special )
0xeb OP1 JMPs, 0xe9 OP1 JMPn, 0x74 OP1 JZ,
0xe8 OP1 CALLn,
: MOVri, SWAP 0xb0 OR A, A, ;
: MOVxi, SWAP 0xb8 OR A, SPLITB A, A, ;
: MOVsx, 0x8e A, SWAP 3 LSHIFT OR 0xc0 OR A, ;


+ 4
- 3
blk/755 View File

@@ -4,6 +4,7 @@
: BREAK?, DUP 0x8000 AND IF
0x7fff AND 1 ALLOT THEN, -1 ALLOT
THEN ; )
: AGAIN, ( BREAK?, ) PC - 1- A, ;
: BWR @ AGAIN, ;

: RPCs, PC - 1- A, ; : RPCn, PC - 2- A,, ;
: AGAIN, ( BREAK?, ) RPCs, ;
( Use RPCx with appropriate JMP/CALL op. Example:
JMPs, 0x42 RPCs, or CALLn, 0x1234 RPCn, )

+ 4
- 0
blk/756 View File

@@ -0,0 +1,4 @@
: CODE ( same as CREATE, but with native word )
(entry)
23 C, ( 23 == nativeWord ) ;
: ;CODE ;

+ 1
- 1
blk/812 View File

@@ -6,7 +6,7 @@ JMPn, 0 A,, ( 00, main ) JMPn, 0 A,, ( 03, find )
JMPn, 0 A,, ( 0e compiledWord ) JMPn, 0 A,, ( 11, pushRS )
JMPn, 0 A,, ( 14, popRS )
JMPn, 0 A,, ( 17, nativeWord )
JMPn, 0 A,, ( 1a, next ) JMPn, 0 A,, ( 1d, chkPS )
JMPn, 0 A,, ( 1a, next ) JMPn, 0 A,, ( 1d, unused )
0 A, 0 A, ( 20, numberWord ) 0 A, 0 A, ( 22, litWord )
0 A, 0 A, ( 24, addrWord ) 0 A, 0 A, ( 26, unused )
0 A, 0 A,, ( unused )


+ 13
- 2
blk/813 View File

@@ -1,3 +1,14 @@
PC 3 - ORG @ 1+ ! ( main )
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
( BOOT DICT: There are only 3 words in the boot dict, but
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,
H@ XCURRENT ! ( set current tip of dict, 0x42 )
0x17 A, ( nativeWord )
HLT,
CODE FOO
L1 BSET
AH 0x0e MOVri, ( print char ) AL 'X' MOVri, 0x10 INT,
L2 BSET JMPs, L2 @ RPCs,
;CODE

+ 2
- 0
blk/814 View File

@@ -0,0 +1,2 @@
PC 3 - ORG @ 1+ ! ( main )
JMPs, L1 @ RPCs,

+ 4
- 2
recipes/pcat/xcomp.fs View File

@@ -1,4 +1,6 @@
750 LOAD
812 813 LOADR
750 LOAD ( 8086 asm )
262 LOAD ( xcomp )
270 LOAD ( xcomp overrides )
812 814 LOADR
ORG @ 256 /MOD 2 PC! 2 PC!
H@ 256 /MOD 2 PC! 2 PC!

Loading…
Cancel
Save