daily pastebin goal
34%
SHARE
TWEET

DHORMO

a guest Feb 14th, 2018 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; You may customize this and other start-up templates;
  2. ; The location of this template is c:\emu8086\inc\0_com_template.txt
  3.  
  4. org 100h
  5.  
  6. .MODEL SMALL
  7.  
  8. .STACK 100H
  9.  
  10. .DATA
  11.  
  12. MSG1 DB 'The sum of '
  13. X DB ?
  14. MSG2 DB ' and '
  15. Y DB ?
  16. MSG3 DB ' is $'
  17.  
  18. .CODE
  19.  
  20. MAIN PROC
  21.     MOV AX,@DATA ;INITIALIZE
  22.     MOV DS,AX
  23.    
  24.     MOV AH,2
  25.     MOV DL,'?'
  26.     INT 21H
  27.    
  28.     ;INPUT-1
  29.    
  30.     MOV AH,1
  31.     INT 21H
  32.     MOV BL,AL
  33.     MOV X,BL
  34.     ;INPUT-2
  35.    
  36.     MOV AH,1
  37.     INT 21H
  38.     MOV BH,AL
  39.     MOV Y,BH
  40.    
  41.     ;ADD
  42.     ADD BL,BH ;BL=BL+BH
  43.    
  44.     SUB BL,48 ;SUB
  45.    
  46.     ;PRINT
  47.    
  48.     MOV AH,2
  49.     MOV DL,0DH ;CARRIAGE RETURN
  50.     INT 21H
  51.     MOV DL,0AH  ;LINE FEED
  52.     INT 21H
  53.    
  54.     ;DISPLAY
  55.    
  56.     LEA DX,MSG1
  57.     MOV AH,9
  58.     INT 21H
  59.    
  60.      
  61.     MOV AH,2
  62.     MOV DL,BL
  63.     INT 21H
  64.      
  65.    
  66.    
  67.     MAIN ENDP
  68. END MAIN
  69.  
  70. ret
RAW Paste Data
Top