diff --git a/doc/sim65.sgml b/doc/sim65.sgml index c2740bbad..962f07254 100644 --- a/doc/sim65.sgml +++ b/doc/sim65.sgml @@ -115,37 +115,78 @@ PVExit ($01) Creating a Test in C

-For a C test compiled and linked with ). +a set of built-in paravirtualization functions (see ). +Example: + + +#include +int main() +{ + printf("Hello!\n"); + return 5; +} + +// Build and run: +// cl65 -t sim6502 -o example.prg example.c +// sim65 example.prg + +// Build and run, separate steps: +// cc65 -t sim6502 -o example.s example.c +// ca65 -t sim6502 -o example.o example.s +// ld65 -t sim6502 -o example.prg example.o sim6502.lib +// sim65 example.prg + Creating a Test in Assembly

-Assembly tests may similarly be assembled and linked with - Return from -The binary file has a 12 byte header: +Example: + + +.export _main +_main: + lda #5 + rts + +; Build and run: +; cl65 -t sim6502 -o example.prg example.s +; sim65 example.prg + +; Build and run, separate steps: +; ca65 -t sim6502 -o example.o example.s +; ld65 -t sim6502 -o example.prg example.o sim6502.lib +; sim65 example.prg + + +Internally, the binary program file has a 12 byte header provided by the library: @@ -182,6 +223,9 @@ These use cc65 calling conventions, and are intended for use with the sim65 targ The