Offset Machine-code Assembly-code: .DATA ... 0456 6789 Z DW 6789h 0458 5678 Y DW 5678h 045A 3456 X DW 3456h 045C 2345 W DW 2345h 045E 57 68 61 74 65 76 65 72 OTHER DB 'Whatever' 0466 58 F DB 'X' 0467 4C 61 73 74 6E 61 6D LAST DB 'Lastname' ;;;; YOUR own Initial & Lastname. ;;;; (NOT 'X' or 'Lastname' !) ... .CODE 0000 MID PROC 0000 B8 ---- R mov ax, @data 0003 8E D8 mov ds, ax 0005 8A 1E 045E R mov BL, [OTHER] 0009 B7 FB mov BH, 251 000B 03 1E 045C R add BX, [W] 000F 77 04 ja M1 0011 88 1E 045E R mov [OTHER], BL 0015 M1: 0015 8A 0E 0466 R mov CL, [F] ; YOURS (not 'X') 0019 B5 7B mov CH, 123 001B 03 0E 0456 R add CX, [Z] 001F 77 04 ja M2 0021 89 0E 0458 R mov [Y], CX 0025 M2: 0025 BA 04D2 mov DX, 1234 ; (Decimal) 0028 B9 0005 mov CX, 5 002B D3 C2 rol DX, CL 002D 89 16 045A R mov [X], DX ... |
NOTE:
You may ignore the Fetch-Execute Cycle, which performs operations such as the following:Move 16-bits of Address from IP to Memory Move 8-bit Instr. bytes from Memory to IR etc., etc. |
As shown in the table below, each instruction is "executed" by performing one or more "steps" -- where each "step" consists of MOVING some BITS from one place to another, as follows:
In other words: each instruction is executed by a series of "steps" that move 8 or 16 or 32 bits, of either Address or Data -- with the value given in hexadecimal -- from one place to another.
Complete the table below, to describe each step.
For your convenience, there is a copy of this table in the text file at
midterm.txt .
#bits of Value FROM: TO: 8/16/32 (A/D) (hex) M, ALU, IR, AX, etc...
mov BL, [A] Move 16-bit Address 045E from IR to Memory Move 8-bit Data 57 from Memory to Register BL mov BH, 241 Move 8-bit Data FB from IR to Register BH Continuing this table, with some unnecessary words omitted: #bits of Hex FROM: TO: add BX, [W] 16 A 045C IR M 16 D 2345 M ALU 16 D FB57 BX ALU 16 D 1EAB ALU M
Now, complete the table for the remaining instructions. All values should be shown in hexadecimal (without a suffix "h"). Be sure to use YOUR first and last name. (Don't use "Lastname" or "X" -- unless that's really your initial!) When you are done, upload a text file "midterm.txt" (or "takehome.txt"), containing the instructions and your answers for each of the "steps". The file midterm.txt contains the text below, or you copy and paste (or create your own).
#bits of Hex FROM: TO: Offset Assembly-code: 0005 mov BL, [OTHER] 16 Address 045E IR Memory 8 Data 57 M BL register 0009 mov BH, 251 8 D FB M BH 000B add BX, [W] 16 A 045C IR M 16 D 2345 M ALU 16 D FB57 BX ALU 16 D 1E9C ALU M 000F ja M1 _ _ _ _ _ _ _ _ 0011 mov [OTHER], BL _ _ _ _ _ _ _ _ 0015 M1: 0015 mov CL, [F] _ _ _ _ _ _ _ _ 0019 mov CH, 123 _ _ _ _ _ _ _ _ 001B add CX, [Z] _ _ _ _ _ _ _ _ 001F ja M2 _ _ _ _ _ _ _ _ 0021 mov [Y], CX _ _ _ _ _ _ _ _ 0025 M2: 0025 mov DX, 1234 _ _ _ _ _ _ _ _ 0028 mov CX, 5 _ _ _ _ _ _ _ _ 002B rol DX, CL _ _ _ _ _ _ _ _ 002D mov [X], DX _ _ _ _ _ _ _ _ |