summaryrefslogtreecommitdiff
path: root/src/nasty.S
diff options
context:
space:
mode:
Diffstat (limited to 'src/nasty.S')
-rw-r--r--src/nasty.S41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/nasty.S b/src/nasty.S
index 9fdab5f..f3d958e 100644
--- a/src/nasty.S
+++ b/src/nasty.S
@@ -106,3 +106,44 @@ DEFINE_ISRS
isr_stubs:
DEFINE_ISRS
#undef ISR
+
+.section .text
+.global dump_regs
+dump_regs:
+ mov [rdi+0], rax
+ mov [rdi+8], rbx
+ mov [rdi+16], rcx
+ mov [rdi+24], rdx
+ mov [rdi+32], rsi
+ mov [rdi+40], rdi
+ mov [rdi+48], rsp
+ mov [rdi+56], rbp
+ mov [rdi+64], r8
+ mov [rdi+72], r9
+ mov [rdi+80], r10
+ mov [rdi+88], r11
+ mov [rdi+96], r12
+ mov [rdi+104], r13
+ mov [rdi+112], r14
+ mov [rdi+120], r15
+ lea rax, [rip]
+ mov [rdi+128], rax
+ pushf
+ pop [rdi+136]
+ mov rax, cr0
+ mov [rdi+144], rax
+ mov rax, cr2
+ mov [rdi+152], rax
+ mov rax, cr3
+ mov [rdi+160], rax
+ mov rax, cr4
+ mov [rdi+168], rax
+ mov rax, cr8
+ mov [rdi+176], rax
+ mov [rdi+184], cs
+ mov [rdi+186], ds
+ mov [rdi+188], ss
+ mov [rdi+190], es
+ mov [rdi+192], fs
+ mov [rdi+194], gs
+ ret