This commit is contained in:
Ben Chong
2017-07-02 21:28:52 -07:00
parent bce5e371d6
commit 16732e6cab
5 changed files with 21 additions and 21 deletions

View File

@@ -2,8 +2,9 @@
; Based on original code by Daryl Rictor
; Adapted to 16550 UART board for RC2014
; Renamed to 16c550.asm
; Changes are copyright Ben Chong and freely licensed to the community
;
; Note: Assumes the use of a 16C550 with autoflow control
; Note: Does not require a 16C550 with autoflow control
;
; ----------------- assembly instructions ----------------------------
;

View File

@@ -1,4 +1,5 @@
; 64 byte char buffer
; Changes are copyright Ben Chong and freely licensed to the community
;---------------------------------------------------------------------
; Compare Result N Z C
; A, X, or Y < Memory * 0 0
@@ -37,17 +38,17 @@ put_buffer
jsr uart_deassert_rts
not_hiw
inc charcount
stx ysav ; Temp storage. 6502 doesn't have enough flexibility...!
; stx ysav ; Temp storage. 6502 doesn't have enough flexibility...!
ldx inptr ; Grab inptr from memory
pla ; Get char
sta buffer, x ; Store in buffer
inx ; Increment to next location
cpx #64 ; Top of buffer area?
cpx #MAXCOUNT ; Top of buffer area?
bcc pb_not ; < 64
ldx #$00 ; If >=64, go back to bottom of buffer
pb_not
stx inptr ; Update inptr in memory
ldx ysav ; Restore X
; ldx ysav ; Restore X
bp_max
rts
@@ -67,7 +68,7 @@ not_low
ldx outptr
lda buffer, x
inx
cpx #64 ; Top of buffer?
cpx #MAXCOUNT ; Top of buffer?
bcc plb_not ; No
ldx #$00 ; Back to bottom
plb_not

View File

@@ -2,8 +2,6 @@
; Modified for RC2014
; Changes are copyright Ben Chong and freely licensed to the community
;
; ----------------- assembly instructions ----------------------------
;
;****************************************************************************
; Reset, Interrupt, & Break Handlers
;****************************************************************************
@@ -13,23 +11,23 @@
; Vector table
; Monitor vector $ff00
jmp Monitor
jmp Monitor
.org $ff03
input_char jmp uart_input ; wait for input character
input_char jmp uart_input ; wait for input character
; $ff06
check_input jmp uart_scan ; scan for input (no wait), C=1 char, C=0 no character
check_input jmp uart_scan ; scan for input (no wait), C=1 char, C=0 no character
; $ff09
output_char jmp uart_Output ; send 1 character
output_char jmp uart_Output ; send 1 character
; $ff0c
printstring jmp PrintStrAX
;--------------Reset handler----------------------------------------------
reset SEI ; diable interupts
CLD ; clear decimal mode
LDX #$FF ;
TXS ; init stack pointer
reset sei ; diable interupts
cld ; clear decimal mode
ldx #$FF ;
txs ; init stack pointer
; Initialize interrupt vectors
; Use null_irq and similar NMI handlers first
@@ -45,8 +43,8 @@ reset SEI ; diable interupts
; At this point, the actual IRQ handling may be set up
jsr uart_init
CLI ; Enable interrupt
JMP MonitorBoot ; Monitor for cold reset
cli ; Enable interrupt
jmp MonitorBoot ; Monitor for cold reset
; -------------------------------------
; Interrupt or BRK entry point
@@ -65,12 +63,12 @@ irqjump jmp (irq_vector) ; Jump to indirect handler
; Default IRQ handler, before we return, restore X and A
null_irq
PLA ; Restore X
pla ; Restore X
tax ;
pla ; Restore A
; Then return from interrupt
nmi_handler
RTI ; Null Interrupt return
rti ; Null Interrupt return
; -------------------------------------
; NMI entry point

View File

@@ -2,6 +2,7 @@
; 6502 Monitor
; Modified for RC2014
; Changes are copyright Ben Chong and freely licensed to the community
;
; ----------------- assembly instructions ----------------------------
; This version is assembled using asmx in the following way:
; asmx -l -b 8000h-ffffh -e -C 6502 sbc.asm

View File

@@ -43,8 +43,7 @@ PREG = $03e6 ; hold status register (P)
irq_vector = $03e8 ; Interrupt vector
nmi_vector = $03ea ; NMI vector
rowcount = $03eb ; 1 byte
;realpcl = $03eb
;realpch = $03ec
;dlfail = $03ec ; flag for upload failure
;
;