ALP to Check whether system is in Real or Protected mode (WITHOUT USING MACRO)


section .data
    msg1 db " System is in Protected mode",10,13
    len1 equ $-msg1
  
msg2 db "System is in real mode: "
    len2 equ $-msg2

section .text
global _start
_start:
        smsw eax
        rcr eax,01
        jc x1
   
        mov eax,4
        mov ebx,1
        mov ecx,msg2
        mov edx,len2
        int 80h   

        jmp x2

x1:     mov eax,4
        mov ebx,1
        mov ecx,msg1
        mov edx,len1
        int 80h   

x2:     mov eax,0
        mov ebx,1
        int 80h 
SHARE
    Blogger Comment
    Facebook Comment