commit 755aeabb4f2811a985df6f1960dca82dae5d8be1
parent 931d6cc0c85f033f836057cd2db5f45f705f9e8f
Author: Brian Swetland <swetland@frotz.net>
Date: Tue, 10 Mar 2020 12:04:39 -0700
compiler: stop generating entry/exit shims
- emulator now handles environment setup
- just setup a branch from 0 to func "start"
Diffstat:
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/compiler.c b/src/compiler.c
@@ -1739,8 +1739,6 @@ void gen_start() {
}
void gen_end() {
- ctx.code[0] |= (ctx.pc - 4) >> 2; // patch branch at 0
-
String str = mkstring("start", 5);
Object obj = find(str);
while (obj != nil) {
@@ -1750,11 +1748,8 @@ void gen_end() {
if (obj->first != nil) {
error("'start' must have no parameters\n");
}
- emit_mov(14, 0x100000); // MOV SP, RAMTOP
- emit_bi(AL|L, -((ctx.pc + 4 - obj->value) >> 2)); // BL start
- emit_mov(1, 0xFFFF0000); // MOV R1, IOBASE
- emit_mem(STW, 0, 1, 0x100); // SW R0, [R1, 0x100]
- emit_bi(AL, -1); // B .
+ // patch branch at addr 0
+ ctx.code[0] |= (obj->value - 4) >> 2;
return;
}
error("no 'start' function\n");