mirror of
https://github.com/sethm/symon.git
synced 2024-07-06 01:28:57 +00:00
This is something of a "Work in Progress" checkpoint of several features that are all half baked: 1. Allow loading of 16KB ROM files at address $C000 at run-time, not just at startup. See the "Load ROM..." File menu item. 2. Introduces the notion of "CPU Behaviors", so the core 6502 CPU implementation can match the behavior of either an early NMOS 6502, late NMOS 6502, or CMOS 65C02. Very little of this is actually implemented so far. 3. Adds a completely bogus implementation of the 6522 VIA (it does absolutely nothing right now). 4. Changes the address of the ACIA in the simulated system to match a real hardware implementation I put together.
32 lines
770 B
NASM
32 lines
770 B
NASM
;;
|
|
;; Output the string 'Hello, World!'
|
|
;;
|
|
|
|
|
|
.alias iobase $8000
|
|
.alias iostatus [iobase + 1]
|
|
.alias iocmd [iobase + 2]
|
|
.alias ioctrl [iobase + 3]
|
|
|
|
.org $0300
|
|
|
|
start: cli
|
|
lda #$09
|
|
sta iocmd ; Set command status
|
|
lda #$1a
|
|
sta ioctrl ; 0 stop bits, 8 bit word, 2400 baud
|
|
|
|
init: ldx #$00 ; Initialize index
|
|
|
|
loop: lda iostatus
|
|
and #$10 ; Is the tx register empty?
|
|
beq loop ; No, wait for it to empty
|
|
lda string,x ; Otherwise, load the string pointer
|
|
beq init ; If the char is 0, re-init
|
|
sta iobase ; Otherwise, transmit
|
|
|
|
inx ; Increment string pointer.
|
|
jmp loop ; Repeat write.
|
|
|
|
string: .byte "Hello, 6502 world! ", 0
|