code segment
assume cs:code
main proc far
push ds
xor ax,ax
push ax
call input
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
call change
ret
main endp
input proc near
mov cx,8
mov bx,0
L1:shl bx,1
mov ah,1
int 21h
sub al,30h
cbw
add bx,ax
loop L1
ret
input endp
change proc near
not bx
add bx,1
mov cx,8
L2:shl bl,1
jc dig
mov dl,30h
jmp out1
dig:mov dl,31h
out1:mov ah,2
int 21h
loop L2
ret
change endp
code ends
end main
assume cs:code
main proc far
push ds
xor ax,ax
push ax
call input
mov ah,2
mov dl,10
int 21h
mov dl,13
int 21h
call change
ret
main endp
input proc near
mov cx,8
mov bx,0
L1:shl bx,1
mov ah,1
int 21h
sub al,30h
cbw
add bx,ax
loop L1
ret
input endp
change proc near
not bx
add bx,1
mov cx,8
L2:shl bl,1
jc dig
mov dl,30h
jmp out1
dig:mov dl,31h
out1:mov ah,2
int 21h
loop L2
ret
change endp
code ends
end main