From da371451cc28661a71b4c1cf4a7ca6f17aa7bffa Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 11 May 2020 21:08:24 -0400 Subject: [PATCH] Replace INITIAL_SP with PS_ADDR conf Now I struggle to remember why I ever did things they way I did. There must have been a reason... --- blk/076 | 8 ++++---- blk/081 | 4 ++-- blk/082 | 6 +++--- blk/280 | 20 ++++++++++---------- blk/281 | 15 ++++++++++----- blk/289 | 3 +-- blk/299 | 10 +++------- blk/310 | 2 +- blk/313 | 2 +- blk/327 | 3 +-- emul/forth.bin | Bin 5987 -> 5978 bytes emul/xcomp.fs | 1 + recipes/rc2014/xcomp.fs | 1 + recipes/ti84/xcomp.fs | 1 + recipes/trs80/xcomp.fs | 1 + 15 files changed, 40 insertions(+), 37 deletions(-) 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 f9614a414bca0d1c2bb6ec6e21955328e3f6c6af..99c64820cad48f9dc684e5f955ae9874d783c10f 100644 GIT binary patch literal 5978 zcmai2du&_Rc|Z3-nG_|yL|Jy|AeWLBk*4fQ9@<2;B#WddhYKGHN!f8US+#6S@nVaC zq|}ZQNXc5etp@~yRv;))1ViXy7_vdAy)0YM46x+{&5R7S5&dI8U4&GLQ&Ud-=1F`fkLWn1t#L}>~^r*Jz|0Fc5NxBofc=s zX`C-*ZY_;!>bqZkCmv50gfN@l^NY1Rt4sHZ(AZSi1;m}h;?4o>&UT{q0p}IArq%cE z7tg;Q`uUxfJ1xLhNB}GoT3cOP+@CG~NXdz1vjx$4dt)UiJ`KKbtJ%D@(=M9zTkFB^ zi}wt%^rzzOHJGqi{?W7L{+`h8Y-DXYaNkGs|7JM@foLFd-@jYB=ZovBp{;9yKwx?O zaLa+!*-Ig#oLgVD-e2rqz5MP<3;v!FD>K@=E0bbnTw95(MBWWOGk)@PSOn{}^00nO zsagyEX5)?W)ap;S-GU1%YpY)I=^N$T!#6iwSUS24>HHJFS)>LCg=*Z$<1zbn%+upYb(`*Sz_8dZd*iYHHogQBKs zwLjg}QW%Lu%Kr-d9_sQlPvn(|p~3olq|=^!hg;}PkVl{`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jff}Fry48(OZ9oXL z-8Hxy@i&F$!N zau6|Le95G^a~?KxES1>9cY$ImXYhh?0zM?-nJjO(Tky)Gnrjl*=$2YGWv5Jp)ulpH9ee`a{vvJ;21R>O=XjcGTup0r$Qb_;K> zYmkLK{tsTw z6@^3#a_{GjC*xW2auwrs{?|24lHd3sDyK<)wQ(1||HIcP2PdANkS|@062(udhfYl# Qvr`#;?_i-m*e=HZ0A5&X2LJ#7 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 )