Changes to I/O access
This commit is contained in:
@@ -1,220 +0,0 @@
|
||||
;
|
||||
; Wayne Parham (wayne@parhamdata.com)
|
||||
;
|
||||
; void set_DDR1A (int value);
|
||||
; int get_DDR1A (void);
|
||||
; void set_IOR1A (int value);
|
||||
; int get_IOR1A (void);
|
||||
; void set_DDR1B (int value);
|
||||
; int get_DDR1B (void);
|
||||
; void set_IOR1B (int value);
|
||||
; int get_IOR1B (void);
|
||||
; void set_DDR2A (int value);
|
||||
; int get_DDR2A (void);
|
||||
; void set_IOR2A (int value);
|
||||
; int get_IOR2A (void);
|
||||
; void set_DDR2B (int value);
|
||||
; int get_DDR2B (void);
|
||||
; void set_IOR2B (int value);
|
||||
; int get_IOR2B (void);
|
||||
; void set_DDR3A (int value);
|
||||
; int get_DDR3A (void);
|
||||
; void set_IOR3A (int value);
|
||||
; int get_IOR3A (void);
|
||||
; void set_DDR3B (int value);
|
||||
; int get_DDR3B (void);
|
||||
; void set_IOR3B (int value);
|
||||
; int get_IOR3B (void);
|
||||
;
|
||||
|
||||
.include "sym1.inc"
|
||||
|
||||
.export _set_DDR1A, _get_DDR1A, _set_IOR1A, _get_IOR1A
|
||||
.export _set_DDR1B, _get_DDR1B, _set_IOR1B, _get_IOR1B
|
||||
.export _set_DDR2A, _get_DDR2A, _set_IOR2A, _get_IOR2A
|
||||
.export _set_DDR2B, _get_DDR2B, _set_IOR2B, _get_IOR2B
|
||||
.export _set_DDR3A, _get_DDR3A, _set_IOR3A, _get_IOR3A
|
||||
.export _set_DDR3B, _get_DDR3B, _set_IOR3B, _get_IOR3B
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
.proc _set_DDR1A: near
|
||||
|
||||
sta DDR1A ; Write data direction register for port 1A
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR1A: near
|
||||
|
||||
lda DDR1A ; Read data direction register for port 1A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR1A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR1A: near
|
||||
|
||||
sta OR1A ; Write I/O register for port 1A
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR1A: near
|
||||
|
||||
lda OR1A ; Read I/O register for port 1A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR1A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_DDR1B: near
|
||||
|
||||
sta DDR1B ; Write data direction register for port 1B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR1B: near
|
||||
|
||||
lda DDR1B ; Read data direction register for port 1B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR1B
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR1B: near
|
||||
|
||||
sta OR1B ; Write I/O register for port 1B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR1B: near
|
||||
|
||||
lda OR1B ; Read I/O register for port 1B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR1B
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_DDR2A: near
|
||||
|
||||
sta DDR2A ; Write data direction register for port 2A
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR2A: near
|
||||
|
||||
lda DDR2A ; Read data direction register for port 2A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR2A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR2A: near
|
||||
|
||||
sta OR2A ; Write I/O register for port 2A
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR2A: near
|
||||
|
||||
lda OR2A ; Read I/O register for port 2A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR2A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_DDR2B: near
|
||||
|
||||
sta DDR2B ; Write data direction register for port 2B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR2B: near
|
||||
|
||||
lda DDR2B ; Read data direction register for port 2B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR2B
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR2B: near
|
||||
|
||||
sta OR2B ; Write I/O register for port 2B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR2B: near
|
||||
|
||||
lda OR2B ; Read I/O register for port 2B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR2B
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_DDR3A: near
|
||||
|
||||
sta DDR3A ; Write data direction register for port 3A
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR3A: near
|
||||
|
||||
lda DDR3A ; Read data direction register for port 3A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR3A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR3A: near
|
||||
|
||||
sta OR3A ; Write I/O register for port 3A
|
||||
rts ; Return 0000
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR3A: near
|
||||
|
||||
lda OR3A ; Read I/O register for port 3A
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR3A
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_DDR3B: near
|
||||
|
||||
sta DDR3B ; Write data direction register for port 3B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_DDR3B: near
|
||||
|
||||
lda DDR3B ; Read data direction register for port 3B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DDR3B
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_IOR3B: near
|
||||
|
||||
sta OR3B ; Write I/O register for port 3B
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_IOR3B: near
|
||||
|
||||
lda OR3B ; Read I/O register for port 3B
|
||||
ldx #>$0000 ;
|
||||
rts ; Return OR3B
|
||||
|
||||
.endproc
|
||||
|
||||
@@ -1,29 +1,12 @@
|
||||
;
|
||||
; Wayne Parham (wayne@parhamdata.com)
|
||||
;
|
||||
; int fdisp (void);
|
||||
; void set_D0 (char segments);
|
||||
; int get_D0 (void);
|
||||
; void set_D1 (char segments);
|
||||
; int get_D1 (void);
|
||||
; void set_D2 (char segments);
|
||||
; int get_D2 (void);
|
||||
; void set_D3 (char segments);
|
||||
; int get_D3 (void);
|
||||
; void set_D4 (char segments);
|
||||
; int get_D4 (void);
|
||||
; void set_D5 (char segments);
|
||||
; int get_D5 (void);
|
||||
; void set_D6 (char segments);
|
||||
; int get_D6 (void);
|
||||
; void fdisp (void);
|
||||
;
|
||||
|
||||
.include "sym1.inc"
|
||||
|
||||
.export _fdisp, _set_D0, _get_D0
|
||||
.export _set_D1, _get_D1, _set_D2, _get_D2
|
||||
.export _set_D3, _get_D3, _set_D4, _get_D4
|
||||
.export _set_D5, _get_D5, _set_D6, _get_D6
|
||||
.export _fdisp
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
@@ -34,108 +17,3 @@
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D0: near
|
||||
|
||||
sta DISBUF0 ; Write Digit 0
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D0: near
|
||||
|
||||
lda DISBUF0 ; Read Digit 0
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF0
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D1: near
|
||||
|
||||
sta DISBUF1 ; Write Digit 1
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D1: near
|
||||
|
||||
lda DISBUF1 ; Read Digit 1
|
||||
ldx #>$0000 ;
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D2: near
|
||||
|
||||
sta DISBUF2 ; Write Digit 2
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D2: near
|
||||
|
||||
lda DISBUF2 ; Read Digit 2
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF2
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D3: near
|
||||
|
||||
sta DISBUF3 ; Write Digit 3
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D3: near
|
||||
|
||||
lda DISBUF3 ; Read Digit 3
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF3
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D4: near
|
||||
|
||||
sta DISBUF4 ; Write Digit 4
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D4: near
|
||||
|
||||
lda DISBUF4 ; Read Digit 4
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF4
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D5: near
|
||||
|
||||
sta DISBUF5 ; Write Digit 5
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D5: near
|
||||
|
||||
lda DISBUF5 ; Read Digit 5
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF5
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _set_D6: near
|
||||
|
||||
sta DISBUF6 ; Write byte to the right of display
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
.proc _get_D6: near
|
||||
|
||||
lda DISBUF6 ; Read byte to the right of display
|
||||
ldx #>$0000 ;
|
||||
rts ; Return DISBUF6
|
||||
|
||||
.endproc
|
||||
|
||||
|
||||
@@ -29,7 +29,11 @@ begin: dec ptr2
|
||||
beq done ; If buffer full, return
|
||||
|
||||
getch: jsr INTCHR ; Get character using Monitor ROM call
|
||||
and #$7F ; Clear hi bit
|
||||
jsr OUTCHR ; Echo it
|
||||
and #$7F ; Clear hi bit and check for '\r'
|
||||
cmp #$0D
|
||||
bne putch
|
||||
lda #$0A ; Replace with '\n' and set count to zero
|
||||
|
||||
putch: ldy #$00 ; Put char into return buffer
|
||||
sta (ptr1),y
|
||||
|
||||
Reference in New Issue
Block a user