Atari Tape Tribulation
I recently got an Assembler Editor cartridge for my Atari 800. I tried out the example programs in the manual and followed Atari's instructions on entering source code and assembling to cassette using ASM,,#C:. After replacing the Assembler Editor cartridge with BASIC, I was not able to retrieve the machine language program with CLOAD as specified. I tried several things such as ENTER#C:, but nothing worked. When I did PRINT PEEK(1536), I always got 0. Any suggestions? My temporary alternative is to convert the hexadecimal object code from the ML program into decimal DATA statements using a BASIC program.
The manual is incorrect. You cannot use CLOAD, ENTER, or any simple Atari BASIC command to read machine language from tape. Your alternative is actually the best way to include short machine language routines in a BASIC program. However, there is a way to read machine language object files produced by the Assembler Editor. Unfortunately, when assembling to cassette the tape keeps going during the first pass of the assembly, creating an excessively long leader tone. This makes the tape quite difficult to read.
Instead of assembling directly to tape, assemble to memory and use the command SAVE #C:<start,end (where start and end correspond to the hexadecimal starting and ending addresses of your program). This will save the object code from memory to cassette. In BASIC, you can use this program to read and POKE the tape program into memory:
100 OPEN #1, 4, 0, "C:" 110 GET #1, A : GET #1, A 120 TRAP 140 : GET #1, A: GET #1, B : BEG = A + 256 * B : GET #1, A : GET #1, B : FIN = A + 256 * B 130 FOR I = BEG TO FIN : GET #1, A : POKE I, A: NEXT I : GOTO 120 140 CLOSE #1 : TRAP 40000
This program will also load a disk object file if you change the device specification in line 100 and add the appropriate filename. Beware of loading ML programs that would overwrite the BASIC program.