Moving The Big Mac Symbol Table

By Thomas G. Williams
Call -A.P.P.LE. July 1982 PP79

THE Symbol Symon symbolic debugger is a major improvement over the capability included in the Apple ][ monitor. Unfortunately, it does not know about the Big Mac.LC assembler and thus can not save or use the symbol table produced by Big Mac.LC. Symbol Symon can be used without a symbol table, but you lose the capability to refer to locations by name instead of address. Fortunately, the Big Mac.LC symbol table is in the same format as the Big Mac.STD symbol table, which Symbol Symon can use. If the Big Mac.STD symbol table is moved to where Big Mac.STD would have put it, and if certain memory locations are set to values that Big Mac.STD would have set, Symbol Symon can find and use the symbol table.

When the Symbol Symon “Save Symbol Table” option is selected, Symbol Symon checks locations $8BC-$8C0 for the sequence $02,$09, $07,$20,$0D (“BIG M” in inverse video). If it finds this sequence, it assumes that Big Mac.STD was used and takes the two byte datum stored at $80D,$80E as the address of the last byte of the assembler source file. Big Mac.STD starts the symbol table immediately after the source file.

Big Mac.LC puts the symbol table on the language card in bank one of $DOOO-$DFFF. This program is for use with assembly language programs where all of the symbol table will fit into this space. It moves the data from bank one of $DOOO-$DFFF to $7000-$7FFF. It then puts the proper values on $8BC-$8CO and sets $80D-$80E to $6FFF. Thus the Symbol Symon “Save Symbol Table” option will think Big Mac.STD was used and save the data starting at $7000. This program always moves 4096 bytes; it makes no attempt to identify the end of the symbol table. This works fine because Symbol Symon can identify the end of the table and will not save extraneous data.

To use the program, BRUN it after the assembly is complete but before Symbol Symon is started. As given here, it runs in page 3 of memory. Neither Big Mac.LC nor Symbol Symon uses page 3, so if the program you are debugging does not use page 3, this program will not be disturbed, and can be executed by a CALL 768 after exit from Big Mac.LC.

Source:

Name : MOVE MAC.LC SYMBOL
Length : $0044 (68)
Load at : $0300 (768)

                    ********************************
                    *                              *
                    * Move Big Mac.LC Symbol Table *
                    *      By  Tom Williams        *
                    *                              *
                    * Call-A.P.P.L.E. :  July 1982 *
                    *                              *
                    * Move Big Mac.LC Symbol Table *
                    * to where it would be if      *
                    * assembled by Big Mac.STD so  *
                    * Symbol Symon can find it.    *
                    *                              *
                    * Move Bank 1 $D000-DFFF to    *
                    * $7000-$7FFF. Put $6FFF (end  *
                    * of source) in $80D-80E.  Put *
                    * proper values in $8BC-$8C1   *
                    *                              *                                                                                                
                    ********************************
                    *
                    * Equates
                    *
                    A1L     EQU $3C
                    A1H     EQU $3D
                    A4L     EQU $42
                    A4H     EQU $43
                    ENDSRC  EQU $80D       ;End of source
                    CHKLOC  EQU $8BC       ;Locations checked by Symbol Symon
                    *
                    *
                            ORG $300                       
                    *
                    *                       
0300: 2C 88 C0        START   BIT $C088       ;Read RAM bank 1; no write
0303: A9 00                    LDA #$00       ;set up source destination pointers
0305: 85 3C                    STA A1L          
0307: 85 42                    STA A4L          
0309: A9 D0                    LDA #$D0       ;Source
030B: 85 3D                    STA A1H          
030D: A9 70                    LDA #$70       ;Destination
030F: 85 43                    STA A4H          
0311: A0 00                    LDY #$00       ;Clear Y for Indirect Address
0313: B1 3C        LOOP        LDA (A1L),Y     ;Get Datum
0315: 91 42                    STA (A4L),Y     ;Store Datum
0317: E6 3C                    INC A1L         ;Increment Pointers
0319: E6 42                    INC A4L          
031B: D0 F6                    BNE LOOP
031D: E6 3D                    INC A1H          ;Must increment High Byte
031F: E6 43                    INC A4H          
0321: A5 3D                    LDA A1H          ;Check if Done
0323: C9 E0                    CMP #$E0
0325: D0 EC                    BNE LOOP
                    *
                    * Move Finished, Set end of source pointer
                    *
0327: A9 FF                    LDA #$FF
0329: 8D 0D 08                 STA ENDSRC        
032C: A9 6F                    LDA #$6F
032E: 8D 0E 08                 STA ENDSRC+1
                    *
                    * Set up locations check by Symbol Symon
                    *    
0331: A2 04                    LDX #$04
0333: BD 40 03         LOOP1   LDA CHKDATA,X
0336: 9D BC 08                 STA CHKLOC,X
0339: CA                       DEX 
033A: 10 F7                    BPL LOOP1
                    *
                    * Reset to ROM read
                    *
033C: 2C 81 C0                 BIT $C081        ; ROMIN - Read ROM; write RAM bank 2
033F: 60                       RTS 
                    *
                    * Data checked by Symbol Symon
                    *
0340: 02 09 07          
0343: 0D               CHKDATA HEX     02,09,07,0D
Author: A.P.P.L.E.
The A.P.P.L.E. Website is run by the Apple Pugetsound Program Library Exchange Users Group and is open to all Apple and Macintosh fans and their friends.