diff --git a/blk/076 b/blk/076 index 60e7f8b..a662b31 100644 --- a/blk/076 +++ b/blk/076 @@ -1,6 +1,6 @@ STACK OVERFLOW PROTECTION: To avoid having to check for stack underflow after each pop operation (which can end up being -prohibitive in terms of costs), we give ourselves a nice 6 -bytes buffer. 6 bytes because we seldom have words requiring -more than 3 items from the stack. Then, at each "exit" call we -check for stack underflow. +prohibitive in terms of costs), PS_ADDR should be set to +at least 6 bytes before its actual limit. 6 bytes because we +seldom have words requiring more than 3 items from the stack. +Then, at each "exit" call we check for stack underflow. diff --git a/blk/081 b/blk/081 index c4aa45a..02086c2 100644 --- a/blk/081 +++ b/blk/081 @@ -1,5 +1,4 @@ -(cont.) -RAMSTART INITIAL_SP +55 (key) override +RAMSTART FUTURE USES +55 (key) override +02 CURRENT +57 readln's variables +04 HERE +59 blk's variables +06 C= SP? good ) + CNC RETcc, ( PS_ADDR >= SP? good ) JR, L2 BWR ( abortUnderflow-B298 ) diff --git a/blk/310 b/blk/310 index b1eef80..19cc92b 100644 --- a/blk/310 +++ b/blk/310 @@ -9,7 +9,7 @@ CODE PICK B (HL) LDrr, ( check PS range before returning ) EXDEHL, - RAMSTART LDHL(nn), ( RAM+00 == INITIAL_SP ) + HL PS_ADDR LDddnn, DE SUBHLss, CC L2 @ JPccnn, ( abortUnderflow-B298 ) BC PUSHqq, diff --git a/blk/313 b/blk/313 index 2e72338..ed592ac 100644 --- a/blk/313 +++ b/blk/313 @@ -1,5 +1,5 @@ CODE S0 - RAMSTART LDHL(nn), ( RAM+00 == INITIAL_SP ) + HL PS_ADDR LDddnn, HL PUSHqq, ;CODE diff --git a/blk/327 b/blk/327 index 94c2e81..038c5cd 100644 --- a/blk/327 +++ b/blk/327 @@ -3,8 +3,7 @@ CODE BYE ;CODE CODE (resSP) - ( INITIAL_SP == RAM+0 ) - SP RAMSTART LDdd(nn), + SP PS_ADDR LDddnn, ;CODE CODE (resRS) diff --git a/emul/forth.bin b/emul/forth.bin index f9614a4..99c6482 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ diff --git a/emul/xcomp.fs b/emul/xcomp.fs index e7b63f4..07c4963 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -1,5 +1,6 @@ 0xe800 CONSTANT RAMSTART 0xf000 CONSTANT RS_ADDR +0xfffa CONSTANT PS_ADDR 212 LOAD ( z80 assembler ) 262 LOAD ( xcomp ) : CODE XCODE ; diff --git a/recipes/rc2014/xcomp.fs b/recipes/rc2014/xcomp.fs index 6f08080..903cade 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -1,5 +1,6 @@ 0x8000 CONSTANT RAMSTART 0xf000 CONSTANT RS_ADDR +0xfffa CONSTANT PS_ADDR 0x80 CONSTANT ACIA_CTL 0x81 CONSTANT ACIA_IO 4 CONSTANT SDC_SPI diff --git a/recipes/ti84/xcomp.fs b/recipes/ti84/xcomp.fs index 0b0dd8c..5d142e3 100644 --- a/recipes/ti84/xcomp.fs +++ b/recipes/ti84/xcomp.fs @@ -1,5 +1,6 @@ 0x8000 CONSTANT RAMSTART 0xb000 CONSTANT RS_ADDR +0xbffa CONSTANT PS_ADDR RAMSTART 0x70 + CONSTANT LCD_MEM RAMSTART 0x72 + CONSTANT KBD_MEM 0x01 CONSTANT KBD_PORT diff --git a/recipes/trs80/xcomp.fs b/recipes/trs80/xcomp.fs index 2db7e2b..0f3ebb5 100644 --- a/recipes/trs80/xcomp.fs +++ b/recipes/trs80/xcomp.fs @@ -1,4 +1,5 @@ 0xf000 CONSTANT RS_ADDR +0xfffa CONSTANT PS_ADDR RS_ADDR 0x80 - CONSTANT RAMSTART 212 LOAD ( z80 assembler ) 262 LOAD ( xcomp )