2 ; Maciej 'YTM/Elysium' Witkowiak
5 ; This is source for main VLIR-structured program part
7 ; include some GEOS defines
9 .include "../../../libsrc/geos/inc/const.inc"
10 .include "../../../libsrc/geos/inc/jumptab.inc"
11 .include "../../../libsrc/geos/inc/geossym.inc"
12 .include "../../../libsrc/geos/inc/geosmac.ca65.inc"
14 ; import load addresses for all VLIR chains
15 ; by default they are all the same, but this is not required
16 ; these labels are defined upon linking with ld65 - each segment has it
17 .import __VLIR1_LOAD__
18 .import __VLIR2_LOAD__
20 ; import names of functions defined (and exported) in each VLIR part
22 ; here I used VLIRx_ prefix to prevent name clash
24 .import VLIR1_Function1
25 .import VLIR2_Function2
27 ; segments "CODE", "DATA", "RODATA" and "BSS" all go to VLIR0 chain
30 ; code segment for VLIR 0 chain
32 LoadW r0, paramString ; show something
35 MoveW dirEntryBuf+OFF_DE_TR_SC, r1
37 jsr GetBlock ; load back VLIR t&s table
41 jsr PointRecord ; we want next module (#1)
42 LoadW r2, $ffff ; length - as many bytes as there are
43 LoadW r7, __VLIR1_LOAD__ ; all VLIR segments have the same load address
44 jsr ReadRecord ; load it
46 jsr VLIR1_Function1 ; execute something
49 jsr PointRecord ; next module
51 LoadW r7, __VLIR2_LOAD__
52 jsr ReadRecord ; load it
54 jsr VLIR2_Function2 ; execute something
56 error: jmp EnterDeskTop ; end of application
59 ; read-only data segment
62 .byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
64 .byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
66 .byte OK, DBI_X_0, DBI_Y_2
69 line1: .byte BOLDON, "Hello World!",0
70 line2: .byte OUTLINEON,"Hello",PLAINTEXT," world!",0
73 ; read/write initialized data segment
77 ; read/write uninitialized data segment
78 ; this space doesn't go into output file, only its size and
79 ; position is remembered