Michael J. Mahon wrote:
Knut Roll-Lund wrote:Michael J. Mahon wrote:Knut Roll-Lund wrote:I have a basic compiler for the TRS-80 that does a strange hybrid thing; ACCEL2. I bought it back in the old days. It will put assembly into comments within the basic program and there is a small runtime library too. It will compile only what is advantageous. The output is smaller and a lot faster.An interesting approach...so it must "patch" the BASIC program so that it gets control to the machine code?The TRS-80 has basic in rom executing straight out if the ROM, 12K (and many machine code programs rely on calling rom routines) but it has some jumps to the low ram which are made for disk basic to add some commands for disk handling etc. These jump-returns are used to intercept basic.Sorry, I should have been more precise: by BASIC program, I meant the tokenized text of the BASIC program, not the BASIC interpreter.
Sorry, my mistake. On TRS-80 DOS the BASIC is an application, a program (even if it will call and is much based on ROM routines).
Yes, much of the BASIC program "disappears", hides and since it is binary it can't be saved with the normal BASIC SAVE or CSAVE command, one needs a machine code saving program either from the DOS, or with cassette a program like the one they made and sold separately. Also you couldn't edit it any more so if you needed to change it you would have to go back to the source and edit then recompile. It was pretty fast compiling too, which of course depended on the size of the program. With the ACCEL2 it was pretty easy to create games in BASIC and still get a good speed.
BTW it gave you opportunity to write nicer, tidier code with comments. It no longer mattered with few statements per line, comments or where in a program the GOTO was to.
-- Knut (delete 'nogarbage.' for email)