Skip to content

Commit 5055b65

Browse files
committed
Correct register restore order in RESTORE_REGISTER and portRESTORE_CONTEXT
1 parent e400cc9 commit 5055b65

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

portable/CCRH/F1Kx/portasm.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ portRESTORE_CONTEXT .macro
107107
; Jump over next 3 instructions: stsr (4 bytes)*2 + popsp (4 bytes)
108108
bz 12
109109
popsp r18, r19
110-
ldsr r18, FPEPC
111-
ldsr r19, FPSR
110+
ldsr r19, FPEPC
111+
ldsr r18, FPSR
112112

113113
;Restore general-purpose registers and EIPSW, EIPC, EIIC, CTPSW, CTPC
114114
popsp r15, r19
@@ -161,13 +161,13 @@ SAVE_REGISTER .macro
161161
;------------------------------------------------------------------------------
162162
RESTORE_REGISTER .macro
163163

164-
mov FPU_MSK, r16
164+
mov FPU_MSK, r19
165165
stsr PSW, r18
166166
tst r18, r19
167167
bz 12
168168
popsp r18, r19
169-
ldsr r18, FPEPC
170-
ldsr r19, FPSR
169+
ldsr r19, FPEPC
170+
ldsr r18, FPSR
171171

172172
popsp r13, r19
173173
ldsr r13, CTPC

0 commit comments

Comments
 (0)