2002-07-10 19:29:34 +00:00
|
|
|
; Maciej 'YTM/Elysium' Witkowiak
|
|
|
|
; 06.06.2002
|
|
|
|
|
2011-12-27 00:25:17 +00:00
|
|
|
; This is the source for the main VLIR-structured program part
|
2002-07-10 19:29:34 +00:00
|
|
|
|
|
|
|
; include some GEOS defines
|
|
|
|
|
2011-12-27 00:25:17 +00:00
|
|
|
.include "../../libsrc/geos/inc/const.inc"
|
|
|
|
.include "../../libsrc/geos/inc/jumptab.inc"
|
|
|
|
.include "../../libsrc/geos/inc/geossym.inc"
|
2012-02-09 09:13:34 +00:00
|
|
|
.include "../../libsrc/geos/inc/geosmac.inc"
|
2002-07-10 19:29:34 +00:00
|
|
|
|
|
|
|
; import load addresses for all VLIR chains
|
2011-12-27 00:25:17 +00:00
|
|
|
; these labels are defined upon linking with ld65
|
|
|
|
|
|
|
|
.import __OVERLAYADDR__
|
|
|
|
.import __OVERLAYSIZE__
|
2002-07-10 19:29:34 +00:00
|
|
|
|
|
|
|
; import names of functions defined (and exported) in each VLIR part
|
|
|
|
; of your application
|
2011-12-27 00:25:17 +00:00
|
|
|
; here I used an OVERLAYx_ prefix to prevent name clashes
|
2002-07-10 19:29:34 +00:00
|
|
|
|
2011-12-27 00:25:17 +00:00
|
|
|
.import OVERLAY1_Function1
|
|
|
|
.import OVERLAY2_Function1
|
2002-07-10 19:29:34 +00:00
|
|
|
|
2011-12-27 00:25:17 +00:00
|
|
|
; segments "STARTUP", "CODE", "DATA", "RODATA" and "BSS" all go to VLIR0 chain
|
2002-07-10 19:29:34 +00:00
|
|
|
|
2011-12-27 00:25:17 +00:00
|
|
|
.segment "STARTUP"
|
2002-07-10 19:29:34 +00:00
|
|
|
; code segment for VLIR 0 chain
|
|
|
|
ProgExec:
|
|
|
|
LoadW r0, paramString ; show something
|
|
|
|
jsr DoDlgBox
|
|
|
|
|
|
|
|
MoveW dirEntryBuf+OFF_DE_TR_SC, r1
|
|
|
|
LoadW r4, fileHeader
|
|
|
|
jsr GetBlock ; load back VLIR t&s table
|
|
|
|
bnex error
|
|
|
|
|
|
|
|
lda #1
|
|
|
|
jsr PointRecord ; we want next module (#1)
|
2011-12-27 00:25:17 +00:00
|
|
|
LoadW r2, __OVERLAYSIZE__ ; length - as many bytes as we have room for
|
|
|
|
LoadW r7, __OVERLAYADDR__ ; all VLIR segments have the same load address
|
2002-07-10 19:29:34 +00:00
|
|
|
jsr ReadRecord ; load it
|
|
|
|
bnex error
|
2011-12-27 00:25:17 +00:00
|
|
|
jsr OVERLAY1_Function1 ; execute something
|
2002-07-10 19:29:34 +00:00
|
|
|
|
|
|
|
lda #2
|
|
|
|
jsr PointRecord ; next module
|
2011-12-27 00:25:17 +00:00
|
|
|
LoadW r2, __OVERLAYSIZE__
|
|
|
|
LoadW r7, __OVERLAYADDR__
|
2002-07-10 19:29:34 +00:00
|
|
|
jsr ReadRecord ; load it
|
|
|
|
bnex error
|
2011-12-27 00:25:17 +00:00
|
|
|
jsr OVERLAY2_Function1 ; execute something
|
2002-07-10 19:29:34 +00:00
|
|
|
|
|
|
|
error: jmp EnterDeskTop ; end of application
|
|
|
|
|
|
|
|
.segment "RODATA"
|
|
|
|
; read-only data segment
|
|
|
|
paramString:
|
|
|
|
.byte DEF_DB_POS | 1
|
|
|
|
.byte DBTXTSTR, TXT_LN_X, TXT_LN_2_Y
|
|
|
|
.word line1
|
|
|
|
.byte DBTXTSTR, TXT_LN_X, TXT_LN_3_Y
|
|
|
|
.word line2
|
|
|
|
.byte OK, DBI_X_0, DBI_Y_2
|
|
|
|
.byte NULL
|
|
|
|
|
|
|
|
line1: .byte BOLDON, "Hello World!",0
|
|
|
|
line2: .byte OUTLINEON,"Hello",PLAINTEXT," world!",0
|
|
|
|
|
|
|
|
.segment "DATA"
|
|
|
|
; read/write initialized data segment
|
|
|
|
counter: .word 0
|
|
|
|
|
|
|
|
.segment "BSS"
|
|
|
|
; read/write uninitialized data segment
|
|
|
|
; this space doesn't go into output file, only its size and
|
|
|
|
; position is remembered
|