Mzsmunna
10/16/2019 - 8:45 AM

BINARY


.MODEL SMALL
.STACK 100H
.DATA
     I DB 'INPUT: $' 
     O DB 'OUTPUT: $' 
     BB DB '00101111$'  
     S DB '___$'
     
     B DB  00101111B
     VAR DB 30H
     
.CODE

MAIN PROC
     
    MOV AX,@DATA
    MOV DS,AX
    
    MOV AH,9
    LEA DX,I
    INT 21H
    LEA DX,BB
    INT 21H   
    LEA DX,S
    INT 21H 
    LEA DX,O
    INT 21H 
    
   MOV BL,B
   JMP L_CMP 
    
   ; MOV CL,0
    
L_CMP:
     
    ADD VAR,1H
    CMP VAR,39H
    JGE EXIT
    
    SHL BL,1
    JC ONE
    JNC ZERO
    
ONE:
 
MOV AH,2
MOV DX,'1'
INT 21H 
JMP L_CMP

ZERO:
MOV AH,2
MOV DX,'O'
INT 21H
JMP L_CMP

EXIT:
     
    MOV AH,4CH
    INT 21H
    
    MAIN ENDP

END MAIN