Question: VS 2017 (C/C++) / .386 architecture / Assembly language Write an ASM program to play with four DWORD values in an array using less instructions.
VS 2017 (C/C++) / .386 architecture / Assembly language
Write an ASM program to play with four DWORD values in an array using less instructions. Your program should show the following outputs as before and after:

Find the least number of instructions, choosing from MOV, XCHG, INC, DEC, ADD, SUB, or NEG
Each different instruction can be used only once in your preferred code sequence
Use only memory variables and registers as operands without immediate operands like SUB dwArray+8, 4 not allowed
--------------------------------------------------------------------------------------------------------------
; TEMPLATE BELOW
INCLUDE Irvine32.inc .data dwArray DWORD 1, 2, 3, 4 .code ; A procedure to play DWORD elements in dwArray PlayValues PROC ; Show original array call Display ; Fill here, the least number of instructions ; ... ; Show resulted array call Display exit PlayValues ENDP ; A procedure to show dwArray memory by calling DumpMem Display PROC mov esi, offset dwArray mov ebx, type dwArray mov ecx, lengthof dwArray call DumpMem ret Display ENDP END PlayValues
Dump of offset 00406100 00000001 00000002 00000003 00000004 Dump of offset 00406100 00000003 00000004 FEFTEFFF 00000003 Press any key to continue .. . Dump of offset 00406100 00000001 00000002 00000003 00000004 Dump of offset 00406100 00000003 00000004 FEFTEFFF 00000003 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
