daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Nov 5th, 2018 157 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100
  3.  
  4. .DATA
  5. TABLE   DW ONE
  6.         DW TWO
  7.         DW THREE
  8.  
  9. .CODE
  10. MOV AX, @DATA
  11. MOV DS, AX
  12.  
  13. DISP PROC
  14.     PUSHA
  15.    
  16.     MOV AH, 2
  17.     INT 21H
  18.    
  19.     POPA
  20.     RET
  21. DISP ENDP
  22.  
  23. ONE PROC
  24.     PUSH DX
  25.    
  26.     MOV DL, 'A'
  27.     CALL DISP
  28.    
  29.     POP DX
  30.     RET
  31. ONE ENDP
  32.  
  33. TWO PROC
  34.     PUSH DX
  35.    
  36.     MOV DL, 'B'
  37.     CALL DISP
  38.    
  39.     POP DX
  40.     RET
  41. TWO ENDP
  42.  
  43. THREE PROC
  44.     PUSH DX
  45.    
  46.     MOV DL, 'C'
  47.     CALL DISP
  48.    
  49.     POP DX
  50.     RET
  51. THREE ENDP
  52.  
  53. .STARTUP
  54.  
  55. TOP:
  56.     MOV AH, 1
  57.     INT 21H
  58.     SUB AL, 31H
  59.     JB TOP
  60.     CMP AL, 2
  61.     JA TOP
  62.     MOV AH, 0
  63.     MOV BX, AX
  64.     ADD BX, BX      ; BECAUSE THE ADDRESS IS DW NOT DB
  65.  
  66.     CALL TABLE[BX]
  67.    
  68.    
  69.     MOV AH, 4CH
  70.     INT 21H
  71.  
  72. END
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