Guest User

Bagroot 8/2007 Tikun

a guest
May 8th, 2012
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multi-segment executable file template.
  2.  
  3. data segment
  4.     ; add your data here!
  5.     pkey db "press any key...$"
  6.     A DB 11 DUP (?)
  7. ends
  8.  
  9. stack segment
  10.     dw   128  dup(0)
  11. ends
  12.  
  13. code segment
  14. start:
  15. ; set segment registers:
  16.     mov ax, data
  17.     mov ds, ax
  18.     mov es, ax
  19. // הקוד
  20.     ; add your code here        
  21.     mov di, 0
  22.     mov al, 0          
  23.     mov bl, 0    
  24.    
  25.  K:
  26.     cmp di, 10
  27.     je finish
  28.     mov al, A[di]
  29.     add di, 1
  30.     add al, A[di]      
  31.     cmp bl, al
  32.     jbe K
  33.     mov bl, al
  34.     jmp K
  35.        
  36.  finish:  
  37.     mov al, bl
  38.    // סוף הקוד  
  39.  
  40.        
  41.     lea dx, pkey
  42.     mov ah, 9
  43.     int 21h        ; output string at ds:dx
  44.    
  45.     ; wait for any key....    
  46.     mov ah, 1
  47.     int 21h
  48.    
  49.     mov ax, 4c00h ; exit to operating system.
  50.     int 21h    
  51. ends
  52.  
  53. end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment