]> git.sur5r.net Git - cc65/blob - testcode/lib/atari/multi-xex.s
Add support for INITAD to the Atari binary format.
[cc65] / testcode / lib / atari / multi-xex.s
1 ; Multiple segment ATARI file format sample, using custom linker script.
2 ;
3 ; This sample defines a custom display-list screen with no code, writing all
4 ; memory areas directly.
5 ;
6 ; See the linker script (multi-xex.cfg) for the definition of memory areas and
7 ; segments.
8 ;
9 ; Compile with:
10 ;    cl65 -tatari -Cmulti-xex.cfg multi-xex.s -o prog.xex
11
12         .include        "atari.inc"
13
14         .macpack        atari
15
16 ; Default RUNAD is "start", export that:
17         .export         start, show_load
18
19 ; Loader
20         .segment        "LOADER"
21 show_load:
22         ldx     #0              ; channel 0
23         lda     #<msg_load
24         sta     ICBAL,x         ; address
25         lda     #>msg_load
26         sta     ICBAH,x
27         lda     #$FF
28         sta     ICBLL,x         ; length
29         sta     ICBLH,x
30         lda     #PUTREC
31         sta     ICCOM,x
32         jmp     CIOV
33
34 msg_load:
35         .byte   "Loading....", ATEOL
36
37 ; We load color values directly into registers
38         .segment        "COLOR"
39
40         .byte           $16     ; COLOR0
41         .byte           $46     ; COLOR1
42         .byte           $00     ; COLOR2
43         .byte           $6A     ; COLOR3
44         .byte           $82     ; COLOR4
45
46 ; We load our display list over page 6
47         .segment        "PAGE6"
48
49 display_list:
50         .byte   DL_BLK8
51         .byte   DL_BLK8
52         .byte   DL_BLK8
53         .byte   DL_BLK8
54         .byte   DL_BLK8
55         .byte   DL_BLK8
56         .byte   DL_CHR20x8x2 | DL_LMS
57         .word   screen_memory
58         .byte   DL_CHR40x8x1
59         .byte   DL_JVB
60         .word   display_list
61
62 screen_memory:
63         ; first text line: 20 bytes
64         scrcode   "    HeLlO wOrLd!    "
65         ; second text line, 40 bytes
66         .byte    0, 0, 0, 0, 0, 0, 0, 0,70,71,70,71,70,71,70,71,70,71,70,71
67         .byte   70,71,70,71,70,71,70,71,70,71,70,71, 0, 0, 0, 0, 0, 0, 0, 0
68
69 ; We write directly to the display list pointer
70         .segment        "SDLST"
71         .word   display_list
72
73 ; And we load our main program
74         .code
75
76 .proc   start
77         ; Jump forever
78         jmp     start
79 .endproc
80