From 6e7a6563d53261846665b4738e76b9b2b7744df3 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Sun, 29 Sep 2019 21:33:28 +0000 Subject: [PATCH] Improve register hygiene --- kernel/bpb.asm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/bpb.asm b/kernel/bpb.asm index e3b70c5..f0213e5 100644 --- a/kernel/bpb.asm +++ b/kernel/bpb.asm @@ -1,16 +1,31 @@ ; IN DL drive number ; BP ptr to bpb_size'd buffer bpb_load: + push ax + push dx + mov [bp+(bpb_size-1)], dl + ; load first sector xor dx, dx xor ax, ax call drive_read + push cx + push si + push di + + ; copy BPB to BP mov si, (diskbuf+0x0B) mov di, bp mov cx, (bpb_size-1) rep movsb + pop di + pop si + pop cx + + pop dx + pop ax ret