; Pass an array of 7 bytes by reference. Initialize it to 1,2,3,4,5,6,7

IDEAL
MODEL small
STACK 20h
DATASEG
                                        
arr db 7 dup (?)


CODESEG
;------------------------------------------------------------------------------------
proc          initarr
              push bp
              mov  bp,sp  
              mov  bx,[bp+4]            ; get the address of the array beginning 
              mov  al,1
              mov  cx,7
startloop:
              mov [bx],al              
              inc bx  
              inc al
              loop startloop        
              pop bp
              ret 2       
endp          initarr
;------------------------------------------------------------------------------------

start:        mov ax, @data
              mov ds, ax
            
              mov  bx, offset arr
              push bx
              call initarr 

exit:         mov ax, 4c00h
              int 21h
END start   