Skip to content
Peter Tillema edited this page Jul 3, 2018 · 5 revisions

CEmu offers many software commands that can be executed directly from user programs in order to do useful things such as setting breakpoints and opening the debugger.

Available Commands

Console Strings

Write to the CEmu console by using address 0xFB0000 and higher. Terminate output with 0x00 to send the string to the console. Use address 0xFC0000 instead to display text with a red foreground color.

Open Debugger

Open the debugger for any reason. Write 2 to address 0xffffff.

    scf
    sbc    hl,hl
    ld     (hl),2

Set Breakpoint

Set a breakpoint address. Write 3 to address 0xffffff. Register DE = breakpoint address.

    scf
    sbc    hl,hl
    ld     de,label
    ld     (hl),3

Remove Breakpoint

Remove a breakpoint address. Write 4 to address 0xffffff. Register DE = breakpoint address.

    scf
    sbc    hl,hl
    ld     de,label
    ld     (hl),4

Set Read Watchpoint

Set a read watchpoint address. Write 5 to address 0xffffff. Register DE = watchpoint address. Register C = Display length.

    scf
    sbc    hl,hl
    ld     de,label
    ld     c,2
    ld     (hl),5

Set Write Watchpoint

Set a write watchpoint address. Write 6 to address 0xffffff. Register DE = watchpoint address. Register C = Display length.

    scf
    sbc    hl,hl
    ld     de,label
    ld     c,2
    ld     (hl),6

Set Read/Write Watchpoint

Set a read/write watchpoint address. Write 7 to address 0xffffff. Register DE = watchpoint address. Register C = Display length.

    scf
    sbc    hl,hl
    ld     de,label
    ld     c,2
    ld     (hl),7

Set Watchpoint

Set a non-breaking watchpoint address. Write 11 to address 0xffffff. Register DE = watchpoint address. Register C = Display length.

    scf
    sbc    hl,hl
    ld     de,label
    ld     c,2
    ld     (hl),11

Remove Watchpoint

Remove watchpoint address. Write 8 to address 0xffffff. Register DE = watchpoint address.

    scf
    sbc    hl,hl
    ld     de,label
    ld     (hl),8

Remove All Breakpoints

Removes all current breakpoints. Write 9 to address 0xffffff.

    scf
    sbc    hl,hl
    ld     (hl),9

Remove All Watchpoints

Removes all current watchpoints. Write 10 to address 0xffffff.

    scf
    sbc    hl,hl
    ld     (hl),10