[Coco] BASIC program for an MC10 to do a CSAVEM

Barry Nelson barry.nelson at amobiledevice.com
Fri Jan 15 10:27:41 EST 2016


I just tested this listing, there were a few errors, this is the corrected version, which seems to work. This program will "CSAVEM" a machine language program residing at the specified address.

9010 CLS:REM Routine to do a CSAVEM, add to the end of a program that pokes in ML code
9020 INPUT "START ADDRESS: ";SADD:REM ML start address, where it is now
9030 INPUT "END ADDRESS: ";EADD:EADD=EADD+1:REM ML end address, where it is now
9040 INPUT "LOAD ADDRESS: ";LADD:IF LADD<=0 THEN LADD=SADD:REM ML load address when loaded
9050 SH=INT(SADD/256):REM Start high byte
9060 SL=SADD-SH*256:REM Start low byte
9070 EH=INT(EADD/256):REM End high byte
9080 EL=EADD-EH*256:REM End low byte
9090 LH=INT(LADD/256):REM Load high byte
9100 LL=LADD-LH*256:REM Load low byte
9110 INPUT "NAME, MAX 8 CHARS: ";NM$:NM$=LEFT$(NM$,8):EXEC(64819)NM$
9120 POKE 16999,2:REM Set file type to machine code
9130 POKE 17002,SH:REM Set high byte of ML start
9140 POKE 17003,SL:REM Set low byte of ML start
9150 POKE 17004,LH:REM Set high byte of load address
9160 POKE 17005,LL:REM Set low byte of load address
9170 POKE 17007,SH:REM Set high byte of data start, same as ML start
9180 POKE 17008,SL:REM Set low byte of data start, same as ML start
9190 POKE 17009,EH:REM Set high byte of data end
9200 POKE 17010,EL:REM Set low byte of data end
9210 EXEC 64654:REM Save file name block
9220 EXEC 64605:REM Save the data


More information about the Coco mailing list