Task

Create and display the sequence of binary digits for a given   non-negative integer.

   The decimal value      5   should produce an output of               101
   The decimal value     50   should produce an output of            110010
   The decimal value   9000   should produce an output of    10001100101000

The results can be achieved using built-in radix functions within the language   (if these are available),   or alternatively a user defined function can be used.

The output produced should consist just of the binary digits of each number followed by a   newline.

There should be no other whitespace, radix or sign markers in the produced output, and leading zeros should not appear in the results.




        .model  tiny
        .code
        .486
        org     100h
start:  mov     ax, 5
        call    binout
        call    crlf
        mov     ax, 50
        call    binout
        call    crlf
        mov     ax, 9000
        call    binout
 
crlf:   mov     al, 0Dh         ;new line
        int     29h
        mov     al, 0Ah
        int     29h
        ret
 
binout: push    ax
        shr     ax, 1
        je      bo10
         call   binout
bo10:   pop     ax
        and     al, 01h
        or      al, '0'
        int     29h             ;display character
        ret
        end     start