Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .setcpu "65C02"
- ACIA_DATA = $7F00
- ACIA_STATUS = $7F01
- ACIA_COMMAND = $7F02
- ACIA_CONTROL = $7F03
- .segment "VECTORS"
- .word nmi
- .word reset
- .word irq
- .code
- reset: jmp main
- nmi: rti
- irq: rti
- main:
- init_acia: lda #%00001011
- sta ACIA_COMMAND
- lda #%00011111
- sta ACIA_CONTROL
- lda #0
- sta $00
- sta $01
- loop: jsr print
- jsr increment
- bra loop
- print: lda $00
- jsr acia_put_hex_byte
- lda $01
- jsr acia_put_hex_byte
- pha
- lda #$0D
- jsr acia_put_byte
- lda #$0A
- jsr acia_put_byte
- pla
- rts
- increment: clc
- lda $01
- adc #1
- sta $01
- lda $00
- adc #0
- sta $00
- rts
- delay: pha
- lda #$FF
- : nop
- dec a
- bne :-
- rts
- acia_put_hex_byte: pha
- pha
- and #$F0
- lsr
- lsr
- lsr
- lsr
- tax
- lda hex_lut,x
- jsr acia_put_byte
- pla
- and #$0F
- tax
- lda hex_lut,x
- jsr acia_put_byte
- pla
- rts
- acia_put_byte: pha
- : lda ACIA_STATUS
- and #$10
- beq :-
- pla
- sta ACIA_DATA
- rts
- hex_lut: .byte "0123456789ABCDEF"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement