collapseos/apps/zasm/emul/glue.asm
Virgil Dupras 279f6e0ad8 zasm: invert emulator io_write() handling
This facilitates debugging. To know the value of `A` at any point,
you can do `out (0), a`. The number of bytes in the output will be the
value of `A`.
2019-04-17 10:34:30 -04:00

27 lines
404 B
NASM

#include "user.inc"
; Glue code for the emulated environment
ZASM_INPUT .equ 0xa000
ZASM_OUTPUT .equ 0xd000
jr init ; 2 bytes
; *** JUMP TABLE ***
jp strncmp
jp addDE
jp upcase
init:
di
ld hl, RAMEND
ld sp, hl
ld hl, ZASM_INPUT
ld de, ZASM_OUTPUT
call USER_CODE
; signal the emulator we're done
; BC contains the number of written bytes
ld a, c
ld c, b
out (c), a
halt
#include "core.asm"