SHARE
TWEET

binary read input and write output

RA_Rownok Dec 3rd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .stack 100h
  3. .data
  4.  
  5. .code
  6.  
  7. main proc
  8.     mov bx,0
  9.     mov cl,1
  10.  
  11.     top:
  12.     mov ah,1
  13.     int 21h
  14.      
  15.     cmp al,0dh
  16.     je end
  17.      
  18.     sub al,30h
  19.      
  20.     shl bx,cl
  21.     or bl,al
  22.  
  23.     jmp top
  24.      
  25.     end:  
  26.     mov ah,2
  27.     mov dl,0ah
  28.     int 21h
  29.     mov dl,0dh
  30.     int 21h
  31.  
  32.     mov cl,1
  33.     mov ch,0
  34.    
  35.     output:
  36.     cmp ch,16
  37.     je finish
  38.     inc ch
  39.     shl bx,cl
  40.     jc one
  41.        
  42.        
  43.     mov ah,2
  44.     mov dl,30h
  45.     int 21h
  46.     jmp output
  47.        
  48.     one:
  49.     mov ah,2
  50.     mov dl,31h
  51.         int 21h
  52.         jmp output
  53.  
  54.     finish:  
  55.     mov ah,4ch
  56.     int 21h
  57.            
  58.    
  59.     main endp
  60. end main
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top