SHARE
TWEET

Chaper 6 EX 9

rafid_shad Dec 11th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .model small
  2. .data
  3. msg1 db 'Enter a Character from A to F: $'
  4. msg2 db 0ah,0dh, 'Decimal it is: 1$'
  5.  
  6. char db ?
  7. .code
  8. main proc
  9.    mov ax,@data
  10.    mov ds,ax  
  11.    
  12.    lea dx,msg1
  13.    mov ah,9      ;print msg1
  14.    int 21h
  15.    
  16.    
  17.    mov ah,1
  18.    int 21h       ;Get input
  19.    mov char,al
  20.    
  21.    lea dx,msg2   ;print msg2
  22.    mov ah,9
  23.    int 21h
  24.    
  25.    mov ah,2
  26.    sub char,17
  27.    mov dl,char   ;print output
  28.    int 21h
  29.    
  30.    ;mov ah,4ch
  31.    ;int 21h
  32.    
  33.    main endp
  34. 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