forked from A2osX/A2osX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.TEMPLATE.S.txt
More file actions
94 lines (93 loc) · 2.73 KB
/
Copy path.TEMPLATE.S.txt
File metadata and controls
94 lines (93 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
NEW
AUTO 3,1 Enable MASM3 auto line num
.LIST OFF
.OP 65C02 Target CPU, must = CPU header level
.OR $2000 usualy $2000, any value > $100 ok
.TF <PATH TO BINARY> e.g. BIN/MYPROG
*---------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
*---------------------------------------
* Zero Page Segment, up to 32 bytes (0 filled before INIT)
*---------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
* MyPtr .BS 2
ZS.END .ED
*---------------------------------------
* File Header (16 Bytes)
*---------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*---------------------------------------
* Relocation Table
*---------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
* Add any address you want be relocated by loader
* Usefull if you have to pass EFFECTIVE address to an API call...
* L.MSG.Test .DA Msg.Test
.DA 0
*---------------------------------------
* Called once at process creation
* Put code for loading LIB here
*---------------------------------------
CS.INIT clc
rts
*---------------------------------------
* Called until exit with CS
* if RUN exits with CC, RUN entered again
*---------------------------------------
CS.RUN
* Put your code here
* >LDYA L.MSG.Test Load EFFECTIVE address
* >SYSCALL PutS Call API to print a string
.8 lda #0 Exit Code = Succes
sec QUIT Process
rts
.9 lda #E.SYN Exit Code = Succes
sec QUIT Process
rts
*---------------------------------------
* Called if option S.PS.F.EVENT enabled in Header
* Timer Event : every 10th seconds
*---------------------------------------
CS.DOEVENT sec
rts
*---------------------------------------
* Called once, when RUN exited with CS
* Put code for unloading LIB here
*---------------------------------------
CS.QUIT clc
rts
*---------------------------------------
CS.END
*---------------------------------------
* Initialized DATA
*---------------------------------------
* Put your constant here :
* MSG.TEST .AZ "Test Message"
*---------------------------------------
* Per Process DATA segment (0 filled before INIT)
*---------------------------------------
.DUMMY
.OR 0
DS.START
DS.END
.ED
*---------------------------------------
MAN
SAVE USR/SRC/BIN<MYPROG.S> Save this source file
ASM