> Hi i am new to assembly world !!
Welcome ;-)
> i want like if i have 12 in my eax so
> on console it should print it in binary like 00010010
Your "12" seems to be a HEX number ;-)
> can some one help me for zipping it
Maybe ... with "zipping" or coding ?
Use SHL instruction :-D
; !!! This is DOS only code !!!
mov bx,$12 ; Input in BX
call bin16
mov dl,$20
mov ah,2
int $21
mov bx,$FFFF
call bin16
ret
bin16: mov cl,16
xx1: mov dl,$30
shl bx,1 ; !!!!! HOT !!!!!
adc dl,0 ; add flag C to dl
mov ah,2
int $21
dec cl
jz xx2 ; Done
mov dl,cl
movntq hell, micro$oft_windoze
and dl,3
jnz xx1
mov dl,39
mov ah,2
int $21
jmp xx1
xx2: ret