From 72e4bee0809a5b05d5c7c01859b845a5021625aa Mon Sep 17 00:00:00 2001 From: Daniele Verducci su MatissePenguin Date: Wed, 9 Dec 2020 20:09:52 +0100 Subject: [PATCH] Code clean --- assembly/bios/drivers/arduino_terminal.asm | 10 +++++----- assembly/bios/libs/time.asm | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assembly/bios/drivers/arduino_terminal.asm b/assembly/bios/drivers/arduino_terminal.asm index 04d3af8..291d4c0 100644 --- a/assembly/bios/drivers/arduino_terminal.asm +++ b/assembly/bios/drivers/arduino_terminal.asm @@ -2,7 +2,7 @@ ; @author Daniele Verducci ; config (IO port 0) -DATA_REG: EQU IO_0 +TERM_DATA_REG: EQU IO_0 ; variables TERM_VAR_SPACE: EQU DRV_VAR_SPACE + 128 @@ -16,20 +16,20 @@ Term_print: ld a, (bc) ; bc is the pointer to passed string's first char cp 0 ; compare A content with 0 (subtract 0 from value and set zero flag Z if result is 0) ret z ; if prev compare is true (Z flag set), string is finished, return - out (DATA_REG),a ; output char + out (TERM_DATA_REG),a ; output char inc bc ; increment bc to move to next char jp Term_print ; Writes a single character ; @param A Value of character to print Term_printc: - out (DATA_REG),a + out (TERM_DATA_REG),a ret ; Reads a single character ; @return A The read character Term_readc: - in a, (DATA_REG) ; reads a character + in a, (TERM_DATA_REG) ; reads a character add a, 0 jp z, Term_readc ; if char is 0 (NULL), ignores it and waits for another character ret ; if not NULL, returns it in the a register @@ -38,7 +38,7 @@ Term_readc: ; @return BC The pointer to a null-terminated read string Term_readline: ld bc, incoming_string ; this array will contain read string - in a, (DATA_REG) ; reads a character + in a, (TERM_DATA_REG) ; reads a character ; if char is 0 (ascii NULL), ignore it add a, 0 jp z, Term_readline ; if 0 (= ascii NULL), ignores it and waits for another character diff --git a/assembly/bios/libs/time.asm b/assembly/bios/libs/time.asm index 0d71be9..46fd738 100644 --- a/assembly/bios/libs/time.asm +++ b/assembly/bios/libs/time.asm @@ -2,7 +2,7 @@ ; @author Daniele Verducci ; Duration in cpu cycles / 55 (change these values based on CPU frequency) -TIME_DUR_SECOND: EQU (2545) +TIME_DUR_SECOND: EQU 2545 TIME_DUR_MILLIS: EQU 3 ; Wait bc * 55 states