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 ; Based on original code by Daryl Rictor
; Adapted to 16550 UART board for RC2014 ; Adapted to 16550 UART board for RC2014
; Renamed to 16c550.asm ; 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 ---------------------------- ; ----------------- assembly instructions ----------------------------
; ;

View File

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

View File

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

View File

@@ -2,6 +2,7 @@
; 6502 Monitor ; 6502 Monitor
; Modified for RC2014 ; Modified for RC2014
; Changes are copyright Ben Chong and freely licensed to the community ; Changes are copyright Ben Chong and freely licensed to the community
;
; ----------------- assembly instructions ---------------------------- ; ----------------- assembly instructions ----------------------------
; This version is assembled using asmx in the following way: ; This version is assembled using asmx in the following way:
; asmx -l -b 8000h-ffffh -e -C 6502 sbc.asm ; 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 irq_vector = $03e8 ; Interrupt vector
nmi_vector = $03ea ; NMI vector nmi_vector = $03ea ; NMI vector
rowcount = $03eb ; 1 byte rowcount = $03eb ; 1 byte
;realpcl = $03eb ;dlfail = $03ec ; flag for upload failure
;realpch = $03ec
; ;
; ;