REG Problem 3 (25 points) For the following program code, calculate the machine code using the given information and store in memory MOV CX, 9 Code Table: W-1| W-0 Here: MOV (DI), BL Immediate to register: 1011 w reg data INC DI AXI AL Reg/mem to mem/reg: opcode d w mod reg r/m CX CL DEC CX Increment register: 01000 reg DX DL JNZ Here Decrement register: 01001 reg BX BL Jump on non-zero: 01110101 (IP-inc8) SP AH Note: The memory contents start at 504; BP CH opcode for MOV is 100010. SI DH DI 0001 001 0101 011 100 101 110 110 Mod Mod = 11 Effective address calculation R/MW-0 W=1 R/M Mod 00 Mod -01 Mod-10 000 AL AX 000 (BX)+(SI) (BX)+(S1)+D8 (BX)+(S1)+D16 001 CL CX 001 (BX)+(DI) (BX)+(DI)+D8 (BX)+(DT)+D16 010 DL PX 010 (BP)+(SI) (BP)+(ST)+D8 (BP)+(SI)+D16 BL BX 011 (BP)+(DI) (BP)+(DI)+D8 (BP)+(DI)+D16 AH SP100 (SI) |(ST)+D8 (SI)+D16 CH BP 101 (DI) (DI)+D8 (DI)+D16 DH SI 110 Direct (BP)+D8 |(BP)+D16 111 BH DI ii KBX) (BX)+D8 (BX)+D16 00 Mode Memory Memory with 8-bit disp. Memory with 16-bit disp. Register 101 10 11 REG Problem 3 (25 points) For the following program code, calculate the machine code using the given information and store in memory MOV CX, 9 Code Table: W-1| W-0 Here: MOV (DI), BL Immediate to register: 1011 w reg data INC DI AXI AL Reg/mem to mem/reg: opcode d w mod reg r/m CX CL DEC CX Increment register: 01000 reg DX DL JNZ Here Decrement register: 01001 reg BX BL Jump on non-zero: 01110101 (IP-inc8) SP AH Note: The memory contents start at 504; BP CH opcode for MOV is 100010. SI DH DI 0001 001 0101 011 100 101 110 110 Mod Mod = 11 Effective address calculation R/MW-0 W=1 R/M Mod 00 Mod -01 Mod-10 000 AL AX 000 (BX)+(SI) (BX)+(S1)+D8 (BX)+(S1)+D16 001 CL CX 001 (BX)+(DI) (BX)+(DI)+D8 (BX)+(DT)+D16 010 DL PX 010 (BP)+(SI) (BP)+(ST)+D8 (BP)+(SI)+D16 BL BX 011 (BP)+(DI) (BP)+(DI)+D8 (BP)+(DI)+D16 AH SP100 (SI) |(ST)+D8 (SI)+D16 CH BP 101 (DI) (DI)+D8 (DI)+D16 DH SI 110 Direct (BP)+D8 |(BP)+D16 111 BH DI ii KBX) (BX)+D8 (BX)+D16 00 Mode Memory Memory with 8-bit disp. Memory with 16-bit disp. Register 101 10 11