monitor: jump command now does an actual exit and jump

This commit is contained in:
Ry 2023-03-30 17:36:15 -07:00
parent 365455a767
commit 5729ff6c71
2 changed files with 47 additions and 5 deletions

View File

@ -9,8 +9,4 @@ monitor_shell_jump_command:
; r0: address
call r0
call redraw_monitor_console
ret
jmp exit_monitor_and_jump

View File

@ -129,6 +129,52 @@ exit_monitor:
ret
exit_monitor_and_jump:
; restore the old RSP and vsync handler
mov rsp, [MONITOR_OLD_RSP]
mov [0x000003FC], [MONITOR_OLD_VSYNC_HANDLER]
; reset the cursor
call enable_cursor
; save the jump address in a temporary location
mov [MONITOR_OLD_RSP], r0
pop r0
pop r1
pop r2
pop r3
pop r4
pop r5
pop r6
pop r7
pop r8
pop r9
pop r10
pop r11
pop r12
pop r13
pop r14
pop r15
pop r16
pop r17
pop r18
pop r19
pop r20
pop r21
pop r22
pop r23
pop r24
pop r25
pop r26
pop r27
pop r28
pop r29
pop r30
pop r31
jmp [MONITOR_OLD_RSP]
invoke_monitor_aleady_in_monitor:
call redraw_monitor_console
ret