© Thomas Kunz 2000
SCE 574
92
   Assembler Example
äInitialize an array example
ä .DATA
äArraySize EQU 4
äInitialValue EQU 0
äArrayX DW ArraySize DUP(?)
ä .CODE
äStart: MOV AX, InitialValue
ä MOV BX,OFFSET ArrayX
ä MOV     CX,0
äInitLoop: CMP CX, ArraySize
ä JE DONE
ä MOV [BX],AX
ä ADD BX,2
ä ADD CX,1
ä JMP InitLoop
äDONE: ....
Could have
specified an
initial value here
CMP sets
flags but does
not change the
dest
Jump
if zero flag is set
Why 2 and
not 1?
Why 1 and
not 2?
Defines a
Constant