1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-27 01:19:37 +00:00

CBM BASIC loader should use the actual address of main (fixes #111)

This commit is contained in:
Karol Stasiak
2021-11-12 02:45:53 +01:00
parent 38ad919ed9
commit a260d0a806
9 changed files with 45 additions and 96 deletions
+31
View File
@@ -0,0 +1,31 @@
#template $ADDR$
#if not(CBM)
#warn cbm/basic_loader module should be only used on Commodore targets
#endif
const array _basic_loader @ $ADDR$ = [
#if DISPLACED_MAIN
@word_le [
$ADDR$ + 0xB
],
#else
@word_le [
$ADDR$ + if(main.addr >= 10000, 1/0, 0xA) // use -D DISPLACED_MAIN=1 if you get an error here
],
#endif
10,
0,
$9e,
#if DISPLACED_MAIN
$30 + (main.addr/10000)%%10,
#endif
$30 + (main.addr/1000)%%10,
$30 + (main.addr/100)%%10,
$30 + (main.addr/10)%%10,
$30 + (main.addr/1)%%10,
0,
0,
0
]