Guest User

Untitled

a guest
May 4th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multi-segment executable file template.
  2. include 'emu8086.inc'
  3.  
  4. ;Es4) Calcolare   a*16b  utilizzando opportunamente lo SHIF
  5.  
  6. data segment
  7.     ; add your data here!
  8.     a db ?
  9.     b db ?
  10.     due db 2
  11.    
  12.    
  13. ends
  14.  
  15. stack segment
  16.     dw   128  dup(0)
  17. ends
  18.  
  19. code segment
  20. start:
  21. ; set segment registers:
  22.     mov ax, data
  23.     mov ds, ax
  24.     mov es, ax
  25.  
  26.    
  27.     xor ax,ax
  28.     call pthis
  29.     db 13,10, 'Inserisci a:' ,0
  30.    
  31.      mov ah,1
  32.      int 21h
  33.      sub al,'0'
  34.      mov a,al
  35.     ;  
  36.     call pthis
  37.      db 13,10, 'Inserisci b:' ,0
  38.      mov ah,1
  39.      int 21h
  40.      sub al,'0'
  41.      mov b,al
  42.      ;
  43.       ;a*16b
  44.      xor ax,ax
  45.      mov bh,a
  46.      mov al,b
  47.      
  48.      mov cl,due
  49.      shl cl,4
  50.      
  51.      mul cl
  52.      mul bh
  53.      
  54.        ;RIS IN AX
  55.      
  56.      call pthis
  57.      db 13,10, 'a*16b :' ,0
  58.      mov dl,al
  59.      mov ah,2
  60.      add dl,'0'
  61.      int 21h
  62.        
  63.      
  64.  
  65.    
  66.    
  67.    exit:
  68.    
  69.     mov ax, 4c00h ; exit to operating system.
  70.     int 21h    
  71. ends
  72.          
  73. DEFINE_PTHIS        
  74. end start ; set entry point and stop the assembler.
Add Comment
Please, Sign In to add comment