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 EEBh, BCFhEhEDh, AFhDDhCDhEhCFh
WORD hChAEhFhBhChBhBhFFh
WORD AFFFh, BFhhCFhAhAhAAhFhECh
WORD AhBhDhBCCFhABh, DChBhAAFhFBh
WORD BACh, BhhBFBhhEEBh, FhBBhh
WORD hBBhBDhBhChBhhFhAh
WORD hABhBDhEhAhBDhDhhDh
CHANGES WORD ChhCAh, FhAh
WORD BhBhEhDhDh
WORD ChBFhhAhAh
WORD FhFEh, EhFAh, h
main PROC
code
main PROC ; control section of program
call printPromptNT
call printing ; Print unsorted output in x table format
call printPromptST
call sorting ; sort each row of NUMS table separately
call printing ; Print sorted output in x table format
call printPromptCT
call changing ; read CHANGES, add value to NUMS table
call printing ; Print changed output in x table format
COMMENT @
call printPromptSWT
call switching ; read SWITCHES, exchange NUMS table values
call printing ; Print switched output in x table format
@
exit
main ENDP
changing PROC
changing PROC ; read CHANGES, add value to NUMS table
mov cx
mov eax,
mov edx,
changeloop:
mov dxCHANGES
mov siCHANGES
mov ax WORD PTR CHANGES
call location
add NUMS bx ax
add CHANGES,
loop changeloop
ret
changing ENDP
printing PROC
printing PROC ; Print NUMS in a x table format
mov ecx,
mov esi, OFFSET NUMS
rowloop:
push ecx
mov ecx,
columnloop:
mov eax,
mov eax, esi
mov ebx, TYPE WORD
call WriteHexB
mov edx, OFFSET space
call WriteString
add esi,
loop columnloop
pop ecx
loop rowloop
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
imul si
add bx si
ret
location ENDP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
