Real mode assembly I: Difference between revisions

Added "use16" line. Fixed segments, so memory below the bootloader can be used
[unchecked revision][unchecked revision]
(Should have corrected instead. Offset is always the same, regardless of sector size.)
(Added "use16" line. Fixed segments, so memory below the bootloader can be used)
Line 26:
 
<source lang="asm">
org 0x7C00 ; add 0x7C00 to label addresses
mov ax, 0x07C0 ; set up segments
use16 ; tell the assembler we want 16 bit code
 
mov ax, 0x07C00 ; set up segments
mov ds, ax
mov es, ax
mov ss, ax ; setup stack
mov sp, 0xFFF0 ; stack grows downwards from 0xFFF0
mov si, welcome
Anonymous user