Added platform specific fast put_char and put_string routines
This commit is contained in:
@@ -5,3 +5,5 @@ char get_char();
|
|||||||
|
|
||||||
void put_string(char* s);
|
void put_string(char* s);
|
||||||
|
|
||||||
|
void put_char_fast(char c);
|
||||||
|
void put_string_fast(char* s);
|
||||||
|
|||||||
@@ -21,9 +21,37 @@ void put_char(char c) __naked {
|
|||||||
__endasm;
|
__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) {
|
void put_string(char* s) {
|
||||||
while (*s) {
|
while (*s) {
|
||||||
put_char(*s);
|
put_char(*s);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void put_string_fast(char* s) {
|
||||||
|
while (*s) {
|
||||||
|
put_char_fast(*s);
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user