]> git.sur5r.net Git - cc65/blob - testcode/lib/atari/asm-xex.s
Adds test code for the Atari (xex) linker file format.
[cc65] / testcode / lib / atari / asm-xex.s
1 ; Sample using ATARI file format, by "atari-xex.cfg" linker configuration.
2 ;
3 ; This is a very simple example, shows a message to the screen, waits and
4 ; returns to DOS.
5 ;
6 ; Compile with:
7 ;    cl65 -tatari -Catari-xex.cfg asm-xex.s -o prog.xex
8
9         .include        "atari.inc"
10
11 ; Default RUNAD is "start", export that:
12         .export         start
13
14
15 ; Write string to screen
16 .proc   puts
17         sta     ICBAL
18         stx     ICBAH
19         lda     #PUTREC
20         sta     ICCOM
21         ldx     #$FF
22         stx     ICBLL
23         inx
24         stx     ICBLH
25         jsr     CIOV
26         rts
27 .endproc
28
29
30 ; Write a message and exit
31
32 .proc   start
33         lda     #<msg
34         ldx     #>msg
35         jsr     puts
36
37
38         ; Delay before returning to DOS
39         lda     #0
40         tax
41 loop:
42         inx
43         cpx     #$FF
44         adc     #0
45         bcc     loop
46
47         rts
48 .endproc
49
50 msg:    .byte   "Hello world", ATEOL
51