97 lines
2.5 KiB
NASM
97 lines
2.5 KiB
NASM
;--------------------------------------------------------
|
|
; File Created by SDCC : free open source ANSI-C Compiler
|
|
; Version 4.0.0 #11528 (Linux)
|
|
;--------------------------------------------------------
|
|
.module console
|
|
.optsdcc -mz80
|
|
|
|
;--------------------------------------------------------
|
|
; Public variables in this module
|
|
;--------------------------------------------------------
|
|
.globl _get_char
|
|
.globl _put_char
|
|
.globl _put_string
|
|
;--------------------------------------------------------
|
|
; special function registers
|
|
;--------------------------------------------------------
|
|
;--------------------------------------------------------
|
|
; ram data
|
|
;--------------------------------------------------------
|
|
.area _DATA
|
|
;--------------------------------------------------------
|
|
; ram data
|
|
;--------------------------------------------------------
|
|
.area _INITIALIZED
|
|
;--------------------------------------------------------
|
|
; absolute external ram data
|
|
;--------------------------------------------------------
|
|
.area _DABS (ABS)
|
|
;--------------------------------------------------------
|
|
; global & static initialisations
|
|
;--------------------------------------------------------
|
|
.area _HOME
|
|
.area _GSINIT
|
|
.area _GSFINAL
|
|
.area _GSINIT
|
|
;--------------------------------------------------------
|
|
; Home
|
|
;--------------------------------------------------------
|
|
.area _HOME
|
|
.area _HOME
|
|
;--------------------------------------------------------
|
|
; code
|
|
;--------------------------------------------------------
|
|
.area _CODE
|
|
;src/console.c:3: char get_char() __naked {
|
|
; ---------------------------------
|
|
; Function get_char
|
|
; ---------------------------------
|
|
_get_char::
|
|
;src/console.c:9: __endasm;
|
|
ld a, #6
|
|
call __bios_call
|
|
ld l, a
|
|
ret
|
|
;src/console.c:10: }
|
|
;src/console.c:12: void put_char(char c) __naked {
|
|
; ---------------------------------
|
|
; Function put_char
|
|
; ---------------------------------
|
|
_put_char::
|
|
;src/console.c:21: __endasm;
|
|
ld iy, #2
|
|
add iy, sp
|
|
ld c, 0(iy)
|
|
ld a, #9
|
|
call __bios_call
|
|
ret
|
|
;src/console.c:22: }
|
|
;src/console.c:24: void put_string(char* s) {
|
|
; ---------------------------------
|
|
; Function put_string
|
|
; ---------------------------------
|
|
_put_string::
|
|
;src/console.c:25: while (*s) {
|
|
pop de
|
|
pop bc
|
|
push bc
|
|
push de
|
|
00101$:
|
|
ld a, (bc)
|
|
or a, a
|
|
ret Z
|
|
;src/console.c:26: put_char(*s);
|
|
push bc
|
|
push af
|
|
inc sp
|
|
call _put_char
|
|
inc sp
|
|
pop bc
|
|
;src/console.c:27: s++;
|
|
inc bc
|
|
;src/console.c:29: }
|
|
jr 00101$
|
|
.area _CODE
|
|
.area _INITIALIZER
|
|
.area _CABS (ABS)
|