How 16 bit programs are works fine with 32 bit register (EBP ESP etc) ?
For example,
Code: Select all
push ebp ; save EBP reg value
mov ebp, esp ; move ESP reg value in to EBP reg
mov esp, ebp ; restore ESP reg value from EBP reg
pop ebp ; restore EBP reg value
Some more information about environment:
Code complied with NASM compiler
Code started withnasm main.asm -o main.com
BITS 16
[ORG 0]