Question: changing PROC in my assembly program is not changing values of the NUMS table. Tables - NUMS WORD 0 9 EEBh, 0 B 0 CFh

changing PROC in my assembly program is not changing values of the NUMS table.
Tables-
NUMS WORD 09EEBh, 0B0CFh,061E5h,089EDh, 0AF17h,0D8D1h,06C1Dh,0594Eh,0CF55h
WORD 03767h,063C6h,0AE84h,0412Fh,0B226h,046C1h,0879Bh,076B6h,093FFh
WORD 0AFFFh, 05B8Fh,06164h,01CF7h,09A41h,0A525h,0A5A1h,08F05h,07E4Ch
WORD 0827Ah,090B0h,0722Dh,0BCCFh,033ABh, 0DC76h,085B6h,0AA5Fh,03FB3h
WORD 04BACh, 0B822h,07768h,0BF1Bh,05783h,07EEBh, 09F22h,0B85Bh,05312h
WORD 05971h,0B1B6h,0B16Dh,054B3h,073C8h,0586Bh,08170h,06F16h,092A0h
WORD 09680h,0A23Bh,0B45Dh,01E91h,0415Ah,0B5D9h,02D02h,06748h,03D39h
CHANGES WORD 4,3,0000Ch,0,8,00013h,3,6,000CAh, 5,8,009Fh,4,6,004Ah
WORD 0,3,00B8h,5,2,00B3h,1,3,00E1h,5,5,009Dh,4,1,000Dh
WORD 3,5,00C1h,2,8,00BFh,3,4,0020h,1,4,000Ah,4,6,001Ah
WORD 1,5,00F1h,2,3,00FEh, 1,5,003Eh,6,3,00FAh, 0,5,0008h
main PROC-
. code
main PROC ; control section of program
call printPromptNT
call printing ; Print unsorted output in 7 x 9 table format
call printPromptST
call sorting ; sort each row of NUMS table separately
call printing ; Print sorted output in 7 x 9 table format
call printPromptCT
call changing ; read CHANGES, add value to NUMS table
call printing ; Print changed output in 7 x 9 table format
COMMENT @
call printPromptSWT
call switching ; read SWITCHES, exchange NUMS table values
call printing ; Print switched output in 7 x 9 table format
@
exit
main ENDP
changing PROC-
changing PROC ; read CHANGES, add value to NUMS table
mov cx,20
mov eax, 0
mov edx, 0
change_loop:
mov dx,[CHANGES]
mov si,[CHANGES +1]
mov ax, WORD PTR [CHANGES +2]
call location
add [NUMS + bx], ax
add CHANGES, 3
loop change_loop
ret
changing ENDP
printing PROC-
printing PROC ; Print NUMS in a 7 x 9 table format
mov ecx, 7
mov esi, OFFSET NUMS
row_loop:
push ecx
mov ecx, 9
column_loop:
mov eax, 0
mov eax, [esi]
mov ebx, TYPE WORD
call WriteHexB
mov edx, OFFSET space
call WriteString
add esi, 2
loop column_loop
pop ecx
loop row_loop
mov edx, OFFSET newline
call WriteString
ret
printing ENDP
location PROC-
location PROC ; given row and column, calculate NUMS location
mov bx, dx
imul bx,18
imul si,2
add bx, si
ret
location ENDP
changing PROC in my assembly program is not

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!