.model small
.data
num db 16
arr db 8 dup(0)
cntr db 0
two db 2
.code
mov ax,@data
mov ds,ax
mov BX,0000
mov ax,0000
mov al,num
L1:
div two
mov BYTE PTR arr[BX],ah
mov ah,00
add cntr,1
add BX,1
cmp al,00
ja L1
mov al,00
mov BX,4
mov ah,arr[BX]
cmp ah,1
je one
mov ah,00
jmp ext
one:
mov ah,255
ext:
mov ax,4C00h
int 21h
end