Преглед изворни кода

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`.
pull/10/head
Virgil Dupras пре 5 година
родитељ
комит
279f6e0ad8
2 измењених фајлова са 3 додато и 2 уклоњено
  1. +2
    -1
      apps/zasm/emul/glue.asm
  2. +1
    -1
      apps/zasm/emul/zasm.c

+ 2
- 1
apps/zasm/emul/glue.asm Прегледај датотеку

@@ -18,7 +18,8 @@ init:
call USER_CODE
; signal the emulator we're done
; BC contains the number of written bytes
ld a, b
ld a, c
ld c, b
out (c), a
halt



+ 1
- 1
apps/zasm/emul/zasm.c Прегледај датотеку

@@ -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)
{
written = (val << 8) + (addr & 0xff);
written = ((addr & 0xff) << 8) + (val & 0xff);
running = 0;
}



Loading…
Откажи
Сачувај