CSCI 3211 Fall 2000 Programming Lab 1 Due 9/12/00 a) Assemble and single step with a debugger the program shown below. Establish the data window for program variables. Turn in a listing and the final debug window resulting from the execution of the program statements. The sum variable should show the appropriate value. b) Modify this program to meet the following requirements: The list of words is terminated by a vlue of -1 and the count value is unknown (uninitialized). The sum of the list should include all words up to, but not including, the -1 value. The count value will have the number of words accumulated in sum. If overflow occurs after any addition operation, the byte overflow should be set to 1 and the program terminated. See a) above for required lab report. See text for conditional branching instructios. The new data section should appear as follows: list dw 1,2,3,4,5,-1 count dw 0 overflow db 0 sum dw 0 Repeat part a for this new program. Program listing: ;**Program to add words in a list .MODEL small .STACK 100h .DATA ;** data section list dw 1,2,3,4,5 count dw 5 ; you could use count dw ($-(offset list))/2 ; or count equ ($-(offset list))/2 .CODE mov ax,@data ;standard beginning mov ds,ax ; ;*********** body of program (your code goes here!) mov si,0 ;initialize index for list mov ax,0 ;initialize accumulator for sum mov bx,count Start: ;a label used for brancing reference dec bx ;subtract 1 from current contents of bx js Endit ;conditional goto Endit when bx goes neg add ax,list[si] ;an array style reference to data add si,2 ;index adjusted to reference next word jmp Start ;unconditional goto Start Endit: mov sum,ax ;store accumulated value ;************ program logic ends mov ah,04ch ;standard ending int 21h ;standard ending END