MACHINE LANGUAGE TO BASIC CONVERSION
by Paul Hoffman
President: BOSTON ATARI USERS GROUP
When ATARI designed the Assembler/Editor cartridge, they did not include a convenient method of converting assembly language subroutines into BASIC subroutines. The documented procedure, using string manipulation, is complex, and it makes the BASIC subroutine unreadable. If you sell your software, you might want to allow your customer to change the subroutines; this is very cumbersome with ATARI's "execute the string" construct.
The following program reads an area of memory, and writes the contents to the screen as DATA statements (with 20 bytes per statement). To enter these into your BASIC program, simply hit RETURN's over the statements, and save them on disk or tape. Before saving the DATA statements, you can remember them to fit into your program at the correct place if you wish. You can, of course, change lines 100 and 200 to set the correct beginning and increment.
To use the following program, write your assembly language program, assemble it, and save the object file on disk or tape. Replace the Assembler cartridge, and load your program into an unused part of memory; such as page 6 (it does not have to be the place where you will eventually load it in your BASIC program.) Run the memory reader program, and tell it where to start and stop reading; it will display the DATA lines on the screen. You can usually fit about 150 bytes on the screen at once.
The program uses the screen to allow you to convert machine language code into somewhat understandable basic POKEs. When it's running, it clears itself out of memory, so that all you have is your data. I feel that a utility such as this, which is much less cumbersome than the one suggested in the Assembler/Editor manual, should have been included in the original cartridge, but ATARI sometimes forgets little conveniences such as this...