Advertisement
rafid_shad

chapter 7 ex 9

Dec 11th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. include 'emu8086.inc'
  2. .model small
  3. .stack 100h
  4. .code
  5. main proc
  6.     print 'Give a character '
  7.     mov ah,1
  8.     int 21h
  9.     mov bl,al
  10.    
  11.     gotoxy 0,1
  12.    
  13.     print 'ascii code in binary '
  14.    
  15.     mov bh,0
  16.     mov cx,8
  17.     mov ah,2
  18.    
  19.  L1:
  20.    shl bl,1
  21.    jc L2
  22.    mov dl,'0'
  23.    int 21h
  24.    jmp L3
  25.  gotoxy 0,2
  26.  L2:
  27.    mov dl,'1'
  28.    int 21h
  29.    inc bh
  30.  L3:
  31.    loop L1
  32.    
  33.    
  34.    
  35.    
  36.     exit:
  37.     mov ah,4ch
  38.     int 21h
  39.     main endp
  40. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement