6502 Assembler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Build *.ATR | |
; | |
; This program shows how one can compile 6502 source into | |
; a valid *.ATR image file ( => an bootable disk Image for Atari 8- Bit computers) | |
; using the MADS Assembler. You can use it as a framework for your own projects. | |
; | |
; Why? | |
; | |
; I was asking myself, how one could start *.XEX image files on the real machine. | |
; *.XEX files are Atari DOS 2.x compatible binary files. Since the SIO2USB | |
; interface - that I use - can not start such files I had to find a work around. | |
; | |
; The easiest way for me was to tell the MADS Assembler not to write an Atari DOS binary | |
; and put the *.ATR image header at the start. After the image file header, which | |
; convinces SIO2USB that it is loading a valid *.ATR, folows meta data representing | |
; a valid Atari boot srctor. | |
; | |
; After compiling change the filename from *.XEX to *.ATR. That's it :-) | |
; | |
; BF 7.9.2014 | |
opt h- ; Omit DOS file header | |
org $a800 ; Your choice :-) | |
; | |
; *.ATR Image File Header | |
; | |
.word $0296 ; Magic Number : Start of *.ATR image file header=> 16 Bytes in total | |
.word 128*720/16 ; Image Size / 16 = 92160 Bytes | |
.byte 128 ; Sector size low | |
.byte 0 ; Sector size high | |
.byte 0 ; Extented Para???? | |
.byte 0 ; 8 to 16, unused | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
; | |
; Atari Boot Sektor | |
; | |
org $0700 | |
ram | |
.byte 0 ; Always! | |
.byte 10 ; # of sectors to read | |
.word ram ; Store sectors at thet adress. | |
.word init ; Start code that begins here | |
; | |
; #2 Boot continious | |
; | |
start | |
ldy #0 ; Do something........ | |
lda #103 | |
sta (88),y | |
clc ; Everything is OK! | |
rts ; Back to OS => Jump to Dos- Vector => main | |
; | |
; #1: Init routine | |
; | |
init | |
lda #<main ; Init Dos- Vector | |
sta $a | |
lda #>main | |
sta $b | |
rts ; Return to OS | |
; | |
; #3 Main | |
; | |
main | |
ldy #39 ; To something........ | |
lda #105 | |
sta (88),y | |
en | |
jmp en | |
endofcode | |
.byte 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Build *.ATR | |
; | |
; This program shows how one can compile 6502 source into | |
; a valid *.ATR image file ( => an bootable disk Image for Atari 8- Bit computers) | |
; using the MADS Assembler. You can use it as a framework for your own projects. | |
; | |
; Why? | |
; | |
; I was asking myself, how one could start *.XEX image files on the real machine. | |
; *.XEX files are Atari DOS 2.x compatible binary files. Since the SIO2USB | |
; interface - that I use - can not start such files I had to find a work around. | |
; | |
; The easiest way for me was to tell the MADS Assembler not to write an Atari DOS binary | |
; and put the *.ATR image header at the start. After the image file header, which | |
; convinces SIO2USB that it is loading a valid *.ATR, folows meta data representing | |
; a valid Atari boot srctor. | |
; | |
; After compiling change the filename from *.XEX to *.ATR. That's it :-) | |
; | |
; BF 7.9.2014 | |
opt h- ; Omit DOS file header | |
org $a800 ; Your choice :-) | |
; | |
; *.ATR Image File Header | |
; | |
.word $0296 ; Magic Number : Start of *.ATR image file header=> 16 Bytes in total | |
.word 128*720/16 ; Image Size / 16 = 92160 Bytes | |
.byte 128 ; Sector size low | |
.byte 0 ; Sector size high | |
.byte 0 ; Extented Para???? | |
.byte 0 ; 8 to 16, unused | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
.byte 0 | |
; | |
; Atari Boot Sektor | |
; | |
org $0700 | |
ram | |
.byte 0 ; Always! | |
.byte 10 ; # of sectors to read | |
.word ram ; Store sectors at that adress. | |
.word init ; Start code that begins here | |
; | |
; #2 Boot continious | |
; | |
start | |
ldy #0 ; Do something........ | |
lda #103 | |
sta (88),y | |
clc ; Everything is OK! | |
rts ; Back to OS => Jump to Dos- Vector => main | |
; | |
; #1: Init routine | |
; | |
init | |
lda #<main ; Init Dos- Vector | |
sta $a | |
lda #>main | |
sta $b | |
rts ; Return to OS | |
; | |
; #3 Main | |
; | |
main | |
ldy #39 ; To something........ | |
lda #105 | |
sta (88),y | |
en | |
jmp en | |
endofcode | |
.byte 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Vertical Blank Interrupt Demo | |
; | |
; BF 2018 | |
org $a800 | |
ldy #<vbi ;Start adress of VBI | |
ldx #>vbi | |
lda #6 ;= Immediate VBI | |
jsr $e45c ; Start VBI! | |
infinite | |
jmp infinite | |
; | |
; The VBI routine | |
; | |
; Executed, every time the electron beam returns to to top left corner | |
; of the crt...... | |
; | |
vbi | |
lda $14 | |
ldy #0 | |
sta (88),y | |
jmp $e45f ; Leave VBI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment