瀏覽代碼

Extract EXIT code from stable ABI zone

master
Virgil Dupras 3 年之前
父節點
當前提交
5705cd5c31
共有 12 個檔案被更改,包括 41 行新增47 行删除
  1. +2
    -2
      blk/283
  2. +1
    -7
      blk/284
  3. +12
    -0
      blk/304
  4. +11
    -12
      blk/305
  5. +0
    -5
      blk/306
  6. +1
    -2
      blk/400
  7. +4
    -4
      blk/805
  8. +2
    -8
      blk/806
  9. +4
    -1
      blk/812
  10. 二進制
      cvm/forth.bin
  11. +0
    -1
      cvm/vm.c
  12. +4
    -5
      cvm/xcomp.fs

+ 2
- 2
blk/283 查看文件

@@ -1,7 +1,7 @@
H@ ORG !
0 JP, ( 00, main ) NOP, ( unused ) NOP, NOP, ( 04, BOOT )
NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST )
NOP, NOP, NOP, NOP, NOP, NOP, ( unused )
NOP, NOP, ( 06, uflw ) NOP, NOP, ( 08, LATEST ) NOP, ( unused )
0 A, 0 JP, ( 0b, EXIT ) NOP, ( unused )
0 JP, ( RST 10 ) NOP, ( unused ) 0 JP, ( 14, popRS )
NOP, NOP, NOP, ( unused )
0 JP, ( 1a, next ) NOP, NOP, NOP, ( unused )


+ 1
- 7
blk/284 查看文件

@@ -1,11 +1,5 @@
( 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" )
ORG @ 0x4c + HERE !
H@ 4 + XCURRENT ! ( make next CODE have 0 prev field )
CODE EXIT ( 0x42 )
0x14 BCALL, ( popRS )
HL PUSH, IY POP, ( --> IP )
JPNEXT,
CODE (br) ( 0x53 )
L2 BSET ( used in CBR )
E 0 IY+ LDrIXY, D 1 IY+ LDrIXY,


+ 12
- 0
blk/304 查看文件

@@ -0,0 +1,12 @@
lblchkPS BSET ( chkPS )
( Note that you only need to call this in words that push
back to PSP. If they don't, calling chkPS is redundant with
check in next )
EXX,
( We have the return address for this very call on the stack
and protected registers. 2- is to compensate that. )
HL PS_ADDR 2- LDdn,
SP SUBHLd,
EXX,
CNC RETc, ( PS_ADDR >= SP? good )
JR, lblofl BWR ( abortUnderflow-B298 )

+ 11
- 12
blk/305 查看文件

@@ -1,12 +1,11 @@
lblchkPS BSET ( chkPS )
( Note that you only need to call this in words that push
back to PSP. If they don't, calling chkPS is redundant with
check in next )
EXX,
( We have the return address for this very call on the stack
and protected registers. 2- is to compensate that. )
HL PS_ADDR 2- LDdn,
SP SUBHLd,
EXX,
CNC RETc, ( PS_ADDR >= SP? good )
JR, lblofl BWR ( abortUnderflow-B298 )
( Native words )
CODE EXECUTE
DE POP,
chkPS,
JR, lblexec BWR ( execute-B301 )

CODE EXIT
PC ORG @ 0x0d + ! ( stable ABI JP )
0x14 BCALL, ( popRS )
HL PUSH, IY POP, ( --> IP )
JPNEXT,

+ 0
- 5
blk/306 查看文件

@@ -1,8 +1,3 @@
( Native words )
CODE EXECUTE
DE POP,
chkPS,
JR, lblexec BWR ( execute-B301 )
CODE (s) ( string literal )
PC ORG @ 0x2d + ! ( stable ABI JP )
( Like (n) but instead of being followed by a 2 bytes


+ 1
- 2
blk/400 查看文件

@@ -2,8 +2,7 @@
is not an IMMEDIATE yet and will not be treated properly by
xcomp. )
: _
0x42 ( EXIT ) ,
R> DROP ( exit : )
0x0b ( EXIT ) , R> DROP ( exit : )
; IMMEDIATE
';' X' _ 4 - C! ( give ; its name )
':' X' _ 4 - C! ( give : its name )


+ 4
- 4
blk/805 查看文件

@@ -2,10 +2,10 @@ VARIABLE lblexec VARIABLE lblnext
H@ ORG !
JMPn, 0 A,, ( 00, main ) 0 A, ( 03, boot driveno )
0 A,, ( 04, BOOT )
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST )
0 A, 0 A, 0 A,, ( unused )
0 A, 0 A,, ( unused ) JMPn, 0 A,, ( 11, pushRS )
JMPn, 0 A,, ( 14, popRS ) 0 A, 0 A,, ( unused )
0 A,, ( 06, uflw ) 0 A,, ( 08, LATEST ) 0 A, ( unused )
0 A, JMPn, 0 A,, ( unused )
0 A,, ( unused ) JMPn, 0 A,, ( unused )
JMPn, 0 A,, ( unused ) 0 A, 0 A,, ( unused )
JMPn, 0 A,, ( 1a, next ) 0 A, 0 A,, ( unused )
0 A, 0 A, 0 A, 0 A, ( unused )
0 A, 0 A, 0 A, 0 A, ( unused )


+ 2
- 8
blk/806 查看文件

@@ -1,11 +1,5 @@
( 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, ( len )
H@ XCURRENT ! ( set current tip of dict, 0x42 )
0 A, ( native )
DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS )
;CODE NOP,
ORG @ 0x4c + HERE !
H@ 4 + XCURRENT ! ( make next CODE have 0 prev field )
CODE (br) ( 0x53 ) L2 BSET ( used in br? )
DI DX MOVxx, DI [DI] MOVx[], DX DI ADDxx,
;CODE NOP, NOP,


+ 4
- 1
blk/812 查看文件

@@ -1,7 +1,10 @@
( native words )
CODE EXECUTE 1 chkPS,
DI POPx, JMPn, lblexec @ RPCn,

CODE EXIT
PC 0x0f - ORG @ 0x0d + ! ( stable abi )
DX [BP] 0 MOVx[]+, BP DECx, BP DECx, ( popRS )
;CODE
CODE (s) ( string literal, see B287 )
PC 0x2f - ORG @ 0x2d + ! ( stable abi )
DI DX MOVxx, ( IP )


二進制
cvm/forth.bin 查看文件


+ 0
- 1
cvm/vm.c 查看文件

@@ -287,7 +287,6 @@ VM* VM_init() {
native(SP_to_R_2);
native(nlit);
native(slit);
// End of stable ABI
native(SP_to_R);
native(R_to_SP);
native(R_to_SP_2);


+ 4
- 5
cvm/xcomp.fs 查看文件

@@ -10,15 +10,13 @@ CREATE BIN( 0 ,
270 LOAD ( xcomp overrides )

H@ ORG !
ORG @ 0x0b + HERE !
0 C, 0 C, ( EXIT )
ORG @ 0x2b + HERE !
0 C, 0x06 C, ( (s) )
ORG @ 0x33 + HERE !
0 C, 0x04 C, ( 2>R )
ORG @ 0x3b + HERE !
," EXIT"
0 , ( prev ) 4 C,
H@ XCURRENT ! ( set current tip of dict, 0x42 )
0 C, 0 C,
H@ 4 + XCURRENT ! ( make next CODE have 0 prev field )
ORG @ 0x4c + HERE !
0x01 CODE (br) ( 0x53 )
ORG @ 0x5f + HERE !
@@ -28,6 +26,7 @@ ORG @ 0x77 + HERE !
ORG @ 0xb9 + HERE !
0x05 CODE (n) ( 0xbf )
( END OF STABLE ABI )
0x00 CODE EXIT
0x06 CODE (s)
0x04 CODE 2>R
0x07 CODE >R


Loading…
取消
儲存