From 910ada89f0f612bdab54b8a40f503102709caf16 Mon Sep 17 00:00:00 2001 From: Eric Semeniuc <3838856+esemeniuc@users.noreply.github.com> Date: Sun, 23 Dec 2018 18:34:20 -0800 Subject: [PATCH] Add explanation about -2 --- 04-bootsector-stack/boot_sect_stack.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04-bootsector-stack/boot_sect_stack.asm b/04-bootsector-stack/boot_sect_stack.asm index 5bff2ab..f676da0 100644 --- a/04-bootsector-stack/boot_sect_stack.asm +++ b/04-bootsector-stack/boot_sect_stack.asm @@ -3,12 +3,12 @@ mov ah, 0x0e ; tty mode mov bp, 0x8000 ; this is an address far away from 0x7c00 so that we don't get overwritten mov sp, bp ; if the stack is empty then sp points to bp -push 'A' +push 'A' ; pushes 2 bytes onto the top of the stack since the CPU is in 16bit mode push 'B' push 'C' ; to show how the stack grows downwards -mov al, [0x7ffe] ; 0x8000 - 2 +mov al, [0x7ffe] ; 0x8000 - 2 (each character takes 2 bytes due to 16bit boundaries) int 0x10 ; however, don't try to access [0x8000] now, because it won't work