I am using cc65 6502 simulator, which compiles code for 6502. I wish to link the 6502 code and C code and produce a binary file that I can execute.
My C code "main.c":
#include<stdio.h>
extern void foo(void);
int main() {
foo();
return 0;
}
My 6502 code "foo.s":
foo:
LDA #$00
STA $0200
The code might seem very simple but I am just trying to achieve the successful linking. But I cannot get rid of the following error:
Unresolved external '_foo' referenced in:
main.s(27)
ld65: Error: 1 unresolved external(s) found - cannot create output file