Hoping someone could help me out here. I'm trying to get some romable code working for an old computer I built. I've got two assembly files but I'm having some issues with the ORG command. My first assembly file is start.s, it will eventually setup all of the segment registers and do other hardware init stuff. I'd like for it to start at 0x0000 in my ROM. My other file is resetvec.s which is just a reset vector jump to the code in the first file at 0x0000. I've also got main.c that I link in to make sure I can throw some C in there. The code is as follows:
start.s
Code: Select all
.ORG 0x0000
.globl _main
entry start
start:
MOV AX, 0x0000 ;SYSRAM
MOV DS, AX ;initialize segments
MOV SS, AX ;RAM is both the stack and the data segment
;MOV AX, 0x0100 ;OFFSET top_of_stack ;initialize the stack pointer
MOV SP, AX
MOV DX, _main
JMP DX
Code: Select all
ORG 0xFFF0
entry reset
reset:
JMP 0xF000:0x0000
Code: Select all
void main()
{
int i;
i++;
}
Code: Select all
bcc -c main.c
as86 -o start.o start.s
as86 -o resetvec.o resetvec.s
ld86 -d -M -o project.bin start.o main.o resetvec.o
Code: Select all
start start 0 00000000 A N
main _main 0 00000010 R
resetvec reset 0 0000fff0 A N
Does anyone know of a way to get this to work like I'd like, resetvec.s starting at 0xFFF0?
If I cannot figure this out, I could always assemble my start.s with resetvec.s's code and then copy my compiled code into a predefined section of the .bin file, but I'd rather do this properly.
Thanks!