summaryrefslogtreecommitdiffstats
path: root/sw/z80/tests/pio
diff options
context:
space:
mode:
Diffstat (limited to 'sw/z80/tests/pio')
-rw-r--r--sw/z80/tests/pio/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sw/z80/tests/pio/main.c b/sw/z80/tests/pio/main.c
index 3687f50..7ac64bc 100644
--- a/sw/z80/tests/pio/main.c
+++ b/sw/z80/tests/pio/main.c
@@ -3,8 +3,8 @@
#include <stdint.h>
#define PIO_A_DATA 0x10
-#define PIO_A_CMD 0x11
-#define PIO_B_DATA 0x12
+#define PIO_B_DATA 0x11
+#define PIO_A_CMD 0x12
#define PIO_B_CMD 0x13
void main(void)
@@ -14,21 +14,25 @@ void main(void)
ld h, #0x00
;; set bit mode
- ld a, #0xCF
- ;; load cmd addr
ld c, #PIO_B_CMD
+
+ ld a, #0xCF
out (c), a
- ;; set output
+
+ ;; set all pins to output
ld a, #0x00
out (c), a
+
;; disable interrupts
ld a, #0x0C
out (c), a
+
;; load data addr
ld c, #PIO_B_DATA
loop:
out (c), h
ld a, h
+
cpl
ld h, a
jr loop