Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %macro change_es 1
- push ax
- mov ax, %1
- mov es, ax
- pop ax
- %endmacro
- TestA20:
- push es
- change_es 0
- mov ax, word [es:0x7DFE]
- change_es 0xFFFF
- mov bx, word [es:0x7E0E]
- cmp ax, bx
- jne .not_enabled
- change_es 0
- ror byte [es:0x7DFE], 8
- mov ax, word [es:0x7DFE]
- change_es 0xFFFF
- mov bx, word [es:0x7E0E]
- ; restore boot signature
- change_es 0
- rol word [es:0x7DFE], 8
- cmp ax, bx
- jne .not_enabled
- .enabled:
- mov ax, 0
- jmp .done
- .not_enabled:
- mov ax, 1
- .done:
- pop es
- ret
Add Comment
Please, Sign In to add comment