Added platform specific fast put_char and put_string routines

This commit is contained in:
Dreaded_X 2021-01-18 18:01:18 +01:00
parent 7f014174b1
commit faad4c5752
2 changed files with 30 additions and 0 deletions

View File

@ -5,3 +5,5 @@ char get_char();
void put_string(char* s);
void put_char_fast(char c);
void put_string_fast(char* s);

View File

@ -21,9 +21,37 @@ void put_char(char c) __naked {
__endasm;
}
void put_char_fast(char c) __naked {
c;
__asm
conout:
in a, (0x03)
and #0x01
jp z, debug
ld iy, #2
add iy, sp
ld a, 0(iy)
out (0x02), a
ret
debug:
ld a, #0
out (0xFF), a
jp conout
__endasm;
}
void put_string(char* s) {
while (*s) {
put_char(*s);
s++;
}
}
void put_string_fast(char* s) {
while (*s) {
put_char_fast(*s);
s++;
}
}