Model T Binary to BASIC DATA v0.0

This can convert assembled code in a binary file to BASIC lines containing DATA and REM statements.
The purpose of this is to generate installable machine language code for the Model T Laptops with the method devised by MJ Nugent, Jr. in the late 1980s.

The format of the data is quite simple: a -1 marks an local pointer to be relocated and the rest are just bytes in decimal form.
To make this possible it is necessary to know all addresses of these local pointers, which can be easily facilitated with the A85 cross assembler.

Add this right after ORG:
	ORG		08006H
	PRINT "#START = 8006"

Add this before every 3 byte instruction with a local pointer:
	PRINT  $

You can't have more than 249 bytes on a REM line. So, split your code up with this:
	PRINT  "#REMLINETOP"
	PRINT  $		
DB	0,0,0,0,0,0
	PRINT  "#REMLINEBOT"
	PRINT  $	

Add this at the very end:
	PRINT  "#END"


You may get this error if a local pointer happens to contain these unfortunate values:
"WARNING ILLEGAL BYTE DETECTED:0x00 AT PC=0x8123"
"WARNING ILLEGAL BYTE DETECTED:0x0D AT PC=0x8123"

And if your code exceeds the maximum length:
"REM 20 HAS EXCEEDED 249 BYTES!!!"

If everything went right then the program will tell you the length of the REM lines like this:
"REM 10 Length:94"
"REM 20 Length:226"
You have to adjust the size values in the final BASIC file manually. (Usually the first DATA statements)

This program takes 4 arguments.
First the binary code file, then the STDOUT from A85 and then a output file along with a number to define the first line of the DATA statements.
Here's how I use it to create my HOTKEY.BA version:
todata.exe hotkey100.bin reloc.lst basic_out.txt 590

Don't forget check the FOR loop in the KILLER.DO part or else the installed .BA file will larger than necessary.


T. Sosnow. <t-sosnow@posteo.com>
Visit QWERTZ-tek at http://qwertz.w10.site/ for my other stuff
April 18, 2025
