;an array exercise illustrating:
;how to declarare and initialize an array
;how to build the asm equivalent of a for loop... can you figure out how it works?
;how to access array contents 2 ways... can you find the two ways?
; some esoterica about registers SI, DI, DS, and ES
; generating char output using the DOS interrupt ah=6, dl=char
.MODEL SMALL
   .STACK 100
   .DATA
   array db 10 dup (47) ; array is NOT a keyword
 

   .CODE
   arrayEX:
      mov  ax,@data
      mov  ds,ax
   mov es,ax
 &n bsp; ;set DS to point to the data segment... same for ES
      mov cx,10

      xor si,si; fastest way to zero
up:   add array[si],cl
      inc si
 
      loop up ;loop #1

   mov cx,10
      mov di,offset array
top: mov dl,[byte ptr di]
      inc di
     mov ah ,6
     int 21h
     loop top ;loop #2
   mov  ax,04c00h                      ;DOS terminate program function
   int  21h                         ;terminate the program
   END  ;   arrayEX