OSDN Git Service

adjust equates
[fig-forth-6809/fig-forth-6809.git] / fig6800to6809dumb.asm
index 48a3333..b05f5de 100644 (file)
 
 *
 NBLK   EQU     4       # of disc buffer blocks for virtual memory
-MEMEND EQU     132*NBLK+$3000 end of ram
+* MEMEND       EQU     132*NBLK+$3000 end of ram
+MEMEND EQU     132*NBLK+$5000+132 end of ram with some breathing room (32K Coco)
 *  each block is 132 bytes in size,
 *  holding 128 characters
 *
-MEMTOP EQU     $3FFF   absolute end of all ram
-ACIAC  EQU     $FBCE   the ACIA control address and
-ACIAD  EQU     ACIAC+1 data address for PROTO
+* MEMTOP       EQU     $3FFF   absolute end of all ram
+MEMTOP EQU     $7FFF   putative absolute end of all ram (32K Coco)
+* No ACIA in Coco (how sad).
+* ACIAC        EQU     $FBCE   the ACIA control address and
+* ACIAD        EQU     ACIAC+1 data address for PROTO
        PAGE
-*  MEMORY MAP for this 16K system:
+*  MEMORY MAP for this 16K system (32K Coco):
 *  ( positioned so that systems with 4k byte write-
 *   protected segments can write protect FORTH )
 *
+* Read below and calculate it yourself:
 * addr.                contents                pointer init by
 * **** ******************************* ******* ******
 * 3FFF                                         HI
@@ -101,8 +105,8 @@ ACIAD       EQU     ACIAC+1 data address for PROTO
 *                                      <== W
 *      the VIRTUAL FORTH MACHINE
 *
-* 1004 <<< WARM START ENTRY >>>
-* 1000 <<< COLD START ENTRY >>>
+* 1004 (3004) <<< WARM START ENTRY >>>
+* 1000 (3000) <<< COLD START ENTRY >>>
 *
 * >>>>>> memory from here down must be RAM <<<<<<
 *  FFE RETURN STACK base               <== RP  RINIT
@@ -142,14 +146,17 @@ ACIAD     EQU     ACIAC+1 data address for PROTO
 * RP points to second free byte (first free word) in return stack
 * SP (hardware SP) points to first free byte in data stack
 *
-*      when A ANDB hold one 16 bit FORTH data word,
+*      when A AND B hold one 16 bit FORTH data word,
 *      A contains the high byte, B, the low byte.
 ***
 
 
 
 
-       ORG     $E0     variables
+*      ORG     $E0     variables
+       ORG     $1300   variables
+PGBASE EQU     *
+       SETDP   PGBASE/$100
 
 
 N      RMB     10      used as scratch by (FIND),ENCLOSE,CMOVE,EMIT,KEY,
@@ -186,7 +193,8 @@ UP  RMB     2       the pointer to base of current user's 'USER' table
 *      COLD start and WARM start:
 *      [ names correspond to FORTH words of similar (no X) name ]
 *
-       ORG     $100
+*      ORG     $100
+       ORG     $1400
 UORIG  RMB     6       3 reserved variables
 XSPZER RMB     2       initial top of data stack for this user
 XRZERO RMB     2       initial top of return stack
@@ -254,9 +262,10 @@ TASK       FDB     DOCOL,SEMIS
 REND   EQU     *       ( first empty location in dictionary )
 
        PAGE
+* Check the addresses yourself:
 *    The FORTH program ( address $1000 to $27FF ) is written
 *    so that it can be in a ROM, or write-protected if desired
-       ORG     $1000
+       ORG     $3000
 
 * ######>> screen 3 <<
 *
@@ -274,13 +283,19 @@ ORIG      NOP
 *
 ******* startup parmeters **************************
 *
-       FDB     $6800,0000      cpu & revision
+RPTIB  EQU     $200            Give us more room to breath.
+SBUMPR EQU     $10             Bumper area for stacks.
+*
+       FDB     $6800,6809      cpu & revision
        FDB     0       topmost word in FORTH vocabulary
 BACKSP FDB     $7F     backspace character for editing
 UPINIT FDB     UORIG   initial user area
-SINIT  FDB     ORIG-$D0        initial top of data stack
-RINIT  FDB     ORIG-2  initial top of return stack
-       FDB     ORIG-$D0        terminal input buffer
+* SINIT        FDB     ORIG-$D0        initial top of data stack
+SINIT  FDB     ORIG-RPTIB-SBUMPR*2
+* RINIT        FDB     ORIG-2  initial top of return stack
+RINIT  FDB     ORIG-SBUMPR
+*      FDB     ORIG-$D0        terminal input buffer
+       FDB     ORIG-RPTIB-SBUMPR
        FDB     31      initial name field width
        FDB     0       initial warning mode (0 = no disc)
 FENCIN FDB     REND    initial fence
@@ -293,6 +308,7 @@ DELINT      FDB     4       initial carriage return delay
        PAGE
 *
 * ######>> screen 13 <<
+* Calculate the cycles yourself:
 PULABX PULS A          24 cycles until 'NEXT'
        PULS B
 STABX  STA     0,X     16 cycles until 'NEXT'
@@ -308,7 +324,7 @@ PUSHBA      PSHS B          8 cycles until 'NEXT'
 *
 * "NEXT" takes 38 cycles if TRACE is removed,
 *
-* and 95 cycles if NOT tracing.
+* and 95 cycles if NOT tracing. (Way bogus numbers by now.)
 *
 * = = = = = = =   t h e   v i r t u a l   m a c h i n e   = = = = =
 *                                                                 =
@@ -2401,7 +2417,9 @@ ABORT     FDB     DOCOL,SPSTOR,DEC,QSTACK,DRZERO,CR,PDOTQ
        FDB     ABORT-8
 COLD   FDB     *+2
 * CENT LDS     #REND-1 top of destination on 6800
-CENT   LDS     #REND   top of destination on 6809
+CENT   LDA #PGBASE/$100
+       TFR A,DP
+       LDS     #REND   top of destination on 6809
        LDX     #ERAM   top of stuff to move
 COLD2  LEAX -1,X
        LDA     0,X