Question
Objectives In this lab, students will learn how to use instructions MOV, ADD, SUB, INC, DEC, and NEG in an assembly language program. Lab Tasks
Objectives
In this lab, students will learn how to use instructions MOV, ADD, SUB, INC, DEC, and NEG in an assembly language program.
Lab Tasks
Task 1: Read the syntax of assembly language instructions MOV, ADD, SUB, INC, DEC, and NEG (purpose, no. of operands required, and legal/illegal operands) from textbook ch#4. Also, find out all valid combinations of MOV instructions using data register and immediate values or both operands as data register.
Task 2: Now execute the following instructions (single-step) in EMU8086 and observe the changes in contents of destination operand. If any instruction gives error, correct that error.
- MOV AL, 256
- MOV AX, F1ABh
- MOV AX, -123
- MOV BX, 123
- MOV AH, 010010001b
- MOV 1234h, BX
- MOV DX, 33h
- MOV CX, AB
- MOV CH, AL
- MOV DL, BL
- MOV AH, BL
- MOV AX, CL
Task 3: For each of the following assembly language instructions, what will be the possible register value (in hex)? Assume all statements are being executed in a sequence and initially all registers contain zero.
No. | Instructions | AX | BX | CX | DX | ||||
AH | AL | BH | BL | CH | CL | DH | DL | ||
| MOV AX, 0110b |
|
|
|
| ||||
| MOV BH, 90H |
|
|
|
| ||||
| MOV CX, 10 |
|
|
|
| ||||
| MOV DX, 1234H |
|
|
|
| ||||
| ADD DH, DL |
|
|
|
| ||||
| ADD AX, BX |
|
|
|
| ||||
| SUB CX, BX |
|
|
|
| ||||
| SUB AH, DL |
|
|
|
| ||||
| INC AX |
|
|
|
| ||||
| INC BL |
|
|
|
| ||||
| DEC DX |
|
|
|
| ||||
| DEC CH |
|
|
|
| ||||
| NEG CX |
|
|
|
| ||||
| NEG BL |
|
|
|
| ||||
Task 4: Execute following statements (single-step) in EMU8086. Observe changes in the contents of destination operand.
No. | Code Snippet | Result |
| MOV AX, 4D12h MOV BX, 1C21h ADD AX, BX |
|
| MOV AX, 4D12h MOV BX, 1C21h SUB AX, BX |
|
| MOV AL, 25 MOV BH, 1Ch ADD AL, BH |
|
| MOV CL, 10000011b MOV CH, 10010010b SUB CH, CL |
|
| MOV AX, 80h ADD AX, 01 |
|
| MOV AL, 80h ADD AL, 01 |
|
| MOV AL, 0A5h MOV BL, 12h ADD AL, BL MOV DH, BL SUB DH, 10 |
|
Lab Tasks Task 1: Read the syntax of assembly language instructions MOV, ADD, SUB, INC, DEC, and NEG (purpose, no. of operands required, and legal/illegal operands) from textbook ch#4. Also, find out all valid combinations of MOV instructions using data register and immediate values or both operands as data register. Task 2: Now execute the following instructions (single-step) in EMU8086 and observe the changes in contents of destination operand. If any instruction gives error, correct that error. a. MOV AL, 256 b. MOV AX, F1ABh c. MOV AX, -123 d. MOV BX, 123 e. MOV AH, 010010001b f. MOV 1234h, BX g. MOV DX, 33h h. MOV CX, 'AB' i. MOV CH, AL j. MOV DL, BL k. MOV AH, BL 1. MOV AX, CL Task 3: For each of the following assembly language instructions, what will be the possible register value in hex)? Assume all statements are being executed in a sequence and initially all registers contain zero. No. Instructions AX BX CX DX AH AL BH BL CH CL DH DL 1. 2. 3 4. MOV AX, 0110b MOV BH, 90H MOV CX, 10 MOV DX, 1234H ADD DH, DL ADD AX, BX SUB CX, BX 5. 6. 7. Microprocessor and Assembly Language-Lab 8. 9. 10. SUB AH, DL INC AX INC BL DEC DX DEC CH 11 12. 13. 14. NEG CX NEG BL Task 4: Execute following statements (single-step) in EMU8086. Observe changes in the contents of destination operand. No. Code Snippet Result A. MOV AX, 4D12h MOV BX, 1C21h ADD AX, BX B. MOV AX, 4D12h MOV BX, 1C21h SUB AX, BX C. MOV AL, 25 D. MOV BH, 1Ch ADD AL, BH MOV CL, 10000011b MOV CH, 10010010b SUB CH, CL MOV AX, 80h E. ADD AX, 01 F. MOV AL, 80h ADD AL, 01 MOV AL, OA5h G. MOV BL, 12h ADD AL, BL MOV DH, BL SUB DH, 10
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started