HitchHiker's Guide To GeoProgrammer V2.0 ---------------------------------------- This document contains a collection of working documents concerning geoProgrammer V2.0. As there is no user's manual, these files will have to suffice for new users. Eric E. Del Sesto, December 1990. General: featuresV2 ROUND1 VERSIONS VERSTATS UPGRADE_TO_V2 TODO GeoAssembler: geoAssemTODO GeoLinker: geoLinkTODO GeoDebugger: geoDebugTODO geoDebugSpecsREADME InitForIOBug REUNotes REUbugs appTypes memProtect cbmApps hideMode interrupts nmi rbootWarn viewCommand environment wishList new: geoAssembler, geoLinker, and geoDebugger take full advantage of extra memory and 2 MHZ processor speed of Commodore 128 and 128D computers. Now: faster and more memory-efficient! GeoProgrammer Improvements In Version 2.0 GeoAssembler: one program runs under GEOS 64 AND GEOS 128 (80 column only on 128) file selection DB scrolls faster and holds 40 filenames symbol table size: C64 mode C128 mode 3210 macro table size: C64 mode C128 mode xxx names, xxx chars 389 names, 8000 chars object code size limit: C64 mode C128 mode xxx bytes 7999 bytes new error messages: "too many local label references" "phase error in value" "phase error in flag" "syntax error" ("too many local labels" changed to "too many local label definitions") has .text directive to assemble ascii into CBM text codes. ending DB has icon to run the linker GeoLinker: one program runs under GEOS 64 AND GEOS 128 (80 column only on 128) file selection DB scrolls faster and holds 40 filenames VLIR links: up to 21 modules (resident + 20 overlay) allows up to 20 .rel files per module (or total in SEQ link) symbols: C64 mode C128 mode SEQ / CBM applications: x x VLIR applications: x x resident module: x 3185 swap module: x 1375 object code size limit: C64 mode C128 mode xxx bytes 7999 bytes new error messages: "too many errors" "illegal file name" "too many files in a module" ending DB has icon to run the debugger GeoDebugger: one program runs under GEOS 64 AND GEOS 128 see sub-areas below for noted differences between machines symbols: C64 mode C128 mode SEQ / CBM applications: VLIR applications: resident module: swap module: SuperDebugger (in REU) now offers 800 symbols and 1K of macro definitions. 128 mode has new "BackRam SuperDebugger", which hides in BackRam. User can write full-sized applications in FrontRam. Can handle 1000 symbols and 1K of macro definitions. ** This new 20K debugger does now increase size of GeoDebugger: there is a differential loader scheme which loads in the super debugger and then relocates the code for either the REU or BackRam. no GEOS screen assumptions: displays debug information on 40-column screen, and returns to whatever screen (and screen mode) was in use when running user code, or when F7 is pressed see below about debugger's shadow vars for VIC parameters new and improved memory read/write routine: Intercepts (and redirects to debugger shadow variables) reads and writes to: $0000 and $0001 (registers which control memory map) area of zero page which is used by debugger memory areas used by REU SuperDebugger (redirects to user memory swap area in bank #0 of REU) several VIC chip registers, including $DD00 (cia2Base), which controls VIC memory map on 128: $D500-$D50A (memory managment unit) $FF00-$FF04 (more mmu registers) $D030 (1MHZ/2MHZ switch) Disallows reads and writes to: all ROM areas (so no bleed through to RAM occurs) any area where debugger code or symbols are stored (5 different cases here, due to 3 debugger types on 2 machines.) stack area below current SP (debugger is using) page 3 IRQ/BRK/NMI vectors used by ROMs $FFF9 area IRQ/BRK/NMI vectors ram expansion unit's DMA controller, if using REU SuperDebugger "ctab" - external 1Kx4 RAM used by VIC chip in text mode. On 128, there are two of these. Debugger uses ctab #1, and prevents R/W to it. User is free to use ctab #0. When accessing RAM in 128 mode, calculates effective address, taking bank number and bank sharing status into account. New and improved context switch (section of code which bridges gap between debugger and user code): traps interrupts which occur when user's application swaps ROM in without disabling interrupts; warns user through debugger message. on 128 system: handles bank-to-bank switching required to get from either bank to one of 3 debuggers. saves and restores processor clock speed 1MHZ / 2MHZ * Improved GetB / PutB command: works with 1571 and 1581 drives. * Disassembles and top-steps through in-line calls to GEOS correctly. User can disable this option. * displays CPU_DATA ($0001) or Config ($FF00) as primary memory map register in 64 and 128 modes respectively. This affects the "R" register display command and the "REG" register display/modify command. More error checking during file loads, with informative dialog boxes: extensive error checks and good error dialog boxes for: debugger module swaps user application loads macro file loads symbol file loads displays informative error dialog box for format errors in geoWrite macro definition files. Displays filename, error message, page and line number. can debug applications which trash GEOS application must handle loading its own code in over GEOS areas application must disable interrupts or set up its own interrupt service routine. Will have to be clever to place his interrupt vector in $334 area when his application is running under the debugger. (I will supply this code in the new sample app.) Unseen complications which are handled: bank switch concerns during: context switch JSR command GetB / PutB commands rboot maintaining software breakpoints single step breakpoint And all bugs have been fixed! Sample Files: GEOPROGRAMMER V2.0 BETA TEST ROUND #1 July 29, 1988 *** PLEASE READ THIS BEFORE YOU INSTALL THE DISK *** Congratulations on being selected as a tester for geoProgrammer V2.0 ! Because geoProgrammer is such a complex product, and because we want to make sure it is 100% bug-free when we start shipping it, we have decided to put geoProgrammer V2.0 through two rounds of Beta Testing. This is round one. In this package you will find your geoProgrammer V2.0 disk, and some quick notes about differences from versions V1.0 and V1.1. Unfortunately, we have not had the time to fully test geoLinker, and we have not yet completed upgrading the collection of sample files to GEOS V2.0 level. Therefore, do not be concerned if you encounter several bugs in geoLinker. Just let me know by filling out one of the enclosed Bug Report forms, and sending the form back (along with source files if required) to Berkeley Softworks as soon as possible. Over the next three to four weeks we will put the finishing touches on the product, will fix any bugs that you find, and will do more in-house testing. We will then send you a geoProgrammer V2.0 BETA 2 disk, and round two will have begun. We expect the entire Beta Test period (rounds one and two) to last five to six weeks. We do not yet have a draft of the geoProgrammer V2.0 User's Manual Addendum to send you, so the information on the following pages will have to suffice for the next few weeks. From a user-interface standpoint, there are few differences between versions 1.0 and 2.0, so if you have never used the product before, you can follow the instructions in that text. If you have been using geoProgrammer V1.0 or V1.1 for some time, please be sure to try assembling and linking and source files you've already written. IMPORTANT: you will not be able to install geoDebugger on a 1571 drive which is configured as a 1571. You must re-configure the drive as a 1541, and re-open the geoProgrammer V2.0 disk, before you can install geoDebugger. This bug will be corrected in the software you receive in round two. If you have any questions regarding our Beta Test program or the geoProgrammer product, please contact Kevin Boland, and he will connect you to me or one of the other team members. Welcome to the team, and thanks for your help! Eric E. Del Sesto GeoProgrammer Project Leader STATE OF GEOPROGRAMMER V2.0 BETA TEST ROUND 1 geoAssembler: Should be fairly solid. Be tough on it. geoLinker: Has some known bugs, but should be able to correctly link SEQ, CBM, and VLIR applications. geoDebugger: Should be rock solid. Torture it. Make it die. Sample GEOS Files: Are on the disk, and have been upgraded to include GEOS 128 and GEOS 64 V2.0 definitions. Not that before you include these files, you must set the constants C64 and C128 to TRUE ($FF) or FALSE ($00). SampleSeq: Not included on Beta Round 1 disk. SampleVlir: All the required files are on the Beta Round 1 disk. Note that the SamVlirEquates file sets the C64 and C128 constants. These are presently set so that the application will only run under C64 GEOS. If you are testing on a C128, be sure to change these constant definitions before you begin. Also- there are several new additions to the SampleVlir files, such as support for keyboard shortcuts in the menus. You can expect to find some pretty obvious bugs in some of these new features. SampleDA: Not included on Beta Round 1 disk. SampleCBM: This is a new sample file, to demonstrate the non-GEOS capability of geoDebugger V2.0. Not included on Beta Round 1 disk. GEOPROGRAMMER IMPROVEMENTS In Version 2.0 geoAssembler: one program runs under GEOS 64 AND GEOS 128 (80 column only on 128) file selection DB scrolls faster and holds 239 filenames improved output file creation: faster assemblies, deletes partial files after disk errors has .text directive to assemble ascii into CBM text codes. example: .text "This is text for the CBM text screen" C64 mode only: will generate up to 3584 code bytes max number of macro definitions: 100 size of macro storage buffer: 3560 symbol table holds 1151 symbols C128 mode only: will generate up to 7670 code bytes max number of macro definitions: 389 size of macro storage buffer: 12520 symbol table holds 3208 symbols geoLinker: one program runs under GEOS 64 AND GEOS 128 (80 column only on 128) file selection DB scrolls faster and holds 210 filenames improved output file creation: faster links, deletes partial files after disk errors improved .lnk file parsing: allows multiple page .lnk files, gives more informative error messages .SYM file can have 60 lines/page VLIR links: up to 21 modules (resident + 20 overlay) allows up to 20 .rel files per module (or total in SEQ link) C64 mode only: buffer for compacted .LNK file has 3840 bytes code buffer is 3584 bytes resident symbol table holds 1274 symbols swap module symbol table holds 850 symbols during SEQ and CBM application links, combines symbol tables to allow a total of 2124 symbols C128 mode only: buffer for compacted .LNK file has 3840 bytes code buffer is 7670 bytes resident symbol table holds 3217 symbols swap module symbol table holds 1740 symbols (state of the product, continued...) geoDebugger: improved error detection when parsing .DBM files, prints page and line number with error message can top-step over in-line calls to GEOS routines such as i_Rectangle Mini Debugger (C64/C128) occupies $3500-$5FFF, plus $334-$3ff in bank 1 (hold RUN/STOP key down while running geoDebugger to invoke the mini-debugger.) Super Debugger (C64/C128 with REU) macro buffer is 1024 bytes symbol table holds 731 symbols occupies space in REU bank 0, plus $334-$3ff in bank 1 (If you have a RAM EXPANSION UNIT on your system, this debugger will automatically load when you run geoDebugger. By holding RUN/STOP or SPACE down, you can override this to run the Mini-Debugger or BackRam Super-Debugger.) BackRam Super Debugger (C128 only) (128 mode has new "BackRam SuperDebugger", which hides in BackRam. User can write full-sized applications in FrontRam.) Can handle 1000 symbols and 1K of macro definitions. macro buffer is 1024 bytes symbol table holds 910 symbols occupies $2000-$9FFF in C128 bank 0, plus $334-$3ff in bank 1 (If you have an REU on your C128 system, you must hold the SPACE key down while running geoDebugger to invoke the BackRam Super-Debugger.) Additional technical information on geoDebugger V2.0 (You might find this information interesting.) no GEOS screen assumptions: displays debug information on 40-column screen, and returns to whatever screen (and screen mode) was in use when running user code, or when F7 is pressed see below about debugger's shadow vars for VIC parameters new and improved memory read/write routine: Intercepts (and redirects to debugger shadow variables) reads and writes to: $0000 and $0001 (registers which control memory map) area of zero page which is used by debugger memory areas used by REU SuperDebugger (redirects to user memory swap area in bank #0 of REU) several VIC chip registers, including $DD00 (cia2Base), which controls VIC memory map on 128: $D500-$D50A (memory managment unit) $FF00-$FF04 (more mmu registers) $D030 (1MHZ/2MHZ switch) Disallows reads and writes to: all ROM areas (so no bleed through to RAM occurs) any area where debugger code or symbols are stored (5 different cases here, due to 3 debugger types on 2 machines.) stack area below current SP (debugger is using) page 3 IRQ/BRK/NMI vectors used by ROMs $FFF9 area IRQ/BRK/NMI vectors ram expansion unit's DMA controller, if using REU SuperDebugger "ctab" - external 1Kx4 RAM used by VIC chip in text mode. On 128, there are two of these. Debugger uses ctab #1, and prevents R/W to it. User is free to use ctab #0. When accessing RAM in 128 mode, calculates effective address, taking bank number and bank sharing status into account. New and improved context switch (section of code which bridges gap between debugger and user code): traps interrupts which occur when user's application swaps ROM in without disabling interrupts; warns user through debugger message. on 128 system: handles bank-to-bank switching required to get from either bank to one of 3 debuggers. saves and restores processor clock speed 1MHZ / 2MHZ * Improved GetB / PutB command: works with 1571 and 1581 drives. * Disassembles and top-steps through in-line calls to GEOS correctly. User can disable this option. * displays CPU_DATA ($0001) or Config ($FF00) as primary memory map register in 64 and 128 modes respectively. This affects the "R" register display command and the "REG" register display/modify command. Additional technical information on geoDebugger V2.0 (continued) More error checking during file loads, with informative dialog boxes: extensive error checks and good error dialog boxes for: debugger module swaps user application loads macro file loads symbol file loads displays informative error dialog box for format errors in geoWrite macro definition files. Displays filename, error message, page and line number. can debug applications which trash GEOS application must handle loading its own code in over GEOS areas application must disable interrupts or set up its own interrupt service routine. Will have to be clever to place his interrupt vector in $334 area when his application is running under the debugger. (I will supply this code in the new sample app.) Unseen complications which are handled: bank switch concerns during: context switch JSR command GetB / PutB commands rboot maintaining software breakpoints single step breakpoint And all bugs have been fixed! Additional technical information on geoDebugger V2.0 (continued) How GeoDebugger manages machine-dependent memory-map environment information The debugger carries memory-map environment information, which is machine- dependent, around in generic variables such as appBankInfo1 and appBankInfo2. This way, the routines which just move this information around (but don't directly use it) are machine-independent. Execution Environment: When the debugger stops execution of an application (RESTORE pressed or SBP hit), the user's "execution environment" is saved. This includes: processor register and flag values PC address current bank information zero page variables stack information We call the PC address and its memory-map information the "Execution Environment" or more simply, the "PC pointer". Viewing Environment: Once the debugger has stopped an application, the "viewing environment" is the same as the "execution environment". This means that all of the memory examination and modification commands use the same memory-map information as the Execution Environment. Through use of the SETVIEW command, the viewing environment can be changed. You can set up a new memory-map configuration, and then use the memory examination and modification commands to read/write memory in this new configuration. When you give the GO command to resume execution, the debugger restores the execution enviroment, and your program continues execution. We call the viewing address and its environment the "LC pointer". ------------------------------------------------------------------------------- Aspects of GeoDebugger which must change according to machine-dependencies in V2.0, to remain compatible with V1.0. (Kill these in V3.0.) Register command: displays PC address, highlights address if effective address of PC (considering PC bank info) is bank 0. displays CPU_DATA value (It really should not do this anymore, but I am trying to maintain compatability with V1. 64: read directly from appBankInfo1 128: [7-3,0]: direct read from memory [21]: shadow with appCPU_B21 Additional technical information on geoDebugger V2.0 (continued) Register Open Command: ..includes MM register: is CPU_DATA. (To be compatible with V1) 64: directly read/write to appBankInfo1 128: [7-3,0]: directly R/W to memory [21]: shadow with appCPU_B21 ------------------------------------------------------------------------------- Aspects of GeoDebugger which are machine-independent. Memory examination and modification: bank command: affects LC's bank info: curBankInfo1 and curBankInfo2 open modes: uses LC's bank info highlights address if is in physical bank 0 dump command: uses LC's bank info highlights address if is in physical bank 0 move/fill/diff/find: uses LC's bank info highlights address if is in physical bank 0 @ and @@ operators: uses LC's bank info Single and Top-step breakpoints: maintain their own bank information (copied from PC bank info before execution begun) Software Breakpoints: maintain their own bank information (copied from PC bank info before execution begun) PC command: without argument: copy PC address and bank info to LC (restores execution environment) with argument: (same as setting PC in open mode) set PC address = argument set PC bank info = LC bank info Additional technical information on geoDebugger V2.0 (continued) (THIS PORTION OF THE GEODEBUGGER TEST LIST IS SUPPLIED TO GIVE YOU AN IDEA OF HOW THE MEMORY-ENVIRONMENT MANAGEMENT COMMANDS WORK.) 4.10 Memory-Map Environment Management 4.10.1 INITVIEW command: copies the memory-map environment info from the execution variables (PC) to the display/modify variables (LC). Used when user has been viewing different banks, and now wants to examine the memory map as it was when we stopped execution. 64 128 128 REU REU BACK ___ ___ ___ initview no arguments. Displays PC line and environment info. ___ ___ ___ note that PC command has same effect of copying environment information, but does not display memory-map info when done. ___ ___ ___ verify that "IV" command alias works 4.10.2 SETVIEW command: sets the memory-map environment for the display/modify commands. Displays new environment info if no error. format: setview [, ] ___ ___ ___ setview sets appMemMap1. ___ ___ C128: should not affect appMemMap2 setview , ___ ___ C128: sets appMemMap1 and appMemMap2. ___ ___ C128: verify that B7 and B6 are cleared in appMemMap2 (this variable must have 0's in those positions) ___ ___ ___ displays new environment info correctly ___ ___ ___ error if no arguments given ___ ___ ___ error if either value greater than 255. ___ ___ ___ verify that "SV" command alias works 4.10.3 VIEW command: displays current memory-map environment info. ___ ___ ___ view no arguments required ___ C64: only displays 1st of 2 values on each line ___ ___ C128: displays both values on each line ___ ___ ___ verify that "VW" command alias works 4.10.4 USEVIEW command: forces the display/modify environment upon the execution environment. Displays new info when finished. ___ ___ ___ useview no arguments required ___ ___ ___ verify that "UV" command alias works 4.10.5 B0 command: set display/modify environment variable so that all of bank 0 is visible. Displays new info when finished. ___ ___ ___ b0 no arguments required 4.10.6 B1 command: set display/modify environment variable so that all of bank 1 is visible. Displays new info when finished. ___ ___ ___ b1 no arguments required 4.10.7 Memory-Map Environment Management... TEST: view environment same as execution environment when software breakpoint is hit or RESTORE is pressed. ___ ___ ___ use view command, values on two lines should be equal. Additional technical information on geoDebugger V2.0 (continued) TEST: the following commands, making sure that they use the view environment memory-map information when accessing memory. ___ ___ ___ "A" open mode ___ ___ ___ "M" open mode ___ ___ ___ depositing values when in an open-mode ___ ___ ___ @ and @@ operators in expressions ___ ___ ___ DUMP ___ ___ ___ DIS ___ ___ ___ N ___ ___ ___ W ___ ___ ___ PRINT ___ ___ ___ FILL / COPY / DIFF / FIND TEST: that execution environment is used when execution is re-started. ___ ___ ___ need test code for this... TEST: (C128 only) in the following commands, an address shows up highlighted if the effective address (considering RAM sharing) is in bank 0. Hint: to set LC to bank 0, use B0 command. To set PC to bank 0, use B0 followed by USEVIEW command. ___ ___ "R" ___ ___ "A" open mode ___ ___ "M" open mode ___ ___ DIS, W, N, etc. ___ ___ DUMP ___ ___ DIFF ___ ___ FIND ___ ___ HISTORY ------------------------------------------------------------------------------ V1.000 11/2/87 Sent to HLS, but never mastered due to 128 crashes. COMPLETE MASTER RELEASE TAPE MADE 11/11/87. This VERSION 1.0 (11/2/87) release was sent to HLS, but was never mastered because Brian had me change the 128 enable bit in each application's header block. See V1.010 for list of known bugs. ------------------------------------------------------------------------------ V1.010 11/18/87 Sent to ZMAG. Duplicated as GeoProgrammer V1.0. 4000 shipped without errata sheet. Errata items posted to QLINK 1/25/88 Only difference from V1.000: bits set in headers so does not crash GEOS 128. (Items marked PATCH were corrected with Patch2.88 program to create V1.1. Items marked LATER were not fixed until V2.0.) Known bugs in 11.18 release, which were corrected with Patch2.88 program. Linker has trouble creating VLIR files. Bug: variable called fileWritten not set to TRUE, so BAM is re-read from disk instead of using more recent BAM which is in memory. Assembler has trouble with local labels after parsing a bitmap or routine longer than 254 bytes. Bug: two branches skip too far and miss code which resets a variable. Assembler has trouble with bitmaps. Bug: uncompacting wrong. Linker has trouble with .ramsects in Resident and Swap modules. Known bugs in 11.18 release, not corrected until V2.0: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Assembler (things to mention in errata list): In assembler, if encounter disk error, should attempt to close any opened files so disk is not inconsistent. ERRATA: warn them, tell them to delete files and validate disk. Assembler has trouble uncompacting bitmaps of less than 18 pixels height ERRATA: don't do it If a routine is large enough to come close to the end of codeBuffer, it could overflow into the External Reference Buffer. ERRATA: keep routines smaller than approx 250 bytes (ask ted) Assembler: does not print correct page number in error messages referring to branch instructions. Also counts macro expansion lines, so most error messages are off. ERRATA: if you get a local label error, consider that it might be on the previous page (or page before that). Other errors: consider macro expansions when counting line nums. When assembling LDA ZP,Y (which does not exist), assembler should substitute LDA ABS,Y. ERRATA: warn and tell them how to get around it. lda #RelocValue or .byte RelocValue passes relocation pointer to linker which trashes word in code. Assembler should generate error message. ERRATA: use low byte operator: "[" before any such references. "*" operator always gets psect value, so does not work in ramsect or zsect areas. ERRATA: warn them In assembler, screen colors not set correctly, so can see Insort working by changing your screen colors. ERRATA: tell them to close their eyes during assemblies. Does not look for GeoWrite correctly when opening error file: should look for permanent name string. ERRATA: do not rename your geoWrite. Assembler: (things I was told about too late to mention them in the errata list) "+" operator does not work in unary case Phase Error: jsr $0045 does not assemble correctly. When an unresolved symbol is used as the second operand in an expression that involves a division or a modulus, the expression will not be passed to the linker. Instead, it will generate an error in the assembler. Assembler: (things not to mention in errata list) Assembler's bitmap decompaction code does not handle BigCount values correctly. Not a big problem: photo scraps up to GEOS V1.3 work ok. If there is any text after a .endm, produces "Hidden Error". File selection DB bug: could run program without choosing a file. Assembler should not pass Pass1, PicW, and PicH symbols to linker. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Linker: (things to mention in errata list) In linker, if encounter disk error, should attempt to close any opened files so disk is not inconsistent. ERRATA: warn them, tell them to delete files and validate disk. Linker: when using FreeBlock to delete header blocks from CBM files, does not realize that 1.2 kernal does not have code for 'FreeBlock'. ERRATA: warn them, suggest they upgrade to GEOS 1.3. Linker: does not correct for illegal .rel filenames. Does not give correct error for .rel file not found. Does not stop after first 10 .rel files in a module, producing a bug. ERRATA: warn them not to have more than 10 .rel files per module. On one-drive system, linker does not display "sym file" dialog box. ERRATA: tell them to buy a second drive. In linker, screen colors not set correctly, so can see Insort working by changing your screen colors. ERRATA: tell them to close their eyes during assemblies. Does not look for GeoWrite correctly when opening error file: should look for permanent name string. ERRATA: do not rename your geoWrite. Linker: (things I was told about too late to mention them in the errata list) "+" operator does not work in unary case, and "//" operator does not work. ERRATA: I didn't hear about this until it was too late. Linker: (things not to mention in errata list) Linker is not clearing ZP flag bit, so in debugger some symbols have a graphics character in position 3. Linker does not stop at 99 errors. File selection DB bug: could run program without choosing a file. When .lnk file is write-protected, linker displays DB. Click on ignore to continue. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Debugger: (mention in errata list:) some symbols show up with graphics char in position 3. Is really a linker bug. ERRATA: warn them, suggest they use * wildcard during searches. Debugger: (do not mention in errata list:) debugger file-select DB does not display write-protected files debugger does not load PRG files which are write-protected correctly debugger is not saving or restore deskTop's ROM vectors ($314-$318) correctly. Is not preventing writes to $314-$315. Not a big problem: my vectors at $314 and $316 are the same anyway. Fixed 2/1/88 by correcting basBRKVec and basIRQVec in constants file. New code installed in May to handle this differently. REU SuperDebugger only allows 768 symbols, where it could have 870. REU SuperDebugger does not getb/putb from 1571 drive correctly. if you hold STOP key down when debugger turns on text screen during initial boot sequence, it aborts its init cycle, and leaves you at the command prompt with things screwy. Note: Both monitors in GeoDebugger have an unused routine which takes 18 bytes. GOOD LOCATION FOR PATCH SUBROUTINES! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sample Files: (mention in errata list) In SamVlir.lnk, should have $3000 instead of $5000 for variable area. (causes mini-debugger to crash) In SamSeq.lnk, should have $3000 instead of $5000 for variable area. (Does not cause mini-debugger to crash because no vars are used.) In SamSeq and SamVlirRes, "VERTICAL" under MenuTable should be "SUB_MENU". - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Manual: (mention in errata) .header structures are checked for 12 statements, not 11. Debugger is not as isolated as we make it sound: still uses GEOS ram expansion routines. Debugger uses $340-$3ff, not $350-$3ff. APP_RAM == $400 has been changed to APP_RAM = $400. Runto (rt) command will only display GEOS screen if option 5 is enabled (g1 command). The sample application cannot be re-run with go $400. Page 7-11 incorrect in stating that runto will show screen. Page 8-1 the British pound character is a single key (no need to press C= key). SampleVlir does not do any error checking when trying to find "SampleVlir" on disk. If they are not careful when changing application's name, will not load correctly. Warn people that use of Pass1 is dangerous; Tell them to make sure they have a .psect after incl. zp vars file. Manual: (do not mention) May want to explain a little bit about interrupt timing, or "why mouseData changes". ------------------------------------------------------------------------------ V1.100 2/88 This version is actually V1.010 after the Patch2.88 program has modified the Assembler and Linker. Patch2.88 distributed through QuantumLink, and V1.100 Master disk created by running Patch2.88 on V1.010 Master disk. This V1.100 Master disk duplicated by ZMag, copies sent free of charge to registered owners who requested it. ------------------------------------------------------------------------------ V2.000 April 1988 C64/C128 version, with many improvements and bug fixes. THIS IS A QUICK LIST; see "versionV2" file for a summary. Assembler Improvements: runs under GEOS 64 and GEOS 128 (in 80 column mode) ending DB has icon to run linker has .text directive to assemble ascii into CBM text codes. Linker Improvements: runs under GEOS 64 and GEOS 128 (in 80 column mode) allows up to 20 .rel files per module ending DB has icon to run debugger Debugger Improvements: SampleFiles Improvements: New warnings for manual: Assembling files under C128 and linking them under C64-- does Linker check for tables which are too large? ------------------------------------------------------------------------------ Technical Overview of Important Differences Between GeoProgrammer Versions Assembler: Since code record, xref record, reloc record, and error file pages are written out block by block, we are not concerned with buffer sizes. Macro text storage size: V1.0 2K V2.0 (64 mode) 3560 V2.0 (128 mode) 12520 Symbol table size: V1.0 3017+7670 = 10687 (1068 symbols) V2.0 (64 mode) 11510 (1151 symbols) V2.0 (128 mode) 32080 (3208 symbols) Does not run in 128 40-column mode because all DMA work in backram causes 40-column screen to flicker badly. Linker: Xref and Reloc pointers are read block-by-block from records, so we are not concerned about buffer sizes. Code buffer size (for one .rel's code record) V1.0 6608 V2.0 (64 mode) 3584 V2.0 (128 mode) 7670 Resident module symbol table size: V1.0 10K = 10240 (1024 symbols) V2.0 (64 mode) 12740 (1274 symbols) V2.0 (128 mode) 32170 (3217 symbols) Swap module symbol table size: V1.0 8K = 8192 (819 symbols) V2.0 (64 mode) 8500 (850 symbols) V2.0 (128 mode) 17400 (1740 symbols) Sequential Apps: V1.0 10K (you might think is 10K + 8K, but there is a bug: is only 10K) V2.0 (64 mode) 21240 V2.0 (128 mode) 32170 (backram only. MattSort to use both banks (giving 48K) would be a mess.) Number of .rel files per module: V1.0 10 V2.0 (64/128) 20 Creating GeoWrite sym files: for each .dbg record: read block by block into frontram and move to back sort entire in back for each sym in back copy sym to front write to 5K page buffer (FG screen area?) write out 5K buffer as page Does not run in 128 40-column mode because all DMA work in backram causes 40-column screen to flicker badly. GeoDebugger: geoProgrammer V2.0 for C64 and C128 Upgrade Offer September, 1988 Dear geoProgrammer user: Our latest release of the geoProgrammer package, geoProgrammer V2.0, will soon be available. We can offer you, as a registered geoProgrammer owner, this new product for the low price of $XX.XX. We have rewritten much of the original software, taking your suggestions into account, and adding some new features. Overall Product Improvements: - geoProgrammer V2.0 supports the Commodore 128 and 128D computers. geoAssembler, geoLinker, and geoDebugger now run under GEOS 128 at the faster 2MHZ clock rate, using the 80-column screen and additional memory. - geoProgrammer V2.0 is fully compatible with all versions of GEOS: V1.2, V1.3, and V2.0, and with the new 1581 disk drive. - in both C64 and C128 modes, geoProgrammer V2.0 runs faster and more efficiently. Error detection has been improved, and more informative error messages are provided. File selection has been streamlined. - the three sample applications have been upgraded to support the C128, and to illustrate more GEOS programming concepts such as keyboard shortcuts. - the GEOS "include" files have been updated to reflect GEOS V2.0 information. - geoProgrammer V2.0 includes an additional sample application, which demonstrates how you can develop "CBM" applications which do not require GEOS to run. Improvements in geoAssembler V2.0: - geoAssembler V2.0 will read geoWrite source files from all versions of geoWrite, up to V2.1. - new .text directive converts ascii text strings directly into Commodore screen codes. Maximum Maximum Aspect of geoAssembler V2.0 in C64 Mode in C128 Mode --------------------------------------- --------------- ------------ symbol definitions: 1151 symbols 3208 symbols macro definitions: 100 macros 389 macros or 3560 bytes or 12520 bytes code bytes generated per .rel file: 3584 bytes 7670 bytes --------------------------------------- --------------- ------------ Improvements in geoLinker V2.0: - geoLinker V2.0 will accept multiple-page ".lnk" command files, generated with any version of geoWrite. - will link up to 20 .rel files into a SEQ or CBM application, and up to 20 .rel files per module in a VLIR application. Maximum Maximum Symbol definitions in geoLinker V2.0 in C64 Mode in C128 Mode --------------------------------------- --------------- ------------ when linking SEQ and CBM applications: 2124 symbols 3217 symbols when linking VLIR applications: resident module: 1274 symbols 3217 symbols for each overlay module: 850 symbols 1740 symbols --------------------------------------- --------------- ------------ Improvements in geoDebugger V2.0: - new "hidden mode": now you can view your application's screen while giving commands to geoDebugger. - geoDebugger V2.0 will recognize calls to inline GEOS routines such as i_Rectangle, allowing you to safely top-step over and disassemble these calls. - new BackRam Super Debugger allows C128 owners without a ram expansion unit to take advantage of the Super Debugger's features. - improved "context switch" in C128 mode, allowing single-step through code which involves bank switching; allows execution at either 1 MHZ or 2 MHZ clock rate. - full support for non-GEOS applications, including technical notes on how to write and install your own interrupt service routines. - stray interrupt trapping facility, to aid in isolating rare crash conditions in C64 and C128 applications. STACI- explain how they go about ordering the upgrade: - price - where to send check / money order / credit card # / etc - whether or not they can call their order in - if they must send their original disk, or if a receipt will suffice. (do not ask them to tear the cover off their manual- they will still need the old manual!) - who they should call with questions, or where to write for info on the upgrade offer (not me!) C128 mode has real trouble with bitmaps. See file14&15... ------------------------------------------------------------------------------- Known (and allowable) differences between geoAssembler (Ted's) and geoAssembler (mine) output files. TED: ERIC: ----------------------- ----------------------- .REL file: Code record illegal branch: gets garbage offset offset = $20 ExRef record: less I generate more ExRefs Reloc Record: SYM record: +3: Reloc bit: set for ZP labels always 0 +4: "==" bit set for "=" equates set for "==" equates .ERR file: margins in ruler: offset=+7: =$28 =$30 ------------------------------------------------------------------------------- BUGS: DONE: - fixed link icon - cleaned up some 40/80 column problems in Init module - made writeBAMToDisk a byte variable - added PanicWriteNewBAMToDisk to routines which delete chains - cleaned up 40/80 column mode switching some more - fixed lots of miscellaneous things in macro expansion... - rewrote how macro parameters are parsed from definition line, so that can detect all error cases - rewrote how macro arguments are parsed from invocation line, how they are stored and searched. should handle null args, too many args - fixed handling of global labels within macros- now substitutes correctly, handles 8 char symbols - fixed bug in nested macros which have global labels (+1 error) - fixed how SearchTable determines lengths of things it can search for - re-wrote test file #19 (tests macro def and exp errors), added a series of additional tests, verified all output, placed on test disk A. - created test file #75 (tests all possible non-fatal error messages) Includes most scenarios which could generate these errors. verified all output, placed on test disk B. - fixed "reloc" flag bug: now sets relocation bits in labels correctly - rewrote how local labels and references to them are placed in tables (corrected bug which cleaned up after JMP 10$ incorrectly) - rewrote how information is collected about an operand while it is being evaluated, and how this information affects the possible addressing modes. Corrected several bugs having to do with expressions which consist of several different types of arguments. - expression was judged as relocatable even after math - bit for equate was set by noglbl/noeqin status - "*" operand didn't set right bit for psect/ramsect - was setting status:B3 for "UnaryTogether" cases- why? - improper handling of LDA # and .BYTE operands - not generating reloc pointers and exrefs in all cases - not catching all possible branch errors (bad local label usage) - made 2 central routines for grabbing args for .IF etc, .BLOCK, .PSECT etc, etc. - changed the way GetExpression looks at "mustEval" - removed the "complexExp" flag - rewrote error detection in local label references and definitions - now can forget most recent local label reference, for cases where line is bad (does not stamp code which is not assembled) - created testfile: file76_1 to test all expression parsing and error detection; also includes some branching tests - fixed a lot of bugs related to using "*" in expressions Corrected expression evaluator's type-checking in general created new test file (file7) to test this - OpenSourceFile in File/fileRoutines no longer does a FindFile before OpenRecordFile. Speed assembly a bit. - spent a day chasing file14 bug in 128 mode. No luck. KEEP AN EYE OUT FOR: There might be a bug with file62 (too many backram symbols) try on stand-alone, see if BOLDFACE characters get trashed If so, disable DMA MoveData, see if it still happens ------------------------------------------------------------------------------- Warn in manual: It may be possible for assembler to have too many symbols than the linker could read in from one .REL file. But if some of these are .noeqin or .noglbl'ed out, we are ok. Warn in manual that BNE Start+Start will not assemble correctly, because I assume is something of the form: BNE Start+2, which is legal. File select DB will display any application data file which does not end in ".rel", ".dbg", ".sym", ".err", ".lnk": thus is faster than before. Problem: will display geoFile and geoPaint etc. documents. ------------------------------------------------------------------------------- FUTURE: Add to test list page too big (4096) echo too many pages too many error pages minor bugs found in file75: Not recognizing "line too long" correctly Could not get it to print "expression too complex" does not detect .ramsect and .include in macro definition see error #61- I did not force it correctly see file3: assembler is not flagging error for ".word "eric" " C128 mode: intermittent bug when trying to assemble file14 (big bitmap) off of drive A, onto RAM DISK. Sometimes get "disk name mismatch" error. C128: why did 3208 not overflow symbol table? table holds 3208- I sent 3208 plus 3 already there! Create a file78 which is a copy of file75, but which tests .if Pass1 stuff. I did this on 10/1/88, and hit a weird phase error at GlobalLabel:. I don't think this is a big problem. Slight problem in expression evaluation: parses jmp (label) as relocatable with math, since it hits the ending parantheses. Need to educate getExpression a little more so this does not happen. This is not a problem with the (,x) and (),y addressing modes, because they must have resolvable ZP expressions, and so they never generate external references. ------------------------------------------------------------------------------- DISTANT FUTURE Move local label parsing out of expression evaluator: right now the error detection is very confused by cases such as lda 10$+4 lda 4+10$+6666666666666 lda 10$+20$+30$ ;three references added to list, ;only last one deleted... Minor problem: A line such as .byte 1,crap,2 will still generate 3 bytes of code: would be nice to completely reverse the effects (code, LC incs, exrefs and relocs generated, etc) of a code line when an error is detected. Otherwise there is no easy way to handle this case. Related problem: in cases where an error is detected in pass 2 and NOT pass 1, we have to make sure the same amount of code is generated in both passes, so that no phase errors show up. "Too many local label references" is a good example of this. See beginning of ParseInst for how I handled this. C128 mode has real trouble with bitmaps. See file14&15... ------------------------------------------------------------------------------- Known (and allowable) differences between geoAssembler (Ted's) and geoAssembler (mine) output files. TED: ERIC: ----------------------- ----------------------- .REL file: Code record illegal branch: gets garbage offset offset = $20 ExRef record: less I generate more ExRefs Reloc Record: SYM record: +3: Reloc bit: set for ZP labels always 0 +4: "==" bit set for "=" equates set for "==" equates .ERR file: margins in ruler: offset=+7: =$28 =$30 ------------------------------------------------------------------------------- BUGS: DONE: - fixed link icon - cleaned up some 40/80 column problems in Init module - made writeBAMToDisk a byte variable - added PanicWriteNewBAMToDisk to routines which delete chains - cleaned up 40/80 column mode switching some more - fixed lots of miscellaneous things in macro expansion... - rewrote how macro parameters are parsed from definition line, so that can detect all error cases - rewrote how macro arguments are parsed from invocation line, how they are stored and searched. should handle null args, too many args - fixed handling of global labels within macros- now substitutes correctly, handles 8 char symbols - fixed bug in nested macros which have global labels (+1 error) - fixed how SearchTable determines lengths of things it can search for - re-wrote test file #19 (tests macro def and exp errors), added a series of additional tests, verified all output, placed on test disk A. - created test file #75 (tests all possible non-fatal error messages) Includes most scenarios which could generate these errors. verified all output, placed on test disk B. - fixed "reloc" flag bug: now sets relocation bits in labels correctly - rewrote how local labels and references to them are placed in tables (corrected bug which cleaned up after JMP 10$ incorrectly) - rewrote how information is collected about an operand while it is being evaluated, and how this information affects the possible addressing modes. Corrected several bugs having to do with expressions which consist of several different types of arguments. - expression was judged as relocatable even after math - bit for equate was set by noglbl/noeqin status - "*" operand didn't set right bit for psect/ramsect - was setting status:B3 for "UnaryTogether" cases- why? - improper handling of LDA # and .BYTE operands - not generating reloc pointers and exrefs in all cases - not catching all possible branch errors (bad local label usage) - made 2 central routines for grabbing args for .IF etc, .BLOCK, .PSECT etc, etc. - changed the way GetExpression looks at "mustEval" - removed the "complexExp" flag - rewrote error detection in local label references and definitions - now can forget most recent local label reference, for cases where line is bad (does not stamp code which is not assembled) - created testfile: file76_1 to test all expression parsing and error detection; also includes some branching tests - fixed a lot of bugs related to using "*" in expressions Corrected expression evaluator's type-checking in general created new test file (file7) to test this - OpenSourceFile in File/fileRoutines no longer does a FindFile before OpenRecordFile. Speed assembly a bit. - spent a day chasing file14 bug in 128 mode. No luck. KEEP AN EYE OUT FOR: There might be a bug with file62 (too many backram symbols) try on stand-alone, see if BOLDFACE characters get trashed If so, disable DMA MoveData, see if it still happens ------------------------------------------------------------------------------- Warn in manual: It may be possible for assembler to have too many symbols than the linker could read in from one .REL file. But if some of these are .noeqin or .noglbl'ed out, we are ok. Warn in manual that BNE Start+Start will not assemble correctly, because I assume is something of the form: BNE Start+2, which is legal. File select DB will display any application data file which does not end in ".rel", ".dbg", ".sym", ".err", ".lnk": thus is faster than before. Problem: will display geoFile and geoPaint etc. documents. ------------------------------------------------------------------------------- FUTURE: Add to test list page too big (4096) echo too many pages too many error pages minor bugs found in file75: Not recognizing "line too long" correctly Could not get it to print "expression too complex" does not detect .ramsect and .include in macro definition see error #61- I did not force it correctly see file3: assembler is not flagging error for ".word "eric" " C128 mode: intermittent bug when trying to assemble file14 (big bitmap) off of drive A, onto RAM DISK. Sometimes get "disk name mismatch" error. C128: why did 3208 not overflow symbol table? table holds 3208- I sent 3208 plus 3 already there! Create a file78 which is a copy of file75, but which tests .if Pass1 stuff. I did this on 10/1/88, and hit a weird phase error at GlobalLabel:. I don't think this is a big problem. Slight problem in expression evaluation: parses jmp (label) as relocatable with math, since it hits the ending parantheses. Need to educate getExpression a little more so this does not happen. This is not a problem with the (,x) and (),y addressing modes, because they must have resolvable ZP expressions, and so they never generate external references. ------------------------------------------------------------------------------- DISTANT FUTURE Move local label parsing out of expression evaluator: right now the error detection is very confused by cases such as lda 10$+4 lda 4+10$+6666666666666 lda 10$+20$+30$ ;three references added to list, ;only last one deleted... Minor problem: A line such as .byte 1,crap,2 will still generate 3 bytes of code: would be nice to completely reverse the effects (code, LC incs, exrefs and relocs generated, etc) of a code line when an error is detected. Otherwise there is no easy way to handle this case. Related problem: in cases where an error is detected in pass 2 and NOT pass 1, we have to make sure the same amount of code is generated in both passes, so that no phase errors show up. "Too many local label references" is a good example of this. See beginning of ParseInst for how I handled this. linker does not warn about word stamped into byte location: .byte Extern lda #Extern ;see file7 GeoLinker THINGS TO DO: - corrected bad MoveData in LinkHeader which was trashing symbol table, causing bad .SYM file to be created (to avoid, do not create customized header block) - corrected bug in module swapping, which caused problems when writing .SYM file to other disk (to avoid, set output drive = application drive) - now runs geoDebugger properly (had bad perm name) - tested .cbm link with multiple .rel files: works ok - removed warnings about MoveBData overlapping symbol table - fixed: "symbol defined more than once"- is printing filename instead of sym - fixed: if sym error in header file, error message funny - fixed: if sym table empty, searches all of memory for symbol - fixed: prints correct error when header block wrong size - fixed: does not delete old files when output drive not input drive - fixed: seq, cbm, and vlir .OBJ files should now have correct size. - re-installed resident code munging - cleaned up some 40/80 column problems in Init module AFTER BETA 1: add files to test list Future: I am not so sure the Hex/decimal/octal etc parsers work. same problems in assembler? I may have screwed up how it evaluates expressions in .MOD statements See Resident/getLine, and a variable "operand" which determines where a word boundary is. DONE: - reordered modules - made sure that program has a top-level in resident, and that everything is a call from it - updated how swap and drive routines work - combined File, Drive, and Compact modules - updated GetFilename, with changes we made to geoAssembler - copied new ToText and ToBitmap routines over from assembler - moved some init code to File module - moved error file creation to File module - removed alot of unused code in expression evaluator, removed bugs - created GetLineAndWord - OpenAnotherFile -> OpenRelFile - rewrote how LNK file is parsed moved most of it to File rewrote mid-level and top-level parsing routines deleted some error messages, added some - updated screen handling - rewrote how symbols are relocated - rewrote how reloc pointers are read in and used - rewrote how expressions are read in and used - rewrote routine to search symbol tables- removed lot of excess code, possibly some bugs. searches 2-3 times faster now. - simplified how symbols are compacted, fixed, sorted, and written out to disk - placed Res and Swap tables next to each other, commented out all bigSeq code - REWROTE how .OBJ file is created and written to, including custom header block / CBM file considerations - rewrote how header block .REL file is linked to rest of application- header .REL file can now have its own symbol defs, which go to swap table. - REWROTE how linker opens geoWrite or geoDebugger (code from assem) - brought new ToText and ToBitmap code over from geoAssem - rewrote error printing routines - REDUCED TOTAL SIZE OF APP FROM 24K to 20K - REDUCED SIZE OF RESIDENT BY 2589 BYTES! - did complete walk-through of new code, making sure that disk and user errors caused the right thing to happen - final work on file creation/deletion stuff - re-installed STOP key checks - added CheckDiskError calls throughout program - added code to set filename pointer in case error occurs - added new error dialog box: prints filename, error, allows CANCEL - added code to delete output files correctly on error, display second DB if second disk error - nuked error message pointer table to save bytes in resident - REWROTE how we create the .ERR file made sure ruler and version # are OK - REWROTE how we create the .DBG file - modified how we create the .SYM file- does this need any work? don't forget to test installation with 1571 drive! Think about 2 different physical drives on non-REU system: will GEOS tell me that driver does not exist, or will I crash? Bug: 1571 as A, 1581 as B, run debugger on B, try to select drive A, and since there is no REU, GEOS SetDevice does not work. Does it return error condition to debugger? or just crash... Bugs in Tuesday (6/21) 12PM version: stop command in hidden mode does not do the right thing! change notes in get info box Bugs in thu (6/16) 4PM version: fixed: SETU u.e2 command does not clear high bits! fixed: SYM r0L finds r0 also! fixed: getn command is reading disk info from bank 0! fixed: in rboot, quit, and exit commands, pressing F8 screws up line fixed: stop command does not cancel hidden mode anymore forget: @# operator does not take in-lines into account investigated: we cannot protect all of I/O space warn in manual: in BackRamSuper (and have REU), show GEOS screen when top-stepping through MoveData, because it uses DMA to move small things. (They could disable MoveData in configure to be sure. Also warn that an RBOOT brings back old MoveData/RBOOT flag values.) Bugs in earlier versions: fixed: setu ss,0 places cursor wrong fixed: print @ sign where PC should go fixed: not deleting SBP's correctly fixed: trashes X (and open modes) when setting SBPs to RAM fixed: does not load CBMs with header correctly fixed: $03FC-$03FF still treated differently fixed: in 64 mode, is not tracking bank info with SBPs correctly finish now works within inline call cleaned up FetchInst usage n command will now set final LC correctly if last line is inline JSR fixed FindNext: M mode should now ignore inline stuff check up and down in both modes, check reg, flag, opt, etc corrected "W": now uses FindNext, so should work. fixed JSR command test: boot app and try JSR $400: should come back to us before going off to GEOS mainloop fixed skip command: takes bank into account fixed diff and copy commands fixed F8 in mini debugger right-side prompt bug fixed load CBM app with header bug fixed $3FC-$3FF bug fixed bank info comparisons added I and R printing to open command prints error if try to set BP in ROM or IO fixed IO area decode bug ($D022) cleaned up init code: zeroed all vars at start, saved lots of bytes fixed StuffBRKAtLSA bug which I created yesterday! ------------------------------------------------------------------------------ Major code sections: ------------------------------------------------------------------------------ For Test List: good test for C64 version: check to see if $FF00 and $D506 are changing special assignments for Beta Testers? single stepping through different banks memory access tests symbol table use macro definition use ------------------------------------------------------------------------------ New Concerns: what if in 64 mode they swap ROM in and use debugger GetBlock? ------------------------------------------------------------------------------ Things To Research: RESET executes ROMS, but do they check RAM? Bank 0 Page 3 issues: I fill first with $00 and then with $ed, and deskTop and icon editor had no problems running. cannot load other desk accessories? easy way to load drivers? ???convert tabs found in macro defs ???DIR save PC? InitForIO trashes $314 area vectors- YES: $314 and $318 (IRQ and NMI) ------------------------------------------------------------------------------ Not concerned with: debugger assumes all geoWrite versions above 1.1 are the same. 64 mode on C128: can set for 2MHZ? RESTORE key bounces! Generates two NMI signals, spaced about 200 usec apart ------------------------------------------------------------------------------ Low Priority: User complaint: his program ran under DGB, crashed under GEOS. He had forgotten to put a dummy icon up. Possibly related to debugger clearing memory. Should not allow user to load application which trashes MiniDebugger in memory or which would trash GEOS add option to disable GEOS Disk usage? (so they won't do the wrong thing when debugging games) add detection for trashed GEOS? (would force rboot on exit) read option presets from value of OPTIONS constant in symbol table after user has trashed memory, should boot GEOS from disk... option to allow them to use BRK as an instruction (get to their vector) ------------------------------------------------------------------------------ For Manual: minor: holding mouse button looks like run/stop during boot their IRQ service routine must finish with an RTI because of the way things are pushed... Debugger will not load their Game over GEOS: Game must call GEOS routines to get the rest of it in (this is what deskTop would require anyway.) places BRK at RstrAppl if is running desk accessory mention "Press RESTORE sharply" in manual $D506 and $FF00 shadowed r.mm nuked completely. R command no longer shows MemMap screen flicker during step is due to poor GEOS 128 interrupt code holding key down when debugger starts will force error on first line user may want to change r command: creat macro which does R and BANK. user can change PC mem map directly by accessing ff00 and d506 if user's code updates screen registers, but debugger screen is visible, then when debugger kicks in it will assert its values, losing the user's new values. Warn them to enable target screen before executing such code. see Specs/userNotes for more... ------------------------------------------------------------------------------ Assumptions: GEOS 128 has same $fffa vectors in B1 and B0. I assume this to be true for all future versions. ------------------------------------------------------------------------------ Save Bytes: mini debugger does not have to be as careful about screen stuff in resident: compact that dam Drive icon! ------------------------------------------------------------------------------ Future: do not execute illegal instructions could customize debugger according to 64/128 mode REU as trace buffer? don't allow two macros of same name in macro file write out macro file add modules to debugger for more features sense user's module swap and correct SBPs? could save B1/B0 info in symbol table to further reduce conflicts memory range commands could easily move data from bank to bank commands like W will not work if printing is off, because DisplayLocation is never called, bytes never read, pointers never moved. This could be cleaned up. clrb is now crippled because it religiously checks for exact bank info when searching the SBP list. Could remove this restriction to make the clrb command easier, but then trying to remove a double-SBP (bank1 and 0, same addr) using an open mode would be impossible. Actually, there is a deeper problem with the way we store bank info with SBPs in their table: we should just store the effective bank difference, not the 16 bits of info. If the setb command is checking for exact matches when it inserts a new SBP, then you could have several "equal" SBPs in the same table. ------------------------------------------------------------------------------ Finished: 40/80 column text bits and centering stuff, moved to one file, standardized DB text positions (will help apple port) macro load bugs, extensive error checking, page/line # bugs symbol load bug info box code: displays status messages as files load STOP key bug bugs in loadSaveByte error checking during symbol table loads loads default.dbm even if no filename given need ResPrepForQuit extensive error checking during module swaps, debugger loads, and filename selection (including printing current filename during error) added memory R/W checks for $FF01-$FF04 page # in macro file loads fixed 80 column scroll bug ResPrepForQuit restores user's screen, not be same as GEOS screen clear pending interrupt before stepping test new LCRA-LCRD stuff inverts addresses if displaying bank #0 address GetBlock, PutBlock: call bank 1 routine, display bank 1 data JSR does work in either bank (because is like a top-step) REU check under GEOS V1.2 test rboot in all 5 configs C64 mode! bankInfo1/2 variable: carries info in 64 and 128 modes call Get1stDirEntry, use r5, call getNxtDirEntry - need two new primitives - change dir macro tracked down screen flicker bug (is GEOS 128 interrupt code!) - implemented new 3-level NMI enable/disable code - found bug in 128 GEOS InitForIO - added CIA2 NMI handling - wrote documentation on stray interrupt trapping - wrote routines so user's applications can set interrupt service routine vectors correctly when running under GeoDebugger - documented vectors in GeoDebugger wedge code which are useful - fixed "lda A000" parse bug - fixed sym search bug - fixed bug in stopmain - fixed disassembly bug: now displays code when cannot find label macro error bug stop key bug cia1 ddr assertion rti bug centering LdFile usage bug file init address bug exit after disk error corrected select file DB icons, scrolling bug file DB selection area setu / pr u.e1 bug dir / getblock from RAM DISK bug flags on boot bug RBOOT more intelligent ignores STOP key in left-side mode rewrote some printing routines added new HIDE feature corrected 128 mode keyboard scan problem added kernal checking to Get1stDirEntry/GetNxtDirEntry and made some corrections display copyright messages display disk name when selecting file top-step through inline calls disasm up and down through inline calls page 3 code asserts value of $0000 to $2F dumpd command sets LC to B1$8100 corrected GetBlock/PutBlock corrected disk and drivea/b commands corrected PrintDiskName command rewrote way that the 3 monitors read/write/swap misc. GEOS vectors and variables just fixed 64 mode bug, made table shorter using Ý operator backram super should disable DA loads ------------------------------------------------------------------------------ FILES IN THIS DIRECTORY /staff/jim/geos/PRODUCTS/geoProg/geoDebug/Specs Useful: InitForIOBug: detailed info on C128 InitForIO bug REUNotes: full doc on GEOS REU usage and how we use it REUbugs: how to warn user that DMA uses VIC bank info appTypes: info on how deskTop and debugger load applications memProtect: detailed spec of how debugger's loadSaveByte routine works cbmApps: info on how to use product to develop CBM applications hideMode: all about the new hide debugger screen feature interrupts: notes to user about interrupts nmi: notes on NMI interrupts, RESTORE bounce, etc rbootWarn: warning about rboot command, known problems viewCommand: how new view commands work environment: view commands- decisions made wishList: ideas... Not useful: 128ideas: general ideas on installing user's ISR trapping stray interrupts 40/80 column screen usage on 128 memory map registers, clock speed, keyboard InitIntSvc2.old: old ISR install info MINI: things nuked in MINI debugger to save space SPECS: outline for product specification assemInBasic: how to use geoLinker to create BASIC apps boot: old outline of debugger boot sequence designDecisions: decisions made along the way problems: unresolved problems in the design contextSwitch: info on how C64 / C128 interrupts work, and how debugger's context switch works with them warnings: problems in the design for which no solution exists screenDecisions: decisions made in design of V2 screen routines C128 InitForIO bug? On both the 64 and 128, the CIA2 chip has the capability of generating an NMI signal. To prevent this from occuring during disk-access routines, the GEOS InitForIO routine forces the CIA2 to generate one interrupt by setting the CIA timer value to a low number like 1. InitForIO knows that it will get control when this forced-NMI occurs because it swaps the kernal ROM into the high-memory area and sets the kernal's page 3 NMI vector (nmivec, $0318) to point to a dummy NMI routine. - on the C64, this works fine, except for the fact that InitForIO is trashing any NMI vector that the application writes to $0318. - on the C128, InitForIO does not swap ROM in correctly (it is changing location $0001). So when it forces this NMI to occur, the 6510 uses the vector at B1$FFFA or B0$FFFA, which normally point to the GEOS NMI handler routine, which simply does an RTI. If an application changes the GEOS NMI vectors at B0$FFFA and B1$FFFA, then the user's handler routine will get called every time InitForIO is called. The user's handler routine should poll the CIA chip and return immediately if the NMI was generated by the CIA. If the user is expecting NMIs from the CIA chip, then this "polling" process must also include an examination of the stack to see if InitForIO is in progress... Conclusion: Due to the fact that InitForIO makes some assumptions on the C128, users who write their own NMI handler routine will have trouble. Possible fixes: C64 and C128 InitForIO should both bring ROM in, and should both save the NMI vector at $0318 (bank 0 on the 128), and restore it later. This would make InitForIO work all the time (regardless of what the user has done to the vectors) and it would not affect the application's vectors. 1764/1700/1750 Ram Expansion Units ---------------------------------- 1764: 128K 2 64K banks, intended for C64 can be expanded to 512K 1st 64K bank: GEOS system stuff. 2nd bank unused. 1700: 256K 4 64K banks, intended for C128 can be expanded to 512K 1st 64K bank: GEOS system stuff. 2nd - 4th banks: 1541 RAM DISK or 1541 disk shadow. 1750: 512K 8 64K banks, intended for C128 can be made to work on C64 1st 64K bank: GEOS system stuff. 2nd bank unused. 2nd - 8th banks: 1541/1571 RAM DISK or 1541/1571 disk shadow. REU Bank #0: (1st bank) Bank #0 is reserved for GEOS kernal use. GEOS will, however, honor some enable bits in sysRAMFlg and its' shadow variable sysFlgCopy. By clearing some of these bits, you can prevent GEOS from using certain areas, and then your application can use StashRAM, FetchRAM, etc to stuff data up there. C128 64 GEOS 128 GEOS Control bit ----------------------- ----------------------- ------------- $0000 - $38FF MoveData swap area MoveData swap area 1XXXXXXX $3900 - $78FF MoveData swap area GEOS kernal for RBoot note 1 $7900 - $7DFF ToBasic code ToBasic code XX1XXXXX $7E00 - $82FF GEOS kernal for RBoot GEOS kernal for RBoot XX1XXXXX $8300 - $B8FF Device drivers A, B, C Device drivers A,B,C X1XXXXXX $B900 - $FC3F GEOS kernal for RBoot GEOS kernal for RBoot XX1XXXXX $FC40 - $FFFF ??? ??? ??? Note 1: different for 64/128. REU Banks 1 through 7: Used by device drivers for RAM DISK and shadowing. It is a real bad idea to touch these banks. ------------------------ REU DMA NOTES: disable sharing when using REU DMA relocation high byte: only B0 r/w capable, must write to low byte before can read info back from high byte (indicating relocation is active) Might be able to use this to decide whether or not NMI occurred while someone was stuffing values in these registers. ------------------------ Matt: I guess it is really only 1 bug, and it is not a bug if the user is using the standard GEOS screen for display, and is not trying to DMA data to backram (bank 0). There are a number of concerns when using the REU's DMA chip on a C128: 1) the clock must be slow (1MHZ, not 2MHZ) 128 GEOS handles this correctly. 2) the IO space must be in, so you can access the DMA chip (bit 0 of $ff00 "config" must be a 0) under 128 GEOS, the IO space is always in. 3) when the DMA chip forms an address for where in the C128's 128K to read and write, it ignores the standard bank 0 / bank 1 selection controls and the "bank sharing" controls. These controls I am talking about are bits 7 and 6 of $FF00 (config) and bits 5 through 0 of $D506 (RCR) in the IO space. The DMA chip knows which of the two 64K banks to use because it uses the same bank 0 / bank 1 control line that the VIC chip uses. This can be useful: no matter what bank setup you have for the 8510 processor chip, you can have the DMA chip read/write to anywhere in either bank. Now depending on which bank the VIC chip is looking at and which bank you want to R/W to, you may have to change the VIC chip bank # setting temporarily (will cause screen to flash). Code to do this: (assumes r0-r3L have already been set up for StashRAM) ;first, I assume IO space is in, because under ;128 GEOS, $FF00 = $7E, meaning IO is in. lda mmu+6 ;get "RamControlRegister" pha ;save current bank sharing ;status and VIC bank # info ;on stack and #%00111111 ;keep B5-B0 intact ora #BANK << 6 ;set Bit 6 according to bank we ;want VIC and DMA chips to see sta mmu+6 ;save new VIC bank # info jsr StashRAM/FetchRAM etc... ;call GEOS to turn on DMA chip pla ;restore VIC bank # sta mmu+6 Commodore 64/128 GEOS File types, and if the deskTop and/or geoDebugger can load them. CBM GEOS Open from type file type deskTop Description ---- --------------- ------- --------------------------------------- DEL anything no Deleted file SEQ NOT_GEOS no Commodore sequential datafile, probably generated by BASIC program. SEQ DATA no Same as above, with header added by Icon Editor. ---- --------------- ------- ------------------------------------------------ PRG NOT_GEOS yes *1 Commodore BASIC or assembly program. If the file is a BASIC program, then it was probably created using C64 or C128 BASIC's "SAVE" command. The deskTop can always load such a program, and in some cases can Turbo-load it. If the file is an assembly-language program, then it was probably created using an assembler utility, or using C128 BASIC's "BSAVE" command. PRG BASIC yes *2 Commodore BASIC program, with header block attached by Icon Editor. If program is less than 31K in size, the deskTop will have GEOS Turbo-load it. PRG ASSEMBLY yes *3 Commodore assembly program, with header block attached by Icon Editor. If program loads to application space ($400-$7FFF), then the deskTop will have GEOS Turbo-load it. ---- --------------- ------- ------------------------------------------------ USR NOT_GEOS no Old Commodore "user" file. USR BASIC no ILLEGAL COMBINATION USR ASSEMBLY no ILLEGAL COMBINATION USR DATA no ILLEGAL COMBINATION USR SYSTEM no GEOS system file (SEQ or VLIR structure) USR DESK_ACC yes GEOS desk accessory (SEQ structure) USR APPLICATION yes GEOS application file (SEQ or VLIR) USR APPL_DATA yes data file for a GEOS app. (SEQ or VLIR) USR FONT no GEOS font file (VLIR) USR PRINTER no GEOS printer driver (SEQ) USR INPUT_DEVICE no GEOS input device (mouse, koala, etc. SEQ) USR DISK_DEVICE no GEOS disk device driver USR SYSTEM_BOOT no GEOS system boot file (for GEOS, GEOS BOOT, GEOS KERNAL) USR TEMPORARY no Temporary file type, for swap files. USR AUTO_EXEC yes App (SEQ or VLIR) which loads and runs upon boot USR INPUT_128 no GEOS 128 Input driver ---- --------------- ------- ------------------------------------------------ REL NOT_GEOS no Commodore random-access datafile, as if generated by BASIC program. Cannot by given an icon by Icon Editor because would destory existing pointer to data chain. ---- --------------- ------- ------------------------------------------------ Notes: *1: (PRG, NOT_GEOS) When you try to open this type of program from the deskTop, the deskTop's "DoBasicLoad" routine will load the program's first data block, to check its load address. addr < $0400 Is a "stack-grabbing" assembly language program. GEOS cannot Turbo-load this, so we force BASIC to execute: LOAD "name",8,1. addr = $0801 ($1C01 on 128) Is a BASIC program. The deskTop will check the file size information in the directory entry to see if the program can be Turbo-loaded. If the BASIC program is <= 30480 bytes, the deskTop will have GEOS Turbo-load it, and then force BASIC to execute the RUN command. If the BASIC program is larger than this, the deskTop will not load it. addr = other The C64 deskTop will not allow you to load this application. This is so the deskTop will not attempt to run a C128 BASIC program under C64 BASIC. The C128 deskTop will use the BASIC "BOOT" command to load this file. If you attempt to open such a program from GeoDebugger, it must have a load address of $0400 or higher. GeoDebugger will not check the load address to see if the program is BASIC code, so you can use geoDebugger to examine the internal structure of C64 and C128 BASIC programs. *2: (PRG, BASIC) The deskTop will attempt to load such a file in the same manner as the "addr = $0801" case above. As noted above, the debugger can also load such a program file. *3: (PRG, ASSEMBLY) When you try to open this type of file from the deskTop, the deskTop's "DoAssemblyLoad" routine will load the file's first data block, to check its load address. addr < $0400 Is a "stack-grabbing" assembly language program. GEOS cannot Turbo-load this, so the deskTop forces BASIC to execute: LOAD "name",8,1. $0400 <= addr < $0800 The C64 deskTop will not allow you to load this program, but the C128 deskTop will. addr >= $0800 The deskTop will load the program's header block, to check its ending address. If the program ends below $8000, the deskTop will have GEOS Turbo-load the program. BASIC will then execute a SYS to the program's init address from the header block. If the program ends at or above $8000, the deskTop will force BASIC to execute: LOAD "name",8,1:SYS (init address) If you attempt to open such a program from GeoDebugger, it must have a load address of $0400 or higher. GeoDebugger will set the PC to the value of the init address which is stored in the header block. GeoDebugger will not check the ending address of the program. GeoDebugger Memory Read/Write Routine ------------------------------------- Whenever the debugger is asked to read or write a byte to memory, it works through the LoadByte/SaveByte routine in Monitor/c64io. Examples include: - examining and modifying memory using "A" or "M" open commands - setting and clearing instruction breakpoints - memory range commands: move, fill, diff, find These two routines are both very short: they simply set a flag indicating whether we are reading or writing, and then call LoadSaveByte. LoadSaveByte goes through a four step process to determine what to do with the memory access request. This is a complicated process because there are many cases where a direct load/save is out of the question: - the user is trying to modify a byte in zero page, but the monitor keeps the user's zero page in the monitor variable space - the user is trying to modify a byte in the application space, but it has been swapped out to the REU - the user is trying to write over monitor code - the user is trying to read/write to the other bank than is currently in during monitor execution. - the user is trying to modify CPU_DATA or config, which would immediately change the memory map and probably crash the debugger. LoadSaveByte's four step process can be broken down as: 1) Handle memory map controls at $0000, $0001, and $FF00 (128) as a special case. 2) If this access is in the IO space, and IO is enabled, use the IO ADDRESS TABLE to decide which IO locations he can modify directly and which ones we keep shadows for in the monitor variable area. 3) If this access is in a space where ROM is currently in, then only allow read operations. The debugger does not allow "bleed through" writes to ram underneath rom. 4) If none of the above cases hold, then the access must be to ram. Calculate the effective bank number (128 only), and use the RAM ADDRESS TABLE to decide which locations need re-direction or are illegal. Here is the key used in the lookup tables on the following pages: mini / super / back super M = mini debugger code area (illegal to read/write) S = super debugger code area (must read/write to REU space) B = backram super debugger code area (illegal to read/write) X = used by all three monitors, no copy saved (illegal to read/write) T = super debugger text screen area (COLOR_MATRIX: r/w to REU space) R = read only D = read/write directly Z = zero page ram which monitor uses (must read/write to saved copy of area) na = not applicable (for example, IO cannot show up at $0400) Step 1: check for overriding IO locations ----------------------------------------- Pseudo-code: C64Mode: $0000 direct, read only $0001 <--> appMemMap (memory map info) C128: $0000 direct, read only $0001 <- B2 and B1 -> appCPU_B21 (video control info) <- other bits -> appMemMap (non essential info) $FF00 <--> appConfig (memory map info) $FF01-$FF04 special case: is reading PCRA-PCRD or is sending one of those four to Config Step 2: check for IO space accesses ----------------------------------- IO ADDRESS TABLE C64 Mode....... C128 Mode.............. Memory range usage / GEOS equate IO IO ------------- ----------------------- ------- ------- ------- ------- ------- $0000 - $D010 ram / io: VIC regs D/D D/D/D $D011 * io: VIC grctrl1 appVIC1 appVIC1 $D012 - $D014 io: VIC regs D/D D/D/D $D015 * io: VIC mobenble appVIC2 appVIC2 $D016 * io: VIC grctrl2 appVIC3 appVIC3 $D017 io: VIC reg D/D D/D/D $D018 * io: VIC grmemptr appVIC4 appVIC4 $D019 - $D020 io: VIC regs D/D D/D/D $D021 * io: VIC bakclr0 appVIC5 appVIC5 $D022 - $D02F io: VIC regs D/D D/D/D $D030 * io: C128 2MHZ ctrl D/D appClk $D031 - $D4FF ram / io / rom D/D D/D/D $D500 * io: C128 MMU control D/D appConfg $D501 - $D504 io: C128 MMU regs D/D D/D/D $D505 * io: C128 MMU MCR D/D R/R/R $D506 * io: C128 MMU "RCR" D/D appRCR*1 $D507 - $D50A * io: C128 MMU ZP reloc D/D R/R/R $D50B - $D7FF ram / io / rom D/D D/D/D $D800 - $DBFF * io: text colors "ctab" R/R *2* $DC00 - $DCFF ram / io / rom D/D D/D/D $DD00 * io: cia2base (VIC mmap) appCIA2_B10 *3* appCIA2_B10 $DD01 - $DEFF ram / io / rom D/D D/D/D $DF00 - $DF09 * io: REU DMA control R/R R/R/R $DF0A - $EFFF ram / io / rom D/D D/D/D $F001 - $FFFF ram / rom D/D D/D/D ------------- ----------------------- ------- ------- ------- ------- ------- Conclusions: No differences between three debuggers- just between two machines. Only three possiblities: direct, read-only, or one of several special case routines. For each area, need byte in table which contains two three-bit codes, denoting what to do on that machine. Table size: 25 lines * (1 word + 1 byte) = 75 bytes Plus VIC handler routine (uses address to see which VIC registers we want, and then reads/writes to monitor shadow for that register. Plus handler routines for appClk, appConfig, appRCR, and appCIA2_B10. NOTE 1: in 128 mode, $D506 is split up between appRCR_B76 (VIC bank info) and appRCR_B50 (memory map info). NOTE 2: the text screen color table is located at $D800-$DBFF. In C64 mode, we only allow reads from this area, so the user won't screw up the monitor's text colors. In C128 mode, there are actually two color tables at this location. Bit 1 of $0001 determines which is visible to the 6510. If this bit is clear, we allow direct read/writes. If this bit is set, we only allow reads. NOTE 3: bits 1-0 of location $DD00 control which 16K memory bank the VIC chip uses, and so are saved in appCIA_B10. The other bits (7-2) are written to/ read from memory. Caution eric: in C64 mode, make sure IO is in when doing this. Pseudo-Code: if the address is between $D000 and $DFFF: C64: check location $0001. If (B1=1 or B0=1), then I/O space in. If B2=0, then 4K CHAR ROM is visible: only allow reads. If B2=1, then 4K of I/O devices are visible: call table lookup routine, using IO ADDRESS TABLE. use B5-B3 of return byte to decide what to do. else can read/write directly C128: check location $FF00: If (B0=0), then I/O space is in. call table lookup routine, using IO ADDRESS TABLE. use B2-B0 of return byte to decide what to do. else can read/write directly else (address is not in IO range) go to step 3 Step 3: check for ROM access ---------------------------- C64 Mode Rom Truth Table location $0001 Memory range What Might Be There 76543210 Notes ------------- ----------------------- --------------- ------------------------ $0000 - $9FFF ram -------- $A000 - $BFFF ram / Basic rom -------1 B0=1 $C000 - $DFFF ram *1* -------- $E000 - $FFFF ram / Kernal rom ------1- B1=1 Note that there are cases where cartridges plugged into the C64 can override these areas. The C64 Prog. Ref. Guide is not very clear on this, so I will not be concerned about cartridges for now. EDS 2/8/88. Note 1: the case where CHAR ROM is mapped in from $D000 to $DFFF has already been handled by IO table. C128 Mode Rom Truth Table location $FF00 Memory range What Might Be There 76543210 Notes ------------- ----------------------- --------------- ------------------------ $0000 - $3FFF ram -------- $4000 - $7FFF ram / Basic rom low ------0- B1=0 $8000 - $BFFF ram / Basic rom high ----ab-- B3=0 or B2=0 $C000 - $FFFF ram / Kernal rom --ab---- B5=0 or B4=0 I don't completely understand C128 external roms yet. I am going to assume that B5-B1 in $FF00 determine if there is any ROM in. I don't care if is Kernal, external, internal, or cartridge rom. I just won't write to those ranges if the bits are clear. Pseudo-code: As it turns out, the fastest and tightest code to handle this simply checks address ranges and bits directly. See the code. Step 4: RAM access ------------------ C64 Mode C128 Mode...... Memory range usage / GEOS equate RAM RAM B1 RAM B0 ------------- ----------------------- ------- ------- ------- $0000 - $0001 Already handled by step 1. $0002 - $00DD * zero page (mon swaps) Z/Z na Z/Z/Z $00DE - $00FF zero page D/D na D/D/D $0100 - SP * stack (monitor uses) X/X na X/X/X SP+1 - $01FF stack (user's data) D/D na D/D/D *1* $0200 - $0313 ram D/D D/D/D D/D/D $0314 - $0319 * basIRQVec, BRK, NMI R/R D/D/D R/R/R $031A - $0333 ram D/D D/D/D D/D/D $0334 - $03FB * monitor code X/X X/X/X X/X/X $03FC - $03FF monitor JSR area D/D D/D/D D/D/D $0400 - $1FFF * ram D/S D/S/D D/D/D $2000 - $3BFF * ram D/S D/S/D D/D/B $3C00 - $5FFF * ram M/S M/S/D D/D/B $6000 - $78FF * ram D/S D/S/D D/D/B $7900 - $8BFF * ram D/D D/D/D D/D/B $8C00 - $8FE7 * ram (monitor text scr) R/T R/T/D D/D/B $8FE8 - $9FFF * ram D/D D/D/D D/D/B $A000 - $FFF9 ram / rom if >$D000 D/D D/D/D D/D/D $FFFA - $FFFF * NMI_VECTOR, RESET, IRQ R/R R/R/R R/R/R ------------- ----------------------- ------- ------- ------- ------- ------- Conclusions: Mini debugger and Super debuggers are completely different cases. Use conditional assembly to decide which table to use. Mini debugger has four possibilities: direct, read-only, illegal, and zero page. For each area, need byte in table which contains two three-bit codes, denoting what to do on that machine. Table size: 15 lines * (1 word + 1 byte) = 45 bytes All table values are standard cases. The super debugger's table is similar: for each area, there are six possibilities, all standard. The table needs to give us a word value which contains five three-bit codes: machine monitor access type bits in word --------------- --------------- --------------- ------------ 128 mode backram super bank 0 access B14-B12 128 mode backram super bank 1 access B11-B9 128 mode REU super bank 0 access B8-B6 128 mode REU super bank 0 access B2-B0 64 mode REU super B5-B3 --------------- --------------- --------------- ------------ Table size: 18 lines * (1 word + 2 bytes) = 76 bytes All table values are standard cases. NOTE 1: the region SP+1 to $313 can be combined, because the effective bank calculation will not give an address <$200 in bank 1. Pseudo-code: first calculate effective bank (only necessary on C-128) if address is less than $200, is Bank 0. if appConfig B6 = 1 then (NOTE: ignore B7) (bank 1 is enabled, but we must check ram sharing) if address high byte >= $80 if appRCR B3 = 1 use lookup table for appRCR B1-B0: 00 $FC 01 $F0 10 $E0 11 $C0 if address high byte < this value, is bank 1 else is bank 0 else is bank 1 else (address high byte < $80) if appRCR B2 = 1 use lookup table for appRCR B1-B0: 00 $04 01 $10 10 $20 11 $40 if address high byte >= this value, is bank 1 else is bank 0 else is bank 1 else is bank 0 THESE BIT NUMBERS HAVE CHANGED Then use table to determine what to do with that address, considering the machine, monitor type, and bank desired. if using mini debugger call table lookup routine, using MINI RAM ADDRESS TABLE if in C64 mode: use B5-B3 of return byte to decide what to do. else (C128 mode): use B2-B0 of return byte to decide what to do. if using super debugger: call table lookup routine, using MINI RAM ADDRESS TABLE if in C64 mode: use B5-B3 of return byte to decide what to do. else (C128 mode): if super debugger if accessing bank 1 use B2-B0 of return word if accessing bank 0 use B8-B6 of return word if backram super debugger if accessing bank 1 use B11-B9 of return word if accessing bank 0 use B14-B12 of return word This decision tree seems fairly complicated, but it breaks down pretty well in the code. General Memory Protect Map -------------------------- C64 Mode....... C128 Mode.............. Memory range usage / GEOS equate RAM IO RAM B1 RAM B0 IO ------------- ----------------------- ------- ------- ------- ------- ------- $0000 * CPU_DDR 6510 DDR all cases: R/R all cases: R/R $0001 * CPU_DATA 6510 data port <-> appMemMap <-> appCPU_B21+appMemMap $0002 - $00DD * zero page (mon swaps) Z/Z na na Z/Z/Z na $00DE - $00FF zero page D/D na na D/D/D na $0100 - SP * stack (monitor uses) X/X na na X/X/X na SP+1 - $01FF stack (user's data) D/D na na D/D/D na $0200 - $0313 ram D/D na D/D/D D/D/D na $0314 - $0319 * basIRQVec, BRK, NMI R/R na D/D/D R/R/R na $031A - $0333 ram D/D na D/D/D D/D/D na $0334 - $03FB * monitor code X/X na X/X/X X/X/X na $03FC - $03FF monitor JSR area D/D na D/D/D D/D/D na $0400 - $1FFF * ram D/S na D/S/D D/D/D na $2000 - $3BFF * ram D/S na D/S/D D/D/B na $3C00 - $3FFF * ram M/S na M/S/D D/D/B na $4000 - $5FFF * ram (BG screen) M/S na M/S/D D/D/B na $6000 - $78FF * ram D/S na D/S/D D/D/B na $7900 - $8BFF * ram D/D na D/D/D D/D/B na $8C00 - $8FE7 * COLOR_MATRIX / ram D/D na D/D/D D/D/B na $8FE8 - $8FFF * ram D/D na D/D/D D/D/B na $9000 - $9FFF * ram D/D na D/D/D D/D/B na $A000 - $BFFF ram (FG screen) D/D na D/D/D D/D/D na $C000 - $CFFF ram D/D na D/D/D D/D/D na $D000 - $D010 io: VIC regs D/D D/D D/D/D D/D/D D/D/D $D011 * io: VIC grctrl1 D/D appVIC1 D/D/D D/D/D appVIC1 $D012 - $D014 io: VIC regs D/D D/D D/D/D D/D/D D/D/D $D015 * io: VIC mobenble D/D appVIC2 D/D/D D/D/D appVIC2 $D016 * io: VIC grctrl2 D/D appVIC3 D/D/D D/D/D appVIC3 $D017 io: VIC reg D/D D/D D/D/D D/D/D D/D/D $D018 * io: VIC grmemptr D/D appVIC4 D/D/D D/D/D appVIC4 $D019 - $D020 io: VIC regs D/D D/D D/D/D D/D/D D/D/D $D021 * io: VIC bakclr0 D/D appVIC5 D/D/D D/D/D appVIC5 $D022 - $D02F io: VIC regs D/D D/D D/D/D D/D/D D/D/D $D030 * io: C128 2MHZ ctrl D/D D/D D/D/D D/D/D appClk $D031 - $D4FF ram / io / rom D/D D/D D/D/D D/D/D D/D/D $D500 * io: C128 MMU control D/D D/D D/D/D D/D/D appConfg $D501 - $D504 io: C128 MMU regs D/D D/D D/D/D D/D/D D/D/D $D505 * io: C128 MMU MCR D/D D/D D/D/D D/D/D R/R/R $D506 * io: C128 MMU "RCR" D/D D/D D/D/D D/D/D appRCR*1 $D507 - $D50A * io: C128 MMU ZP reloc D/D D/D D/D/D D/D/D R/R/R $D50B - $D7FF ram / io / rom D/D D/D D/D/D D/D/D D/D/D $D800 - $DBFF * io: text colors "ctab" D/D R/R D/D/D D/D/D *2* $DC00 - $DCFF ram / io / rom D/D D/D D/D/D D/D/D D/D/D $DD00 * io: cia2base (VIC mmap) D/D appCIA2_B10 D/D/D D/D/D *3* $DD01 - $DEFF ram / io / rom D/D D/D D/D/D D/D/D D/D/D $DF00 - $DF09 * io: REU DMA control D/D R/R D/D/D D/D/D R/R/R $DF0A - $DFFF ram / io / rom D/D D/D D/D/D D/D/D D/D/D $E000 - $EFFF ram / rom D/D na D/D/D D/D/D na $F000 * C128: config register D/D na all cases: <-> appConfig $F001 - $FFF9 ram / rom D/D na D/D/D D/D/D na $FFFA - $FFFF * NMI_VECTOR, RESET, IRQ R/R na R/R/R R/R/R na ------------- ----------------------- ------- ------- ------- ------- ------- Assumptions: ROM decoded separately address decode for ram bank sharing already worked out can simplify table a bit with .if MINI NOTE 1: in 128 mode, $D506 is split up between appRCR_B76 (VIC bank info) and appRCR_B50 (memory map info). NOTE 2: the text screen color table is located at $D800-$DBFF. In C64 mode, we only allow reads from this area, so the user won't screw up the monitor's text colors. In C128 mode, there are actually two color tables at this location. Bit 1 of $0001 determines which is visible to the 6510. If this bit is clear, we allow direct read/writes. If this bit is set, we only allow reads. NOTE 3: bits 1-0 of location $DD00 control which 16K memory bank the VIC chip uses, and so are saved in appCIA_B10. The other bits (7-2) are written to/ read from memory. Caution eric: in C64 mode, make sure IO is in when doing this. Warn in manual that we do not allow bleed-through. They will have to swap ram in manually to change it. This means we can't use a single MOVE command to copy rom to ram... GeoDebugger has limited support for the creation and debugging of CBM applications. The C128 deskTop has some bugs related to loading CBM applications. GeoProgrammer currently supports the assembly and link of: GEOS applications (SEQ or VLIR, with header) GEOS desk accessories (SEQ by definition, with header) CBM applications standard Commodore PRG file (GEOS file type = NOT_GEOS, does not have a header block). DeskTop has restrictions on which load addresses it can handle. Commodore BASIC's LOAD and BOOT commands can load most addresses ok. GeoDebugger can load most addresses ok. There is some amount of support in the debugger for loading and debugging CBM applications. - can toggle between any kind of screen the VIC and VDC chips support - app can trash all of GEOS address space Problems: - on C128, debugger can only load a CBM app to bank 1, whereas BASIC expects such an application to run in bank 0. Either write your application to run in either bank (see SampleCBM), or use a constant so you can assemble it to run in either bank. - The debugger does not do any error checking on the load address of a CBM application. It will crash if you try to load an app below $400. Application cannot load above the $8000 area. - GeoDebugger fills the text color table once. If the CBM application fills the text color table (table #1 on the 128), the debugger's characters will be colored. If the CBM app fills with $0B, the debugger characters will be invisible, since the debugger sets the background to $0B. - if the CBM app puts up a screen which resides in the $0400-$7FFF area, then you will not be able to view it from the super debugger using F7 or F8. This is because these commands do not swap the debugger code out of this area: the VIC chip will be given the correct parameters, but it will be displaying debugger code instead of the application's screen data. With a little bit of work, you can get geoAssembler and geoLinker to generate: Assembly-In-Basic program A (PRG-NOT_GEOS) application which looks like a BASIC program, but really only has several lines of BASIC. Remainder is assembly code. SEQ datafile: as if was created by BASIC. Create a GEOS SEQ file, then change the Commodore and GEOS file type bytes. GEOS application datafile: as if was created by a GEOS application. Create a GEOS SEQ file, then change the GEOS file type byte. In a similar manner, you can use GeoDebugger to examine a wide variety of different file types. But first, you must change the Commodore and/or GEOS file type byte, and the load address in the header block. Future GeoProgrammer ideas: Generate CBM Application with header: Essentially a CBM assembly-language program, but with a GEOS header. Would save the Icon Editor step currently required. Specification of "hide debug screen mode" F7 is pressed: TOGGLE SCREEN: show USER screen wait for press show DEBUG screen if MINI: place cursor on left print prompt print input line as it was loop for next character F8 is pressed: if hidden = FALSE ENABLE SHOW MODE: call ToggleScreen to switch user parameters to hardware set hideDebugScreen = TRUE loop for next character if hidden = TRUE DISABLE SHOW MODE: set hideDebugScreen = FALSE call ToggleScreen to switch user parameters to shadows, and display debugger screen if in left-side command mode (must reprint line because nothing has been printed) place cursor on left print prompt print input line as it was if not in left-side command mode cancel open mode / deposit mode print prompt loop for next character How GeoDebugger Handles IRQ Interrupts -------------------------------------- If you are writing a normal GEOS application, then you do not have to read the following information. You can skip ahead to the section titled "Stray Interrupt "TRAP" Facility". If you are writing a non-GEOS application which sets up its own interrupt service routine, this information is vital; your program will not run correctly under GeoDebugger unless you follow these instructions. Note: ISR stands for Interrupt Service Routine. When GeoDebugger is running a user application, it inserts a small wedge routine in place of the normal ISR (which in most cases will be the GEOS ISR). This wedge first checks if the IRQ interrupt was generated by the IRQ line or a BRK instruction. If it was a BRK instruction, the wedge executes the appropriate monitor. If the interrupt was an IRQ, the wedge calls the existing ISR. Thus: the debugger is able to monitor the IRQ/BRK events, without interfering with regular interrupt servicing that is vital to most applications. To insert this wedge routine into the interrupt sequence, GeoDebugger must first examine the IRQ vector at location $FFFE, to see where the current ISR is located. It then must modify this vector so it will point to the GeoDebugger wedge routine which is located in the $0334 area. If you are writing a non-GEOS application which sets up its own ISR, then you will probably we setting the IRQ vector at some point during your initialization code. In order for your application to run under GeoDebugger, you must set this vector carefully; because if your application is running under GeoDebugger, you need to store the address of your ISR to a vector in the GeoDebugger wedge code, NOT to the IRQ vector. Below is a routine which you can insert into your program to set up the appropriate vector to your ISR. Note that this routine assumes that your application will only allow interrupts when the memory map is configured as a standard GEOS memory map. On the C64, this means all RAM, and on the C128, this means all bank 1 RAM, no ROM. If your application is going to allow interrupts in other memory map configurations, use the "Interrupt Handling Reference Notes" section of this document to customize this installation routine. Insert the following constants and subroutine into the initialization phase of your application, for it to run properly under GeoDebugger. In the constant definition portion of your program: DEVELOPMENT = TRUE ;Set to TRUE if you sometimes run this ;application under GeoDebugger V2.0, ;and run it under the deskTop other times. ;Set to FALSE if you will never run this ;application under GeoDebugger V2.0. ToIntSvc = $0367 ;Address of GeoDebugger vector we modify In the initialization portion of your program: ;************************************************************************* ; InitIntSvc ; ; This routine modifies the IRQ vector, so that the user's interrupt ; service routine is called instead of the GEOS interrupt service routine. ; This routine can assemble one of two ways, depending upon the ; value of the constant called "DEVELOPMENT". ; ; Assumptions: ; 1) That the standard GEOS memory map is present when this routine runs. ; 2) That your application does not do anything weird such as allowing ; interrupts when high-memory ROM or RAM bank 0 (on the C128) is ; swapped in. ; ; Side-effects: ; 1) If the following scenario applies: ; - you are writing a non-GEOS application for the C64 ; - which tries to disable interrupts when ROM is in ; - you run it under GeoDebugger ; - your program swaps Kernal ROM in, without properly ; disabling interrupts ; - an interrupt occurs ; ...then GeoDebugger WILL properly run your ISR, without giving ; you any warning that there is a bug in your program, and that it ; would have crashed if it was not run under GeoDebugger. ; ; Author: Eric E. Del Sesto April 1988 ; Called by: initialization code ; Pass: nothing ; Returns: nothing ; Alters: accumulator and flags ; ;************************************************************************ InitIntSvc: sei ;disable interrupts .if DEVELOPMENT ;------------------------------------------------ ;Assemble the following code when you want your application to run correctly ;under GeoDebugger V2.0. lda IRQ_VECTOR+1 ;check high byte of existing IRQ vector ;to see if we are running under debug. bmi 50$ ;skip if not... ;we are running under GeoDebugger: must store our IRQ vector to ;the GeoDebugger code in the $0334 area. If running in C128 mode, ;this only modifies the wedge code in bank 1, which is sufficient. LoadW ToIntSvc,#MyIntSvc cli ;enable interrupts rts ;all done 50$: ;we are not running under GeoDebugger: set up new IRQ vector ;in normal fashion. .endif ;(DEVELOPMENT)--------------------------------------------------- ;At this point, we know that either the application is not running under ;GeoDebugger, or that we don't expect it to run under GeoDebugger (the case ;where DEVELOPMENT = FALSE). Interrupts have already been disabled above. ;Set up the IRQ vector at $FFFE to point to new service routine. Note that ;in C128 mode, this only affects the IRQ vector in bank 1 RAM. LoadW IRQ_VECTOR,#MyIntSvc cli ;enable interrupts rts ;all done Stray Interrupt "TRAP" Facility ------------------------------- You would expect that an application which often has to swap in the Kernal ROM would be careful to disable interrupts during these operations. This is to prevent the case where an IRQ occurs and GEOS interrupt code has been swapped out of the memory map. Often, it is easy for such a provision to be left out in the initial implementation of a program. To catch these hard-to-find bugs, GeoDebugger has a "stray IRQ trap" facility. This facility serves to warn you when an interrupt happens and the memory map is configured in a manner you did not expect. If you are running a GEOS application (with normal GEOS interrupts), then this facility will stop program execution and display the "*** Execution stopped ***" message when an IRQ occurs and the Kernal ROM is swapped in. You can examine the PC register to see which of your routines was executing when the IRQ occurred, and can add interrupt-disabling code where necessary. If you are writing a non-GEOS application which runs on the C128, and sets up its own interrupt service routine, you will probably design it so interrupts are enabled only when the memory if configured in a specific way. Here are several examples of assertions you might find in such an application: - "I will only allow interrupts when bank 1 RAM is mapped in." - "I will only allow interrupts when bank 0 RAM or ROM is mapped in." By refering to the "Interrupt Handling Reference Notes" section of this document, and adding some code to the initialization portion of your program, you can alter the wedge code so that a TRAP is produced if an interrupt occurs when the memory map is in an unexpected configuration. (Is it possible to continue program execution at this point???) Interrupt Handling Reference Notes If you are writing a non-GEOS application, the following tables provide useful reference information about the vectors in GeoDebugger's wedge code. By adding code to your application which changes these vectors, you can get your interrupt service routine to work when your application is running under GeoDebugger. You can also set these vectors so that a TRAP occurs if an interrupt happens when the memory map is such that your application would crash. C64 Mode -------- Label Addr Normal Contents Modified Contents --------------- ------- ------------------------------- ------------------------ RomIRQ_Vec: $0338 jmp TrapROM 4C 45 03 jmp HandleIRQ 4C 5E 03 - as it stands, this location will cause a TRAP whenever an IRQ happens and the Kernal ROM is mapped into high memory. Modify this location if you want execution to continue to the ToIntSvc vector when ROM is mapped into high memory. The ToIntSvc vector can then direct execution to your ISR. ToIntSvc: $XXXX jmp GeosISR 4C xx xx jmp Your_ISR 4C LL HH -or- jmp TrapIRQ 4C XX XX - as it stands, this location directs execution to the GEOS ISR when an interrupt occurs. You can modify this vector to point to your own ISR, or force a TRAP when an IRQ occurs. Note that if RomIRQ_Vec points to HandleIRQ, then the ToIntSvc vector handles all IRQ interrupts, regardless of whether RAM or ROM is in. C128 Mode --------- Label Addr Normal Contents Modified Contents --------------- ------- ------------------------------- ------------------------ (in bank 0) RomIRQ_Vec: B0$XXXX jmp TrapROM 4C XX XX jmp HandleIRQ 4C XX XX - as it stands, this location will cause a TRAP whenever an IRQ happens and the Kernal ROM is mapped into high memory. Modify this location in bank 0 RAM if you want execution to continue to the ToIntSvc vector when ROM is mapped into high memory. The ToIntSvc vector can then direct execution to your ISR. (in bank 0) ToIntSvc: B0$XXXX jmp GeosISR 4C xx xx jmp Your_ISR 4C LL HH -or- jmp TrapIRQ 4C XX XX - as it stands, this location directs execution to the GEOS ISR when an interrupt occurs AND bank 0 is visible in the $0300 area. You can modify this vector to point to your own ISR, or force a TRAP when such an IRQ occurs. Note that if RomIRQ_Vec points to HandleIRQ, then this bank 0 ToIntSvc vector will additionally handle IRQ interrupts which occur when ROM is mapped into high memory. (in bank 1) ToIntSvc: B1$XXXX jmp GeosISR 4C xx xx jmp Your_ISR 4C LL HH -or- jmp TrapIRQ 4C XX XX - as it stands, this location directs execution to the GEOS ISR when an interrupt occurs AND bank 1 is visible in the $0300 area. You can modify this vector to point to your own ISR, or force a TRAP when such an IRQ occurs. NMI (Restore key) Interrupts When GeoDebugger is executing user code, we set up the NMI vectors so that the RESTORE key can stop execution at any point and bring us into the monitor. Note that this involves three NMI vectors: B1$FFFA, B0$FFFA, and B0$318 for NMIs which occur when ROM is mapped into the $fffa area. When the monitor is running, we set up the current bank's $FFFA NMI vector so that the user can hit the RESTORE key to quit any operation. This is implemented as "set-flag and poll-flag-and-stop when you can" so that crucial operations (such as inserting a symbol) are not interrupted. To simplify matters, we disable NMI interrupts during context switching (starting or stopping an application). This is accomplished by modifying the wedge code slightly so that if an NMI occurs when we don't want it to, the wedge code immediately returns. In both C64 and C128 modes, there is only one location in the wedge code which must be modified. (This is true on the 128 because no matter which entry point is used to get into the wedge code: RamNMI_B0, RamNMI_B1, or RomNMI_B0, execution ends up at the point labeled SkipToReturn in the wedge code in bank 1. Therefore we only need to alter the wedge code at that point, and not in both banks.) Notes: 1) V1.0 GeoDebugger used to disable NMI interrupts during calls to GEOS interrupt code. The motivation for this is the idea that when the user hits the RESTORE key, he does not want to stop execution in the middle of GEOS interrupt code. V2.0 GeoDebugger does not do this anymore because we do not want to lock-out the RESTORE key while the user's interrupt service routine is running. And besides, what is the stopmain command for anyway? 2) concerning NMI bounce: - when the RESTORE key is pressed, two NMI signals area generated, about 150usec apart. 3) Concerning preventing NMIs which immediately follow a BRK instruction: - we handle this correctly 4) On both the 64 and 128, the CIA2 chip has the capability of generating an NMI signal. To prevent this from occuring during disk-access routines, the GEOS InitForIO routine forces the CIA2 to generate one interrupt by setting the timer value to a low number like 1. InitForIO knows that it will get control when this forced-NMI occurs because it swaps the kernal ROM into the high- memory area and sets the kernal's page 3 NMI vector (nmivec, $0318) to point to a dummy NMI routine. - on the C64, this works fine, except for the fact that GeoDebugger's vector at $0318 gets trashed by InitForIO. - on the C128, InitForIO does not swap ROM in correctly (it is changing location $0001). So when it forces this NMI to occur, the 6510 uses the vector at B1$FFFA or B0$FFFA, and we end up in the debugger. To solve this particular problem, I have added code to V2.0 to poll the CIA2 chip after an NMI occurs to see if it was the RESTORE key or the CIA2 chip. If it was the CIA2 chip, GeoDebugger quickly returns to the application. Handling NMIs from the CIA chip in this manner is a good idea in general, on both the C64 and the C128. It allows the user to write programs which use the CIA2's NMI capability without worrying about the debugger getting confused. But note that the user's application will not run as expected: anytime the CIA2 generates an NMI, the debugger will get control, poll the CIA2 to see that it is responsible, and will return to the application. The application will have no way of knowing that an NMI occurred, since not only did we steal the NMI interrupt, we also cleared the CIA2 interrupt status register just by polling it. That's life in the big city! ;************************************************************************* ; DoRboot ; ; This command does what the "RBOOT" ice macro does: it pulls the entire ; GEOS kernal in from REU bank #0. ; ; Talked to Doug 6/6/88: ; If the current drive is a RAM DISK when this command is invoked, ; the deskTop will come up ok. The drive which is selected will depend ; upon a copy of curDrive which is stored in the REU. (You can change ; this copy using SelectPrinter from the deskTop.) ; ; If the current drive is not a RAM DISK when this command is invoked, ; then the deskTop will not come back until the physical drive is ; turned off and back on again. ; ; The only way to improve this would be for the debugger to call ; ExitTurbo to let go of the physical drive. But since we are not ; sure the ExitTurbo code is still in memory, that is a bad idea. ; We can't close the ExitTurbo code, because it is different for ; every different disk type. ; We maintain two separate memory pointers: PC (actual program counter), and LC (address for open commands). Each pointer includes address and memory environment information. New commands: SUPER MINI usage --------------- --------------- ----------------------------------------------- initview -- copy PC addr and bank info to LC setview sv set LC's bank info view vw display current PC and LC address and bank info useview uv change PC's bank info to what is in LC b1 b1 same as view ($7E,$00) b0 b0 same as view ($3E,$00) --------------- --------------- ----------------------------------------------- setview, view, and useview are primitives possible usages: viewing other banks and proceeding from old PC and bank: address bank info --------------- ------------------- a address LC = address setview xx,xx LCb = new bank info a address, etc... LC = anything LCb = anything go uses PC address and bank info setting a new PC and bank: address bank info --------------- ------------------- view xx,xx LCb = new bank info pc address PC = new addr PCb = LCb - or - pc address PC = new addr view xx,xx LCb = new bank info useview PCb = LCb changing PC's bank info without changing PC address address bank info --------------- ------------------- view xx,xx LCb = new bank info useview PCb = LCb changing PC address without changing bank info: address bank info --------------- ------------------- pc LC = PC LCb = PC (only required if have changed LC since RESTORE key) pc new address PC = new PCb = LC Possibility for future VIEW command: when invoked without arguments, diplays: - SPLIT INTO PC AND LC COLUMNS - Address Range Ram Bank Visible Override ------------- ---------------- -------- $FC00 - $FFFF 1 ROM $F800 - $FBFF 1 ROM $F000 - $F7FF 1 ROM $E000 - $EFFF 1 ROM $D000 - $DFFF 1 I/O $C000 - $CFFF 1 $B000 - $BFFF 1 $A000 - $AFFF 1 $9000 - $9FFF 1 $8000 - $8FFF 1 $7000 - $7FFF 1 $6000 - $6FFF 1 $5000 - $5FFF 1 $4000 - $4FFF 1 $3000 - $3FFF 1 $2000 - $2FFF 1 $1000 - $1FFF 1 $0800 - $0FFF 1 $0400 - $07FF 0 $0000 - $03FF 0 use print hex word routine, adding $0fff to get right side start increment at $0400, offset at $03FF once get to $1000, inc = $1000, offset = $0FFF How GeoDebugger manages machine-dependent memory-map environment information The debugger carries memory-map environment information, which is machine- dependent, around in generic variables such as appBankInfo1 and appBankInfo2. This way, the routines which just move this information around (but don't directly use it) are machine-independent. Execution Environment: When the debugger stops execution of an application (RESTORE pressed or SBP hit), the user's "execution environment" is saved. This includes: processor register and flag values PC address current bank information zero page variables stack information We call the PC address and its memory-map information the "Execution Environment" or more simply, the "PC pointer". Viewing Environment: Once the debugger has stopped an application, the "viewing environment" is the same as the "execution environment". This means that all of the memory examination and modification commands use the same memory-map information as the Execution Environment. Through use of the SETVIEW command, the viewing environment can be changed. You can set up a new memory-map configuration, and then use the memory examination and modification commands to read/write memory in this new configuration. When you give the GO command to resume execution, the debugger restores the execution enviroment, and your program continues execution. We call the viewing address and its environment the "LC pointer". ------------------------------------------------------------------------------- Aspects of GeoDebugger which must change according to machine-dependencies in V2.0, to remain compatible with V1.0. (Kill these in V3.0.) Register command: displays PC address, highlights address if effective address of PC (considering PC bank info) is bank 0. displays CPU_DATA value (It really should not do this anymore, but I am trying to maintain compatability with V1. 64: read directly from appBankInfo1 128: [7-3,0]: direct read from memory [21]: shadow with appCPU_B21 Register Open Command: ..includes MM register: is CPU_DATA. (To be compatible with V1) 64: directly read/write to appBankInfo1 128: [7-3,0]: directly R/W to memory [21]: shadow with appCPU_B21 ------------------------------------------------------------------------------- Aspects of GeoDebugger which are machine-independent. Memory examination and modification: bank command: affects LC's bank info: curBankInfo1 and curBankInfo2 open modes: uses LC's bank info highlights address if is in physical bank 0 dump command: uses LC's bank info highlights address if is in physical bank 0 move/fill/diff/find: uses LC's bank info highlights address if is in physical bank 0 @ and @@ operators: uses LC's bank info Single and Top-step breakpoints: maintain their own bank information (copied from PC bank info before execution begun) Software Breakpoints: maintain their own bank information (copied from PC bank info before execution begun) PC command: without argument: copy PC address and bank info to LC (restores execution environment) with argument: (same as setting PC in open mode) set PC address = argument set PC bank info = LC bank info Would be nice: V3.0: make REU super monitor have option to use 32K backram for symbol table... Would be cool if debugger could checksum ram expansion to see if is already up there (so could assem, link, debug, assem, link, debug really quickly when geoDebug is on disk, and not on ramdisk). Why not wait till just after interrupt code runs to disable interrupts before going to user's code? Would flicker a bit less. Warn user if when we break his SP is so low that monitor code will wrap it around... If NMI could realize what it interrupted and could make repairs so a GO would not crash us. If the top-step command could recognize calls to most of the GEOS inline routines and stop and warn the user what is about to happen. Begin and End structures in macros. If and for macros could skip to next "end". Might even add counter so could be several levels deep. Clean up entire s/t/p/go conditioned/leap-frogged structure Clean up entire open mode thing Clean up move/diff/fill/find Add intelligence to parse macro so that if args are there but not expected, generates error. allow macro defs which are bigger than size of input buffer? (especially when loading from file.)