INCLUDE 'EMU8086.INC'
.MODEL SMALL
.STACK 100H
.DATA
.CODE
MAIN PROC
MOV BX,0
MOV CL,4
;PRINT"ENTER THE HEX NUM "
MOV AH,1
FOR1:
INT 21H
CMP AL,0DH
JE END_FOR
.model small
.stack 100h
.data
msg db 'Enter the data in binary format $'
msg1 db 0dh,0ah,'output in binary form is : $'
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg
int 21h
CMP AL,41H
JGE LETTER
mov bx,0
mov cx,16
;DIGIT
SUB AL,48
JMP SHIFT
again:
LETTER:
SUB AL,37H
mov ah,01h
int 21h
cmp al,13
je printout
and al,0fh
shl bx,1
or bl,al
loop again
SHIFT:
SHL BX,CL ;NEW SPACE TO STORE
OR BL,AL
JMP FOR1
printout:
mov ah,09h
lea dx,msg1
int 21h
mov cx,16
disp:
END_FOR:
shl bx,1
PRINTN
jnc again1
;XOR CH,CH
MOV CX,4
MOV AH,2
mov dl,49
mov ah,02h
int 21h
jmp display
FOR2:
MOV DL,BH
SHR DL,4
SHL BX,4
again1:
mov dl,48
mov ah,02h
int 21h
CMP DL,10
JGE LETTER2
display:
loop disp
;DIGIT
ADD DL,48
INT 21H
JMP END_OF_LOOP2
LETTER2:
ADD DL,55
INT 21H
END_OF_LOOP2:
LOOP FOR2
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN mov ah,4ch
int 21h
main endp
end main
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}