From f24a4e630aca1d699fd748b22977c549c4837c55 Mon Sep 17 00:00:00 2001 From: Elliot Nunn Date: Sun, 22 Nov 2020 10:17:14 +0800 Subject: [PATCH] Add a snippet to show MicroBug at early boot --- CallMicroBug.a | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CallMicroBug.a diff --git a/CallMicroBug.a b/CallMicroBug.a new file mode 100644 index 0000000..a8486ac --- /dev/null +++ b/CallMicroBug.a @@ -0,0 +1,14 @@ +; A snippet that you can INCLUDE directly, to invoke MicroBug at early boot, +; when otherwise you would get a Sad Mac. Trick is to init the Event Queue. +; Expect 8 bytes of unfamiliar stuff on the stack and some clobbered regs. + +; If you use this as a function, don't forget to RTS! + + move.w #20,d0 ; number of events + dc.w $A06D ; _InitEvents + + move.l $2BA,-(SP) ; save DSAlertTab + move.l #-1,$2BA ; because it needs to be nonzero + move.w #13,d0 ; as if we called _Debugger while it was unimp + dc.w $A9C9 ; _SysError + move.l (SP)+,$2BA ; restore DSAlertTab