summaryrefslogtreecommitdiffstats
path: root/sw/z80/tests
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2017-11-23 14:34:55 +0100
committerNao Pross <naopross@thearcway.org>2017-11-23 14:34:55 +0100
commit141137dfe5bdc7400d5cc1ad388b670f9f2e9446 (patch)
treebef58de3c44787dadb22ec9cf452a3606ddd6708 /sw/z80/tests
parentImprovements in PIO driver, pio test rewritten in inline asm (diff)
downloadz80uPC-141137dfe5bdc7400d5cc1ad388b670f9f2e9446.tar.gz
z80uPC-141137dfe5bdc7400d5cc1ad388b670f9f2e9446.zip
update cpld files from VHDL dev machine and delete programmer code (unused)
Diffstat (limited to '')
-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