From 35765897c4e15a6d5154389a12e801264cfe605e Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 6 May 2025 17:53:45 +0200 Subject: [PATCH] handler asm code for saving the volatile registers created --- interrupt/handlers.asm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/interrupt/handlers.asm b/interrupt/handlers.asm index 1a2f059..3207c0c 100644 --- a/interrupt/handlers.asm +++ b/interrupt/handlers.asm @@ -11,4 +11,27 @@ handle_keyboard_asm: ; continue. The C++ compiler will only generates code to preserve ; non-scratch registers in the high-level interrupt handler -- the scratch ; registers have to be saved (and restored later) manually! - ; TODO(12): Implement the context save and restore for the keyboard interrupt + ; TODO: Implement the context save and restore for the keyboard interrupt + ; + ; + push rax; + push rdi; + push rsi; + push rdx; + push rcx; + push r8; + push r9; + push r10; + push r11; + call handle_keyboard; + pop r11; + pop r10; + pop r9; + pop r8; + pop rcx; + pop rdx; + pop rsi; + pop rdi; + pop rax; + + iret ;