Creation of an assembler that runs on the model 100, to assemble programs for the model 100. Actually there will be at least two: the first will be a barely-functional assembler written in BASIC, the second a half-decent assembler written in assembly and assembled (initially) by the BASIC assembler.
My next assembler is written and I'm working on testing it - hopefully I will be posting it here soon. It will have 2 parts: one part (RUNASM.BA) written in BASIC, and another part (ASM.CO) written in assembly. The reason is that for some tasks, it makes more sense to use BASIC, and there is no (easy/documented) way to call into the BASIC code from a machine language program, whereas there is a way to call machine language from BASIC. RUNASM.BA will be listed below.
I need RUNASM.BA to deal with getting input from the user, displaying messages to the user, and handling the input file being assembled. Most of the tasks will only be required once or twice - except #1 (line 100 - get the next line from the input file); and #9 (line 900 - used for testing/debugging). If the assembler is too slow, I will suspect task #1 first.
The main reason that I want to use BASIC to handle the input file is that, as well as files in RAM, it can read from cassette, the serial port, and ** a diskette drive ** if you have one and have set BASIC up to use it. (For example, there was available the "TANDY Portable Disk Drive" and a program called TS-DOS which could be hooked into BASIC - see the links on the left for more info.) Note, though, that for now I'm only testing with RAM files.
Well, it turns out that BASIC strings can be at most 255 bytes long. I was trying to keep all of the labels from an assembly file in one BASIC string, which meant I couldn't have very many labels. Below is an updated BASIC assembler which fixes this problem by using arrays (turns out BASIC has arrays...)
Can't find a way to add files to the project, so I'm just going to paste below - sorry. First is the BASIC program, then a text file I wrote to document the code. My apologies to anyone who tries to read this; I have no experience with BASIC.