1;
2; Ullrich von Bassewitz, 2010-11-14
3;
4; This module supplies a small BASIC stub program that jumps to the machine
5; language code that follows it using SYS.
6;
7
8        ; The following symbol is used by linker config to force the module
9        ; to get included into the output file
10        .export         __EXEHDR__: absolute = 1
11
12.segment        "EXEHDR"
13
14        .addr   Next
15        .word   .version        ; Line number
16        .byte   $9E             ; SYS token
17;       .byte   <(((Start / 10000) .mod 10) + '0')
18        .byte   <(((Start /  1000) .mod 10) + '0')
19        .byte   <(((Start /   100) .mod 10) + '0')
20        .byte   <(((Start /    10) .mod 10) + '0')
21        .byte   <(((Start /     1) .mod 10) + '0')
22        .byte   $00             ; End of BASIC line
23Next:   .word   0               ; BASIC end marker
24Start:
25
26; If the start address is larger than 4 digits, the header generated above
27; will not contain the highest digit. Instead of wasting one more digit that
28; is almost never used, check it at link time and generate an error so the
29; user knows something is wrong.
30
31.assert (Start < 10000), error, "Start address too large for generated BASIC stub"
32
33
34