diff --git a/Makefile b/Makefile index 7eacd99..28b788c 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ SRC = \ src/ceda_print_a.asm \ src/ceda_print_c.c \ src/main.c \ + src/io_a.c \ \ OBJ = $(patsubst %, %.o, $(basename $(SRC))) diff --git a/src/io.h b/src/io.h new file mode 100644 index 0000000..f376d38 --- /dev/null +++ b/src/io.h @@ -0,0 +1,10 @@ +#ifndef CEDA_IO_H +#define CEDA_IO_H + +#include + +void io_out(uint8_t address, uint8_t value); + +uint8_t io_in(uint8_t address); + +#endif // CEDA_IO_H diff --git a/src/io_a.asm b/src/io_a.asm new file mode 100644 index 0000000..dcf2f82 --- /dev/null +++ b/src/io_a.asm @@ -0,0 +1,18 @@ +SECTION code +PUBLIC _io_out + +_io_out: + push ix + ld ix,$0000 + add ix,sp + + push bc + + ld c,(ix+$04) + ld b,(ix+$05) + out (c),b + + pop bc + + pop ix + ret diff --git a/src/main.c b/src/main.c index 66c64de..699bde2 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,5 @@ #include "ceda_print.h" +#include "io.h" int globalvar = 0x7777; @@ -6,5 +7,8 @@ int main(void) { ceda_print("Hello world!"); ceda_cls(); + io_out(0x81, 0x80); + ceda_print("ABCD"); + return 0; }