]> git.sur5r.net Git - cc65/blob - testcode/lib/atari/multi-xex.s
Adds test code for the Atari (xex) linker file 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
18
19
20 ; We load color values directly into registers
21         .segment        "COLOR"
22
23         .byte           $16     ; COLOR0
24         .byte           $46     ; COLOR1
25         .byte           $00     ; COLOR2
26         .byte           $6A     ; COLOR3
27         .byte           $82     ; COLOR4
28
29 ; We load our display list over page 6
30         .segment        "PAGE6"
31
32 display_list:
33         .byte   DL_BLK8
34         .byte   DL_BLK8
35         .byte   DL_BLK8
36         .byte   DL_BLK8
37         .byte   DL_BLK8
38         .byte   DL_BLK8
39         .byte   DL_CHR20x8x2 | DL_LMS
40         .word   screen_memory
41         .byte   DL_CHR40x8x1
42         .byte   DL_JVB
43         .word   display_list
44
45 screen_memory:
46         ; first text line: 20 bytes
47         scrcode   "    HeLlO wOrLd!    "
48         ; second text line, 40 bytes
49         .byte    0, 0, 0, 0, 0, 0, 0, 0,70,71,70,71,70,71,70,71,70,71,70,71
50         .byte   70,71,70,71,70,71,70,71,70,71,70,71, 0, 0, 0, 0, 0, 0, 0, 0
51
52 ; We write directly to the display list pointer
53         .segment        "SDLST"
54         .word   display_list
55
56 ; And we load our main program
57         .code
58
59 .proc   start
60         ; Jump forever
61         jmp     start
62 .endproc
63