1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-12-21 06:29:48 +00:00
8bitworkshop/presets/atari8-800/hello.dasm

95 lines
2.6 KiB
Plaintext
Raw Normal View History

2022-08-30 02:00:52 +00:00
2020-09-07 21:09:49 +00:00
; Atari 8-bit "Hello World" sample code
; Written by Daniel Boris (danlb_2000@yahoo.com)
2020-07-28 20:06:49 +00:00
; Modified by Steven Hugg @8bitworkshop
; Assemble with DASM
;
processor 6502
include "atari.inc"
org $a000 ;Start of left cartridge area
2022-08-30 02:00:52 +00:00
Start
2020-07-28 20:06:49 +00:00
ldx #(dlistend-dlist)
dlloop ;Create Display List
lda dlist,x ;Get byte
sta $1000,x ;Copy to RAM
dex ;next byte
bpl dlloop
lda #$06
sta CHACTL ;Set Character Control
2022-08-30 02:00:52 +00:00
lda #$28
2020-07-28 20:06:49 +00:00
sta COLOR0+0
2022-08-30 02:00:52 +00:00
lda #$0F
sta COLOR0+1
lda #$d6
sta COLOR0+2
2020-07-28 20:06:49 +00:00
lda #$58
sta COLOR0+3
2022-08-30 02:00:52 +00:00
lda #$84
sta COLOR0+4 ; bakground
2020-07-28 20:06:49 +00:00
lda #$00 ;Set Display list pointer
sta SDLSTL ;Shadow DLISTL
lda #$10
sta SDLSTH ;Shadow DLISTH
lda #$e0 ;Set Charcter Set Base
sta CHBAS
lda #$22 ;Enable DMA
2022-08-30 02:00:52 +00:00
lda #$21
2020-07-28 20:06:49 +00:00
sta SDMCTL ;Shadow DMACTL
print
ldy #$00
cld
prloop
lda text1,y ;Get character
beq wait
cmp #$60
bcs lower
sec
sbc #$20 ;Convert to ATASCII
lower
sta $1800,y ;Store in video memory
iny ;Next character
bne prloop
wait
nop
jmp wait
;Display list data (starts at $1000)
2022-08-30 02:00:52 +00:00
dlist .byte $70,$70 ;16 blank scanlines
.byte $42,$00,$18,$02,$70 ;mode 2 @ $1800
.byte $43,$00,$18,$70 ;mode 3 @ $1800
.byte $44,$00,$18,$70 ;mode 4 @ $1800
.byte $45,$00,$18,$70 ;mode 5 @ $1800
.byte $46,$00,$18,$70 ;mode 6 @ $1800
.byte $47,$00,$18,$70 ;mode 7 @ $1800
.byte $48,$00,$18,$08,$70 ;mode 2 @ $1800
.byte $49,$00,$18,$70 ;mode 3 @ $1800
.byte $4a,$00,$18,$70 ;mode 4 @ $1800
.byte $4b,$00,$18,$70 ;mode 5 @ $1800
.byte $4c,$00,$18,$70 ;mode 6 @ $1800
.byte $4d,$00,$18,$70 ;mode 7 @ $1800
.byte $4e,$00,$18,$70 ;mode 7 @ $1800
.byte $4f,$00,$18,$70 ;mode 7 @ $1800
2020-07-28 20:06:49 +00:00
.byte $41,$00,$10 ;JMP -> $1000
dlistend
;Text data
2022-09-01 19:27:14 +00:00
text1 .byte "Hello World! "
2020-07-28 20:06:49 +00:00
.byte $a1,$a2,$a3
2022-09-01 19:27:14 +00:00
.repeat 16
2022-08-30 02:00:52 +00:00
.byte 32
.repend
2022-09-01 19:27:14 +00:00
.byte "12345"
2020-07-28 20:06:49 +00:00
.byte 0
;Cartridge footer
org CARTCS
.word Start ; cold start address
.byte $00 ; 0 == cart exists
.byte $04 ; boot cartridge
.word Start ; start