4 ; Dump a register block
6 ; © 1994-1998 Straylight
9 ;----- Licensing note -------------------------------------------------------
11 ; This file is part of Straylight's core library (corelib).
13 ; Corelib is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
18 ; Corelib is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
23 ; You should have received a copy of the GNU General Public License
24 ; along with Corelib. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 ; Standard routine - displays contents of a register save block. May be
32 ; Parameters: R0 == pointer to block of 16 words, for value of R0-R15
33 ; R1 == pointer to string to display
35 ; On exit: Most registers corrupted.
37 ; Notes: Use DUMP macro to set up the call. This will preserve all
38 ; registers and set up the save block etc. This code will
39 ; be inserted only if necessary.
45 hdr_regDump MOV R8,R14 ;Store link
47 MOV R9,R0 ;Point to reg dump
48 MOV R10,#0 ;Register number
49 SWI XOS_WriteS ;Display header
51 DCB "------------------------------------------"
53 DCB "Register dump follows...",0
55 MOV R0,R1 ;Show message from macro
56 SWI XOS_Write0 ;Show it
59 DCB "------------------------------------------"
62 00 ADRL R0,%f89 ;Point to reg name table
63 ADD R0,R0,R10,LSL #2 ;Point to correct one
64 SWI XOS_Write0 ;Print on the screen
65 SWI XOS_WriteS ;Display next bit
66 DCB " == ",0 ;What to display
68 LDR R0,[R9,R10,LSL #2] ;Get register contents
69 CMP R10,#15 ;Is this the PC?
70 BICEQ R0,R0,#&FC000003 ;Yes - clear out PSR
72 MOV R2,#16 ;Length of buffer
73 SWI XOS_ConvertHex8 ;Convert
74 SWI XOS_Write0 ;Show on screen
75 SWI XOS_NewLine ;Start a new line
76 CMP R10,#15 ;Have we finished?
77 ADDNE R10,R10,#1 ;No: move to next register
81 SWI XOS_WriteS ;Display a message
82 DCB "Processor mode: ",0
84 LDR R7,[R9,R10,LSL #2] ;Get the number again
85 AND R1,R7,#&3 ;Get the processor mode
86 ADR R0,%f87 ;Point to message table
87 ADD R0,R0,R1,LSL #2 ;Get appropriate one
105 DCB "Other flags: ",0
125 DCB "Press any key to continue execution...",0
133 DCB "enabled",13,10,0
135 DCB "disabled",13,10,0
144 % 16 ;Block for translation