From f7d3d5c62f7bd67fe8035581f82a23beb0003b19 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Fri, 17 Apr 2020 23:59:57 +0200 Subject: [PATCH] Fix addressing mistake when splitting MCB --- kernel/mcb.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/mcb.asm b/kernel/mcb.asm index 3d089a8..a0d5ae4 100644 --- a/kernel/mcb.asm +++ b/kernel/mcb.asm @@ -26,6 +26,7 @@ mcb_init: mcb_split: call mcb_find dec dx + push dx ; Calculate size of first block ; dx = dx - ds - 1 stc @@ -40,9 +41,10 @@ mcb_split: xchg cl, byte [si+0] ; advance DS to begin of first block pop ax - mov ds, ax stc sbb dx, ax + pop ax + mov ds, ax ; write MCB data mov byte [si+0], cl mov word [si+1], 0