Add uart2 test program

Reads input from uart and then writes it back out again immediately.
This commit is contained in:
Byron Lathi
2023-01-12 14:05:13 -06:00
parent d5bccd46e3
commit 519cd19739
7 changed files with 53 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
TARGETS=stacktest runram timer timer_irq multiplier divider uart
TARGETS=stacktest runram timer timer_irq multiplier divider uart uart2
SRC=$(wildcard *.s)
DIR=../ip/bram

View File

@@ -9,7 +9,14 @@ main:
ldx #$00
loop:
lda string,x
beq end
sta UART_TX
inx
wait:
lda UART_STATUS
bit #$02
beq loop
bra wait
end:
wai

View File

@@ -0,0 +1,23 @@
.code
UART_TX = $efe6
UART_RX = UART_TX
UART_STATUS = $efe7
UART_CONTROL = UART_STATUS
main:
ldx #$00
loop:
lda UART_STATUS ; see if bit 0 is set
bit #$01
beq loop
lda UART_RX ; read rx buffer if so
sta UART_TX ; transmit it back again
bra loop
.segment "VECTORS"
.addr main
.addr main
.addr main