mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 16:38:06 +11:00
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`.
This commit is contained in:
parent
9b556c8883
commit
279f6e0ad8
@ -18,7 +18,8 @@ init:
|
|||||||
call USER_CODE
|
call USER_CODE
|
||||||
; signal the emulator we're done
|
; signal the emulator we're done
|
||||||
; BC contains the number of written bytes
|
; BC contains the number of written bytes
|
||||||
ld a, b
|
ld a, c
|
||||||
|
ld c, b
|
||||||
out (c), a
|
out (c), a
|
||||||
halt
|
halt
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ static uint8_t io_read(int unused, uint16_t addr)
|
|||||||
|
|
||||||
static void io_write(int unused, uint16_t addr, uint8_t val)
|
static void io_write(int unused, uint16_t addr, uint8_t val)
|
||||||
{
|
{
|
||||||
written = (val << 8) + (addr & 0xff);
|
written = ((addr & 0xff) << 8) + (val & 0xff);
|
||||||
running = 0;
|
running = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user