xFunKy

Keren

Mar 31st, 2012
75
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.     x dw 2
  7.     y dw 3
  8.     putIn dw ?
  9.     arr dw 10 dup ('AA')
  10. ends
  11.  
  12. stack segment
  13.     dw   128  dup(0)
  14. ends
  15.  
  16. code segment
  17. start:
  18. ; set segment registers:
  19.     mov ax, data
  20.     mov ds, ax
  21.     mov es, ax
  22.  
  23.     ; add your code here
  24.    
  25.     mov cx, 10
  26.     mov bx, 0
  27.     L:
  28.         call Kefel
  29.         mov ax, putIn
  30.         mov arr[bx], ax
  31.         inc y
  32.         add bx, 2
  33.         loop L
  34.    
  35.            
  36.     lea dx, pkey
  37.     mov ah, 9
  38.     int 21h        ; output string at ds:dx
  39.    
  40.     ; wait for any key....    
  41.     mov ah, 1
  42.     int 21h
  43.    
  44.     mov ax, 4c00h ; exit to operating system.
  45.     int 21h    
  46. ends        
  47.  
  48. Kefel PROC
  49.     push cx
  50.     mov cx, y
  51.     mov ax, 0
  52.     Lolaa:
  53.         add ax,x
  54.         loop Lolaa
  55.     mov putIn, ax
  56.     pop cx  
  57.     ret
  58. Kefel endp
  59.  
  60.    
  61. end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment