summaryrefslogtreecommitdiffstats
path: root/sw/z80/drivers/build/pio.asm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sw/z80/drivers/build/pio.asm (renamed from sw/z80_tests/usart/build/pio.asm)40
1 files changed, 40 insertions, 0 deletions
diff --git a/sw/z80_tests/usart/build/pio.asm b/sw/z80/drivers/build/pio.asm
index ee1fcc6..3045492 100644
--- a/sw/z80_tests/usart/build/pio.asm
+++ b/sw/z80/drivers/build/pio.asm
@@ -13,6 +13,8 @@
.globl _pio_set_mode
.globl _pio_set_interrupts
.globl _pio_set_interrupts_mask
+ .globl _pio_read
+ .globl _pio_write
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
@@ -185,6 +187,44 @@ _pio_set_interrupts_mask::
ld (hl),c
;pio.c:39: _pio_control(port, mask);
ret
+;pio.c:42: uint8_t pio_read(int port)
+; ---------------------------------
+; Function pio_read
+; ---------------------------------
+_pio_read::
+;pio.c:44: return *(pio_port + port);
+ ld hl,#2
+ add hl,sp
+ ld iy,#_pio_port
+ ld a,0 (iy)
+ add a, (hl)
+ ld c,a
+ ld a,1 (iy)
+ inc hl
+ adc a, (hl)
+ ld b,a
+ ld a,(bc)
+ ld l,a
+ ret
+;pio.c:47: void pio_write(int port, uint8_t data)
+; ---------------------------------
+; Function pio_write
+; ---------------------------------
+_pio_write::
+;pio.c:49: _pio_data(port, data);
+ ld hl, #4+0
+ add hl, sp
+ ld c, (hl)
+ pop de
+ pop hl
+ push hl
+ push de
+;pio.c:8: *(pio_port + port) = data;
+ ld de,(_pio_port)
+ add hl,de
+ ld (hl),c
+;pio.c:49: _pio_data(port, data);
+ ret
.area _CODE
.area _INITIALIZER
__xinit__pio_port: