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

Barry Nelson barry.nelson at amobiledevice.com
Fri Jan 15 04:35:56 EST 2016


I understand the MC10 lacks a CSAVEM command. I have not tested this yet, but it should work. I based it off a source code listing of a ML extension for BASIC that did the same thing.

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


More information about the Coco mailing list