AS09 Assembler for M6809/H6309 [1.11]. Page 1 --------------------------------- CSAVEM.ASM --------------------------------- 244 lines read, no errors in pass 1. ****************************************************** * CSAVEM * Save binary data in memory to tape as a machine * language program. * * This program is relocatable, except that it assumes * its data buffer to start at $4000, and its end-buffe * pointer to be at $3100 and $3101, as per COMM4. Not * that this end-buffer pointer points one byte past th * last byte to be saved; it does not point at the last * byte itself. * * By default (entry point=$3000), the data to save is * found at address $4000; it is saved with that as the * load address so it will load back into the same plac * and that same address is used as its starting execut * address. The last byte saved is determined by the * end-buffer pointer as described above. * * The alternative (entry point=$3002) is that each of * these addresses is specified individually. The * address of the data to save is found at address $310 * the address that it should load into later is at $31 * and the address at which to start execution is at * $3106. The last byte saved is determined by the * end-buffer pointer as described above. * * Because the program does not map out the BASIC ROMs * get at the RAM underneath, it is normally limited to * binaries of up to 16K ($4000 - $7FFF). Almost 20K * could be saved by calling the alternate entry point * with a starting data address of, say, $3110, and an * ending address of $7FFF. * * Finally, there is a special entry point at 'instal' * which will use this program to save itself in such a * way that it will later load and run at address $3000 * That instal routine omits itself in the saved data, * so it can only be used once, when it is still sittin * in memory from when the program was downloaded. * * 5-Sep-99 815pm WJY - initial vertion from CSAVEB 0.0 * 7-Sep-99 250am WJY - fix ACTIND, * bypass as09 optimization lbra b * 12-Sep-99 140am WJY - drop block copy, block count, * mapping-in of upper 32K RAM, * activity indicator * 16-Sep-99 315pm WJY - fixed some non-relocatable cod ****************************************************** noopt include "coco.asm" nolist * COMM4 leftover data 4000 = buffer equ $4000 ; buffer of ASCII data 3100 = last equ $3100 ; last address filled + 1 AS09 Assembler for M6809/H6309 [1.11]. Page 2 --------------------------------- CSAVEM.ASM --------------------------------- * Data needed with the special entry point ($3002). * These are considered as external to the program, * so references to them should not be relative. 3102 = spdata equ $3102 ; address of the data to save 3104 = spload equ $3104 ; load address 3106 = spexec equ $3106 ; exec address 3000 = org $3000 3000 : 2012 start bra normal 3002 : 201c start2 bra specl 3004 : 9909161515 fcb $99,$09,$16,$15,$15 ; revision date & time 3009 : 43534156454d20.. fcc "CSAVEM V0.4" 3014 : 8e4000 normal ldx #buffer ; default addresses == buffer 3017 : bf3102 stx spdata 301a : bf3104 stx spload 301d : bf3106 stx spexec 3020 : 1a50 specl orcc #IRQ|FIRQ ; disable interrupts * write the name block 3022 : be3104 ldx spload ; fill in data 3025 : af8c66 stx