Guest User

Untitled

a guest
Jun 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multi-segment executable file template.
  2.        
  3. INCLUDE 'emu8086.inc'
  4.      
  5. data segment
  6. ; add your data here!
  7.  
  8. pkey db "press any key...$"                
  9. msga db "inserire il valore a: $",10,13
  10. msgb db "inserire il valore b: $",10,13
  11. msgc db "inserire il valore c: $",10,13
  12. msgd db "inserire il valore d: $",10,13
  13. a db (00)
  14. b db (00)
  15. c db (00)
  16. d db (00)
  17.      
  18. ends
  19.      
  20. stack segment
  21. dw   128  dup(0)
  22. ends
  23.    
  24. code segment
  25. start:
  26. ; set segment registers:
  27.  
  28. mov ax, data
  29. mov ds, ax
  30. mov es, ax
  31.      
  32. ; add your code here
  33.  
  34. ;carica_a
  35.           lea dx,msga
  36.           mov ah,9
  37.           int 21h                    
  38.        
  39.           mov ah,1
  40.           int 21h  
  41.           call controllo
  42.           xor ax, ax  
  43.          
  44. ;carica_b        
  45.           lea dx,msgb
  46.           mov ah,9
  47.           int 21h                    
  48.        
  49.           mov ah,1
  50.           int 21h  
  51.           call controllo
  52.           xor ax, ax
  53.          
  54. ;carica_c        
  55.           lea dx,msgc
  56.           mov ah,9
  57.           int 21h                    
  58.        
  59.           mov ah,1
  60.           int 21h  
  61.           call controllo
  62.           xor ax, ax
  63.          
  64. ;carica_d      
  65.           lea dx,msgd
  66.           mov ah,9
  67.           int 21h                    
  68.        
  69.           mov ah,1
  70.           int 21h  
  71.           call controllo
  72.           xor ax, ax  
  73.           jmp exit
  74.          
  75.          
  76.              
  77. controllo proc
  78.  
  79.         cmp al,48
  80.         je numero
  81.        
  82.         cmp al,49
  83.         je numero
  84.        
  85.         cmp al,50
  86.         je numero
  87.        
  88.         cmp al,51
  89.         je numero
  90.        
  91.         cmp al,52
  92.         je numero
  93.        
  94.         cmp al,53
  95.         je numero
  96.        
  97.         cmp al,54
  98.         je numero
  99.        
  100.         cmp al,55
  101.         je numero
  102.        
  103.         cmp al,56  
  104.         je numero
  105.        
  106.         cmp al,57
  107.         je numero
  108.        
  109.         call PTHIS
  110.         db 13, 10, "Non e' un numero",10,13, 0  
  111.        
  112.         je fine
  113.        
  114.      numero:
  115.             call PTHIS
  116.             db 13, 10, "e' un numero",10,13, 0
  117.             je fine
  118.            
  119.         fine: ret
  120.               controllo endp
  121.      
  122.                
  123.                              
  124. exit:
  125.         lea dx, pkey
  126.         mov ah, 9
  127.         int 21h        ; output string at ds:dx
  128.        
  129.  
  130.         ; wait for any key....    
  131.         mov ah, 1
  132.         int 21h
  133.        
  134.         mov ax, 4c00h ; exit to operating system.
  135.         int 21h    
  136.     ends
  137.      
  138.     DEFINE_PTHIS
  139.      
  140.     end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment