Compare numbers stored in Registers and Variables in Assembly


Write and run a program using 8086 assembly language that finds if the value stored in AL register is more than a value stored in a memory location; if it is more then AL register is cleared, otherwise AL register remains unchanged. [June 2013, Set-3]

DATA SEGMENT
    NUM DB 15H 
DATA ENDS

CODE SEGMENT
START:

    ASSUME CS:CODE, DS:DATA 
    MOV AX, DATA
    MOV DS, AX

    MOV AL, 9H
    MOV BL, NUM
    
    CMP AL,BL
    JG RESULT
    MOV AH, 4CH
    INT 21H
     
    
    RESULT: 
    MOV AL, 00000000B

    
    MOV AH, 4CH
    INT 21H  
      
CODE ENDS

END START