comparison level1/modules/dwwrite.asm @ 3246:be3446f758ca

Updated dwread.asm and dwwrite.asm so that the 6551 routines could have specially defined flags so that some of the addresses could be overridden by the make files if needed.
author David Ladd <drencor-xeen@users.sourceforge.net>
date Sun, 11 Mar 2018 01:30:30 -0600
parents a47ee8f14eb8
children
comparison
equal deleted inserted replaced
3245:e17533e90076 3246:be3446f758ca
32 32
33 IFNE SY6551N 33 IFNE SY6551N
34 IFNDEF SY6551B 34 IFNDEF SY6551B
35 SY6551B EQU $FF68 ; Set base address for future use 35 SY6551B EQU $FF68 ; Set base address for future use
36 ENDC 36 ENDC
37 IFNDEF SYDATA
38 SYDATA EQU SY6551B
39 ENDC
40 IFNDEF SYCONT
41 SYCONT EQU SY6551B+3
42 ENDC
43 IFNDEF SYCOMM
44 SYCOMM EQU SY6551B+2
45 ENDC
46 IFNDEF SYSTAT
47 SYSTAT EQU SY6551B+1
48 ENDC
49 IFNDEF SYCONSET
50 SYCONSET EQU $10 ; Default baud rate 115200
51 ENDC
37 DWWrite pshs d,cc ; preserve registers 52 DWWrite pshs d,cc ; preserve registers
38 IFEQ NOINTMASK 53 IFEQ NOINTMASK
39 orcc #IntMasks ; mask interrupts 54 orcc #IntMasks ; mask interrupts
40 ENDC 55 ENDC
41 lda #$10 ; Set baud to 115K 56 lda #SYCONSET ; Set baud to value of SYCONSET
42 sta SY6551B+3 ; write the info to register 57 sta SYCONT ; write the info to register
43 lda #$0B ; Set no parity, no irq 58 lda #$0B ; Set no parity, no irq
44 sta SY6551B+2 ; write the info to register 59 sta SYCOMM ; write the info to register
45 txByte 60 txByte
46 lda SY6551B+1 ; read status register to check 61 lda SYSTAT ; read status register to check
47 anda #$10 ; if transmit buffer is empty 62 anda #$10 ; if transmit buffer is empty
48 beq txByte ; if not loop back and check again 63 beq txByte ; if not loop back and check again
49 lda ,x+ ; load byte from buffer 64 lda ,x+ ; load byte from buffer
50 sta SY6551B ; and write it to data register 65 sta SYDATA ; and write it to data register
51 leay -1,y ; decrement byte counter 66 leay -1,y ; decrement byte counter
52 bne txByte ; loop if more to send 67 bne txByte ; loop if more to send
53 puls cc,d,pc ; restore registers and return 68 puls cc,d,pc ; restore registers and return
54 ELSE 69 ELSE
55 IFNE JMCPBCK 70 IFNE JMCPBCK