October 4th, 2012, 11:37 PM
Join Date: Oct 2012
Time spent in forums: 11 m 40 sec
Reputation Power: 0
Small Assembler programming help
mov ax, 2 ;initialize bx to 2(stores successive even numbers)
mov bx, 2 ;initialize ax(stores sum of successive even numbers)
mov cx, 3 ;initialize cx to 3 or 5 (number of times loop body executes)
;Execute the loop body cx times
One number at at time starting with 2, generate successive even integers in bx.
Total the N even integers in ax.
If cx is assigned 3, ax should end as 12 (which is C in hex)
If cx is assigned 5, ax should end as 30 (that is 1E in hex).