Commit bc963b02 authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL
Browse files

Allow arbitrary errors to be fed into DumpyTheRegisters

parent e7152ebd
......@@ -622,7 +622,7 @@ PrintErrorString
DumpyTheRegisters ROUT
; R0 points at r8 in register dump. r0-r7, PC, PSR saved
; R1 is PSR
; R4 is offset from saved PC for error message
; R4 is offset from saved PC for error message, or -1 if error should be used verbatim
; R14 points at error block
; In ABT32 or UND32
MOV R7, R14 ; put error address into unbanked register
......@@ -713,6 +713,19 @@ UNDEF1
LDR R1, [R0, #15*4]
Push R1
CMP r4, #-1
; Custom error provided, try and copy it to the stack to make sure it
; doesn't get overwritten before we're able to report it (there's a
; chance it's in a shared MessageTrans buffer)
LDR r10, =ZeroPage
LDRB r10, [r10, #ErrorSemaphore]
TEQ r10, #0
MOV r0, r14 ; Error block to copy from
MOVNE r10, r14 ; !=R0 if we want to copy, = if we don't
B %FT11 ; Jump to the copy check
LDR R0, =GeneralMOSBuffer+128 ; so can do deviant sharing !
[ International
......@@ -756,6 +769,7 @@ UNDEF1
; before we're able to call OS_GenerateError. Copy the error to the
; stack, then copy it back into a MessageTrans block before calling
; OS_GenerateError.
EORS R4, R0, R10 ; Did TranslateError work?
SUB SP, SP, #256
......@@ -763,12 +777,12 @@ UNDEF1
MOV R5, #4
LDR R6, [R0]
STR R6, [R4]
LDRB R6, [R0, R5]
CMP R6, #0
STRB R6, [R4, R5]
ADD R5, R5, #1
MOV R0, R4
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment