JimBoyd wrote:
When I was developing my metacompiler, I added a feature that I never actually needed ( it was easy to add ). The metacompiler has a word SUB which is used to write subroutines a code word might need.
I really shouldn't post when I'm tired. I
do use
SUB in my kernel source. Before that, I used
LABEL ( makes a metacompiler label ) and invoked the assembler directly.
SUB was so much easier.
whartung wrote:
If it were just a stand alone program that takes a text file and spits out an assembled binary, then it's simply a different syntax rather than an entirely different tool chain.
I made some improvements to my metacompiler. With
INCLUDE , it can take this sequential file from a C64 disk and compile it with no Forth, no headers, just the assembly code. It then prompts for a filename and spits out a binary to the disk. The demo does what some programs meant to be called from
BASIC does, SYS 49152 does one thing and SYS 49155 does another.
Code:
HEX START
C000 ORIGIN
SUB TWIN.DEMOS
AHEAD,
0 # LDA, TAX,
10 # LDY,
BEGIN,
D020 STA, CLC, 1 # ADC,
CS-DUP 0= UNTIL, // CONTINUE
INX,
CS-DUP 0= UNTIL, // CONTINUE
DEY,
0= UNTIL,
RTS,
THEN,
0 # LDY, FC STY,
7 # LDA, FD STA,
4 # LDA, FE STA,
E8 # LDY,
BEGIN,
DEY,
FC )Y LDA, 80 # EOR,
FC )Y STA,
0 # CPY,
CS-DUP 0= UNTIL, // CONTINUE
FD DEC, FE DEC,
0= UNTIL,
RTS,
END-CODE
TSAVE
Attachment:
meta assembler demo 2.png [ 23.67 KiB | Viewed 6586 times ]