1 ; Maciej 'YTM/Elysium' Witkowiak
4 ; This is the source for the main VLIR-structured program part
6 ; include some GEOS defines
8 .include "../../libsrc/geos/inc/const.inc"
9 .include "../../libsrc/geos/inc/jumptab.inc"
10 .include "../../libsrc/geos/inc/geossym.inc"
11 .include "../../libsrc/geos/inc/geosmac.inc"
13 ; import load addresses for all VLIR chains
14 ; these labels are defined upon linking with ld65
16 .import __OVERLAYADDR__
17 .import __OVERLAYSIZE__
19 ; import names of functions defined (and exported) in each VLIR part
21 ; here I used an OVERLAYx_ prefix to prevent name clashes
23 .import OVERLAY1_Function1
24 .import OVERLAY2_Function1
26 ; segments "STARTUP", "CODE", "DATA", "RODATA" and "BSS" all go to VLIR0 chain
29 ; code segment for VLIR 0 chain
31 LoadW r0, paramString ; show something
34 MoveW dirEntryBuf+OFF_DE_TR_SC, r1
36 jsr GetBlock ; load back VLIR t&s table
40 jsr PointRecord ; we want next module (#1)
41 LoadW r2, __OVERLAYSIZE__ ; length - as many bytes as we have room for
42 LoadW r7, __OVERLAYADDR__ ; all VLIR segments have the same load address
43 jsr ReadRecord ; load it
45 jsr OVERLAY1_Function1 ; execute something
48 jsr PointRecord ; next module
49 LoadW r2, __OVERLAYSIZE__
50 LoadW r7, __OVERLAYADDR__
51 jsr ReadRecord ; load it
53 jsr OVERLAY2_Function1 ; execute something
55 error: jmp EnterDeskTop ; end of application
58 ; read-only data segment
61 .byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
63 .byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
65 .byte OK, DBI_X_0, DBI_Y_2
68 line1: .byte BOLDON, "Hello World!",0
69 line2: .byte OUTLINEON,"Hello",PLAINTEXT," world!",0
72 ; read/write initialized data segment
76 ; read/write uninitialized data segment
77 ; this space doesn't go into output file, only its size and
78 ; position is remembered