Jump to content
IGNORED

Using scratchpad workspace with XB


senior_falcon

Recommended Posts

Welll this is the Source for XB and RXB. I have added only a few to XB for RXB.

 

[0093]			 ***********************************************************
[0094]			 * Temporary workspaces in EDIT
[0095] 8300		 VAR0 EQU >8300		 TEMPORARY
[0096] 8301		 VARV EQU >8301		 TEMPORARY
[0097] 8302		 ACCUM EQU >8302		 # OF BYTES ACCUMULATOR (4 BYTE
[0098] 8302		 STPT EQU >8302		 TWO BYTES
[0099] 8304		 VARY EQU >8304
[0100] 8306		 VARY2 EQU >8306
[0101] 8304		 PABPTR EQU >8304
[0102] 8306		 DFLTLM EQU >8306		 Default array limit (10)
[0103] 8306		 CCPPTR EQU >8306		 OFFSET WITHIN RECORED (1)
[0104] 8307		 RECLEN EQU >8307		 LENGTH OF CURRENT RECORD (1)
[0105] 8308		 CCPADR EQU >8308		 RAM address of current refs
[0106] 8308		 VARC EQU >8308
[0107] 8308		 CCPADD EQU >8308		 RAM address of current color
[0108] 830A		 CALIST EQU >830A		 Call list for resolving refs
[0109] 830A		 RAMPTR EQU >830A		 Pointer for crunching
[0110] 830C		 BYTES EQU >830C		 BYTE COUNTER
[0111] 830C		 NMPTR EQU >830C		 Pointer save for pscan
[0112] 830E		 CHSAV EQU >830E
[0113] 830E		 CURINC EQU >830E		 Increment for auto-num mode
[0114] 8310		 TOPSTK EQU >8310		 Top of data stack pointer
[0115] 8312		 LINUM EQU >8312		 Used to determine end of scan
[0116] 8314		 NMLEN EQU >8314		 Current line for auto-num
[0117] 8314		 CURLIN EQU >8314		 Current line for auto-num
[0118] 8316		 VAR9 EQU >8316
[0119] 8316		 XFLAG EQU >8316		 SCAN FLAG-BITS USED AS BELOW
[0120] 8317		 DSRFLG EQU >8317		 INTERNAL =60, EXTERNAL =0 (1)
[0121] 8317		 FORNET EQU >8317		 Nesting level of for/next
[0122] 8302		 AAA1 EQU >8302
[0123] 830C		 BBB1 EQU >830C
[0124] 8308		 CCC1 EQU >8308
[0125]			 ***********************************************************
[0126]			 * Permanent workspace variables
[0127] 8318		 STRSP EQU >8318		 String space begining
[0128] 831A		 STREND EQU >831A		 String space ending
[0129] 831C		 SREF EQU >831C		 Temporary string pointer

99/4 GPL-ASSEMBLER (Pass 3) correct								 PAGE 0003
EQUATES EDIT-359
[0130] 831E		 SMTSRT EQU >831E		 Start of current statement
[0131] 8320		 VARW EQU >8320		 Screen address
[0132] 8322		 ERRCOD EQU >8322		 Return error code from ALC
[0133] 8324		 STVSPT EQU >8324		 Value-stack base
[0134] 832A		 VARA EQU >832A		 Ending display location
[0135] 832C		 PGMPTR EQU >832C		 Program text pointer
[0136] 832E		 EXTRAM EQU >832E		 Line number table pointer
[0137] 8330		 STLN EQU >8330		 Start of line number table
[0138] 8332		 ENLN EQU >8332		 End of line number table
[0139] 8334		 DATA EQU >8334		 Data pointer for READ
[0140] 8336		 LNBUF EQU >8336		 Line table pointer for READ
[0141] 8338		 INTRIN EQU >8338		 Add of intrinsic poly constant
[0142] 833A		 SUBTAB EQU >833A		 Subprogram symbol table
[0143] 833C		 IOSTRT EQU >833C		 PAB list/Start of I/O chain
[0144] 833E		 SYMTAB EQU >833E		 Symbol table pointer
[0145] 8340		 FREPTR EQU >8340		 Free space pointer
[0146] 8342		 CHAT EQU >8342		 Current charater/token
[0147] 8343		 BASE EQU >8343		 OPTION BASE value
[0148] 8344		 PRGFLG EQU >8344		 Program/imperative flag
[0149] 8345		 FLAG EQU >8345		 General 8-bit flag
[0150] 8346		 BUFLEV EQU >8346		 Crunch-buffer destruction leve
[0151] 8348		 LSUBP EQU >8348		 Last subprogram block on stack
[0152]			 * FAC EQU >834A		 Floating-point ACcurmulator
[0153] 834B		 FAC1 EQU FAC+1
[0154] 834C		 FAC2 EQU FAC+2
[0155] 834D		 FAC3 EQU FAC+3
[0156] 834E		 FAC4 EQU FAC+4
[0157] 834F		 FAC5 EQU FAC+5
[0158] 8350		 FAC6 EQU FAC+6
[0159] 8351		 FAC7 EQU FAC+7
[0160] 8352		 FAC8 EQU FAC+8
[0161] 8353		 FAC9 EQU FAC+9
[0162] 8354		 FAC10 EQU FAC+10
[0163] 8355		 FAC11 EQU FAC+11
[0164] 8356		 FAC12 EQU FAC+12
[0165] 8357		 FAC13 EQU FAC+13
[0166] 8358		 FAC14 EQU FAC+14
[0167] 8359		 FAC15 EQU FAC+15
[0168] 835A		 FAC16 EQU FAC+16
[0169] 835B		 FAC17 EQU FAC+17
[0170] 834C		 AAA EQU FAC+2
[0171] 834E		 CCC EQU FAC+4
[0172] 8350		 BBB EQU FAC+6
[0173] 834C		 DDD EQU FAC+2
[0174] 834E		 FFF EQU FAC+4
[0175] 8350		 EEE EQU FAC+6
[0176] 8354		 DDD1 EQU FAC+10
[0177] 8356		 FFF1 EQU FAC+12
[0178] 8358		 EEE1 EQU FAC+14
[0179]			 * ARG EQU >835C			 Floating-point ARGument
[0180] 835D		 ARG1 EQU ARG+1
[0181] 835E		 ARG2 EQU ARG+2
[0182] 835F		 ARG3 EQU ARG+3
[0183] 8360		 ARG4 EQU ARG+4
[0184] 8361		 ARG5 EQU ARG+5
[0185] 8362		 ARG6 EQU ARG+6
[0186] 8363		 ARG7 EQU ARG+7
[0187] 8364		 ARG8 EQU ARG+8
[0188] 8364		 XSTLN EQU >8364		 GKXB variable
[0189] 8366		 XENLN EQU >8366		 GKXB variable
[0190] 8367		 ARG11 EQU ARG+11
[0191] 8368		 XCURLI EQU >8368		 GKXB variable
[0192] 836A		 XCURIN EQU >836A		 GKXB variable
[0193] 836B		 ARG15 EQU ARG+15

99/4 GPL-ASSEMBLER (Pass 3) correct								 PAGE 0004
EQUATES EDIT-359
[0194] 836C		 ARG16 EQU ARG+16
[0195]			 * VSPTR EQU >836E		 Value stack pointer
[0196] 8376		 EXPZ EQU >8376		 Exponent in floating-point
[0197] 8384		 RAMTOP EQU >8384		 Highest address in ERAM
[0198] 8386		 RAMFRE EQU >8386		 Free pointer in the ERAM
[0199] 8388		 RSTK EQU >8388		 Subroutine stack base
[0200] 8389		 RAMFLG EQU >8389		 ERAM flag
[0201] 83AF		 STKMIN EQU >83AF		 Base of data stack
[0202] 83BD		 STKMAX EQU >83BD		 Top of data stack
[0203] 83CE		 PRTNFN EQU >83CE
[0204]			 ***********************************************************

 

Rich

 

P.S. the bad news is that is only GROM 3, I did not include listing for GROM 4, 5, 6

Edited by RXB
Link to comment
Share on other sites

I would like to use a workspace (or workspaces) in scratchpat ram with assembly subroutines called from XB. What are the safe memory addresses for this, if any?

 

Thanks in advance.

Most of the XB related assembly I have written uses a workspace in low 8k memory where the assembly routines are LOADed and reside, by defining it using a BSS directive, ie, "WS BSS >20". You'll be hard-pressed to find 32 contiguous bytes though with some creativity, you could probably find 10-12 which would let you use R10,R11 with R13/R14/R15 for the call into your routines. You can also save and restore scratchpad if you have a routine that truly benefits from its usage:

call routine from XB
start by using a workspace in low 8k memory
copy 32 bytes of scratchpad to low memory 'holding area' you define (ie, BSS 32)
change your workspace to the 32 bytes you saved
execute code
change workspace to low memory
restore scratchpad from saved memory
return to XB  (clear GPL status bit/byte if needed)

 

Sometimes you can use the GPL workspace 0x83E0 for simple code but you should not try to call any DSR routines (DSRLNK switches context to GPL workspace) nor should you allow interrupts to fire. Register usage may vary depending on your calling program and your routines.

 

A good reference for CPU and VDP memory maps is the Millers Graphics Smart Programmer's newsletter. Many can be found on WHT's ftp server.

 

I would direct you to the August 1986 newsletter which contains a map of the scratchpad RAM for XB. Some related issues:

  • 84/03 shows XB low/high mem map
  • 84/04 shows overall vdp maps comparing basic/xb
  • 84/05 shows detail XB vdp memory map, including the disk buffer space

I have paper copies of about 10 as they are quite the resource. I do not know how many issues were released.

 

tim

Link to comment
Share on other sites

Thanks, that's what I always thought. I have always used a workspace in the memory expansion, but was just wondering whether there was a way to do it in scratchpad memory. I can always select 32K on the 16 bit bus on my TI, but not everyone has that option. I have MG explorer - the manual contains good memory maps of VDP, scratchpad, and the 32 K expansion.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...