throw trap_illegal_instruction(0); \
(which); })
+// Seems that 0x0 doesn't work.
#define DEBUG_START 0x100
-#define DEBUG_ROM_START 0x800
-#define DEBUG_ROM_RESUME (DEBUG_ROM_START + 4)
-#define DEBUG_ROM_EXCEPTION (DEBUG_ROM_START + 8)
-#define DEBUG_ROM_END (DEBUG_ROM_START + debug_rom_raw_len)
-#define DEBUG_RAM_START 0x400
-#define DEBUG_RAM_SIZE 64
-#define DEBUG_RAM_END (DEBUG_RAM_START + DEBUG_RAM_SIZE)
-#define DEBUG_END 0xfff
-#define DEBUG_CLEARDEBINT 0x100
-#define DEBUG_SETHALTNOT 0x10c
-#define DEBUG_SIZE (DEBUG_END - DEBUG_START + 1)
+
+#define DEBUG_DATA_START 0x380
+#define DEBUG_DATA_SIZE 0x20
+#define DEBUG_DATA_END DEBUG_DATA_START + DEBUG_DATA_SIZE
+
+#define DEBUG_PROGBUF_SIZE 32
+#define DEBUG_PROGBUF_START DEBUG_DATA_START - DEBUG_PROGBUF_SIZE
+#define DEBUG_PROGBUF_END DEBUG_PROGBUF_START + DEBUG_PROGBUF_SIZE
+
+#define DEBUG_ABSTRACT_SIZE 2*4
+#define DEBUG_ABSTRACT_START (DEBUG_PROGBUF_START - DEBUG_ABSTRACT_SIZE)
+#define DEBUG_ABSTRACT_END (DEBUG_ABSTRACT_START + DEBUG_ABSTRACT_SIZE)
+
+#define DEBUG_END (0x1000 - 1)
#endif