name "binaire"   ; output file name (max 8 chars for DOS compatibility)

mov al, 00000011b

mov cl, 11111111b

label1:
   
   mov bl, 10000000b
   and bl, al
   
   cmp bl, 0
   jz label3
   
   mov bl,al
   mov dl, '1'
   mov ah, 2
   int 21h
   mov al, bl
   
   jmp suite
   
label3:
   
   mov bl,al
   mov dl, '0'
   mov ah, 2
   int 21h
   mov al, bl
   
suite:
   
   SHL al, 1
   
   mov bl, cl
   cmp bl, 0 
   
   jz end
   shr cl, 1
   
   LOOP label1

end:
int 21h

mov ah, 0
int 16h

msg         db "press any key..."
msg_size =  $ - offset msg