Using a text editor, enter the following C program into a file hello.c:
/* hello.c */ #include <stdio.h> int main() { printf("Hello from sea world!\n"); /* call C function printf */ return 0; }
Compile, assemble and link the program in a DOS window by typing:
m68k-coff-gcc -S hello.c -o hello.s -m5200
m68k-coff-as hello.s -o hello.o -m5200 -ahls=hello.lst
m68k-coff-gcc -m5200 -Wl,-s -Wl,-n -Tsbc5206-srec.ld hello.o -o hello.x
You can also use the script file sbc-c.bat, or create a make file.
Exercise.
go 10000
ANU Engineering - ENGN3213