What 1-byte hex number would you add to 0 times A8 to set the ZERO flag? _____ Divide the number below by 8 using the correct number of shift and show the answer in hex. 0 times B5 SAR:: hex: _____ Fast Answer Assume 32-bit x86 Architecture Exactly how many bytes are in 1 KB of memory? _____ (or KiB since 1998) What instruction should be executed before using move if you need to go in descending order? After returning from, a function call, the following instruction is executed add esp, 12. How many parameters are passed to function that was called? _____ When a value is PUSHed to the stack, the data is written (before, after) esp is (incremented, decremented). Circle the register(s) used implicitly by the following instruction: rep move eax, ebx ecx, edx, esi, edi, ebd, esp Circle the register(s) used implicitly and explicitly by the following instruction: call [ebp + ecx * 41] eax, ebx, ecx, edx, esi, edi, ebp, esp Given that cl = 0 times D8, show the value of eax after this instruction: movsx eax, cl Given that cl = 0 times D8, show the value of eax after this instruction: movzx eax, cl Given that cl = 0 times 8A, what is the largest number that can be subtracted without setting the overflow. The increment instruction (ex: inc eax) affects the carry flag (True, False) List one way to quickly and efficiently set a register to zero. Which register is generally used as the “count” register? _____

## Expert Answer

7. 58 is the one by hex value to be added to A8 to set zero flag.

8. To multiply by 8, we should shift the number 3 times to left because 2^3 is 8. So, B5 left shifted 3 bits is 5A8. Hence B5 multiplied by 8 gives 5A8. But if it is an 8 bit register then answer will be A8.

9. 1024 bytes = 1KB. Because 2^10 is 1024.

20. CX register is commonly used as count register.

19. Best way to make a register zero is to xor it by itself.

XOR ax,ax

18. Increment instruction will effect carry flag if the value of register after increment gives a carry.

16. 00D8 is stored in eax.

15. FFD8 is stored in eax.

14. ebp, ecx, esp are used.

13. ecx is used implicitly.