Exceptions: Error in Pennell QDOS Companion
Posted: Fri Nov 24, 2017 4:12 pm
EDIT: Corrected typo in first draft! See Tobias' comment below.
I'm looking at some QLMultiMOn code from GitHub (Hi Jan) , it's in assembly, and handles exceptions. Always a bugbear of mine!
Most exceptions stack the following data on the SUPERVISOR SP, or A7 in the exception handler:
2(A7) = PC value that caused the exception.
0(A7) = Status Register value at exception time.
That's three words in total on the SSP.
There are a couple of exceptions in the QL that stack 4 extra words of information, BUS and ADDRESS. RESET is similar, but is ignored. These extra words give the stack the following appearance:
10(A7) = PC value that caused the exception.
8(A7) = Status Register value at exception time.
6(A7) = First word of instruction that barfed.
2(A7) = Address that was accessed to cause the exception.
0(A7) = Access type/Function code word.
Pennell on page 91, shows that the Address that was accessed and caused the exception is at 4(A7) when all my other books are 2(A7) as I have listed above, also, Pennell states that $0C(A7) is the PC value that caused the exception, and not $0A(A7) (or 10(A7)) as per my other books, and the above. Can someone please confirm that I am correct.
Cheers,
Norm.
I'm looking at some QLMultiMOn code from GitHub (Hi Jan) , it's in assembly, and handles exceptions. Always a bugbear of mine!
Most exceptions stack the following data on the SUPERVISOR SP, or A7 in the exception handler:
2(A7) = PC value that caused the exception.
0(A7) = Status Register value at exception time.
That's three words in total on the SSP.
There are a couple of exceptions in the QL that stack 4 extra words of information, BUS and ADDRESS. RESET is similar, but is ignored. These extra words give the stack the following appearance:
10(A7) = PC value that caused the exception.
8(A7) = Status Register value at exception time.
6(A7) = First word of instruction that barfed.
2(A7) = Address that was accessed to cause the exception.
0(A7) = Access type/Function code word.
Pennell on page 91, shows that the Address that was accessed and caused the exception is at 4(A7) when all my other books are 2(A7) as I have listed above, also, Pennell states that $0C(A7) is the PC value that caused the exception, and not $0A(A7) (or 10(A7)) as per my other books, and the above. Can someone please confirm that I am correct.
Cheers,
Norm.