mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
130 lines
2.2 KiB
Plaintext
130 lines
2.2 KiB
Plaintext
; The OS/K Team licenses this file to you under the MIT license.
|
|
; See the LICENSE file in the project root for more information.
|
|
|
|
dumprf:
|
|
push rbp
|
|
mov rbp, rsp
|
|
|
|
push r12, r13
|
|
mov r12, ax0
|
|
mov r13, rsp
|
|
|
|
call RFS.LoadReg, r12, $cr2
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $cr1
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $cr0
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rfx
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rip
|
|
push rax
|
|
|
|
push r12
|
|
call printf, .dmp1
|
|
|
|
call RFS.LoadReg, r12, $srp
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $trp
|
|
push rax
|
|
|
|
push 0 # fixme
|
|
|
|
call RFS.LoadReg, r12, $rbp
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rsp
|
|
push rax
|
|
|
|
call printf, .dmp2
|
|
|
|
call RFS.LoadReg, r12, $ax5
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $ax4
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $ax3
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $ax2
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $ax1
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $ax0
|
|
push rax
|
|
|
|
call printf, .dmp3
|
|
|
|
call RFS.LoadReg, r12, $rdi
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rsi
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rdx
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rcx
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rbx
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $rax
|
|
push rax
|
|
|
|
call printf, .dmp4
|
|
|
|
call RFS.LoadReg, r12, $r17
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r16
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r15
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r14
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r13
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r12
|
|
push rax
|
|
|
|
call printf, .dmp5
|
|
|
|
call RFS.LoadReg, r12, $r20
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r19
|
|
push rax
|
|
|
|
call RFS.LoadReg, r12, $r18
|
|
push rax
|
|
|
|
call printf, .dmp6
|
|
|
|
mov rsp, r13
|
|
pop r13, r12
|
|
|
|
leave
|
|
ret
|
|
|
|
.dmp1 = "Environ #1:\nfrm=0d%d rip=0x%x rfx=0x%x\ncr0=0x%x cr1=0x%x cr2=0x%x\n\n"
|
|
.dmp2 = "Environ #2:\nrsp=0x%x rbp=0x%x ind=0d%d\ngrp=0x%x trp=0x%x srp=0x%x\n\n"
|
|
.dmp3 = "Argument:\nr12=0x%x ax1=0x%x ax2=0x%x\nax3=0x%x ax4=0x%x ax5=0x%x\n\n"
|
|
.dmp4 = "Volatile:\nrax=0x%x rbx=0x%x rcx=0x%x\nrdx=0x%x rsi=0x%x rdi=0x%x\n\n"
|
|
.dmp5 = "Persistent:\nr12=0x%x r13=0x%x r14=0x%x\nr15=0x%x r16=0x%x r17=0x%x\n"
|
|
.dmp6 = "r18=0x%x r19=0x%x r20=0x%x\n"
|
|
|