Assembly Language-part1
Please refer to slides and Primer boards lessons
- If the switch S7 of the input PORT0 connected to the data line D7 is at logic 1 and the other switches are at logic 0, specify the contents of the accumulator when the instruction IN PORT0 is executed.
MVI A,9FH
IN PORT0
MOV B,A
OUT PORT1
HLT
- Specify the output at PORT1 and the contents of the register B after executing the instructions in Problem #1.
- Specify the register contents and the flag status as the following instructions are executed.
A | C | S | Z | CY | |
XX | XX | 0 | 0 | 0 | |
MVI A,5EH | |||||
ADI A2H | |||||
MOV C,A |
- Specify the register contents and the flag status as the following instructions are executed.
A | B | S | Z | CY | |
XX | XX | X | X | X | |
SUB A | |||||
MOV B,A | |||||
DCR B | |||||
INR B | |||||
SUI 01H |
- Write a program to
- clear the accumulator
- add 47H (use ADI instruction)
- subtract 92H
- add 64H
- display the results after subtracting 92H and after adding 64H
- Specify the register contents and the flag status as the following instructions are executed
A | B | S | Z | CY | |
XX | XX | 0 | 0 | 0 | |
XRA A | |||||
MVI B,4AH | |||||
SUI 4FH | |||||
ANA B |
- What is the output at PORT1 when the following instructions are executed?
MVI A,8FH
ADI 72H
JC DSPLAY
OUT PORT1
HLT
DSPLAY: XRA A
OUT PORT1
HLT
Answers.
- The data on A after the instruction IN PORT0 is executed will be the same as the data read on PORT0. Thus, the data on A will be equal to 80H.
- The data on register A will be copied to register B. So, the data on register B will be 80H. After the instruction OUT PORT1, the data on Register A will be outputted in PORT1. Thus, PORT1 would also show 80H or 1000 0000.
A | C | S | Z | CY | |
XX | XX | 0 | 0 | 0 | |
MVI A,5EH | 5EH | xx | 0 | 0 | 0 |
ADI A2H | 00H | xx | 0 | 1 | 1 |
MOV C,A | 00H | 00H | 0 | 1 | 1 |
A | B | S | Z | CY | |
XX | XX | X | X | X | |
SUB A | 00H | XX | 0 | 1 | 0 |
MOV B,A | 00H | 00H | 0 | 1 | 0 |
DCR B | 00H | FFH | 1 | 0 | 1 |
INR B | 00H | 00H | 0 | 1 | 0 |
SUI 01H | FFH | 00H | 1 | 0 | 1 |
SUB A
ADI 47H
SUI 92H
OUT PORT0
ADI 64H
OUT PORT0
HLT
A | B | S | Z | CY | |
XX | XX | 0 | 0 | 0 | |
XRA A | 00H | XX | 0 | 1 | 0 |
MVI B,4AH | 00H | 4AH | 0 | 1 | 0 |
SUI 4FH | C0H | 4AH | 1 | 0 | 1 |
ANA B | 40H | 4AH | 0 | 0 | 0 |
- The Carry flag will be set after the instruction ADI 72H, so when the JC DISPLAY is executed it will jump to DISPLAY. XRA A will reset the accumulator. Thus, the output in PORT1 will be 00H.
Get professional assignment help cheaply
Are you busy and do not have time to handle your assignment? Are you scared that your paper will not make the grade? Do you have responsibilities that may hinder you from turning in your assignment on time? Are you tired and can barely handle your assignment? Are your grades inconsistent?
Whichever your reason may is, it is valid! You can get professional academic help from our service at affordable rates. We have a team of professional academic writers who can handle all your assignments.
Our essay writers are graduates with diplomas, bachelor, masters, Ph.D., and doctorate degrees in various subjects. The minimum requirement to be an essay writer with our essay writing service is to have a college diploma. When assigning your order, we match the paper subject with the area of specialization of the writer.
Why choose our academic writing service?
- Plagiarism free papers
- Timely delivery
- Any deadline
- Skilled, Experienced Native English Writers
- Subject-relevant academic writer
- Adherence to paper instructions
- Ability to tackle bulk assignments
- Reasonable prices
- 24/7 Customer Support
- Get superb grades consistently
PLACE THIS ORDER OR A SIMILAR ORDER WITH GRADE VALLEY TODAY AND GET AN AMAZING DISCOUNT