Develop a sequence of instructions

Assignment Help Other Engineering
Reference no: EM132153192

Microprocessor Systems Assignment -

1. If AX=F100H and DX=2D23H, list the sum and the contents of flag register bits CF,ZF, SF and PF after ADD AX,DX executes.

2. Develop a sequence of instructions that add AL,BL,CL,DL and AH, and saves the sum in the DH register.

3. Based on the following screenshot, determine the result in the concerned memory locations after XOR [SI], AX is executed.

4. Choose an instruction that decrements the SI register by 1.

5. Choose an instruction that adds 1 to the BL register.

6. If DL=44H and BH=3FH, list the difference after BH is subtracted from DL and show the contents of the flag register bits CF,ZF,SF and PF.

7. Develop a sequence of instructions that will clear the three rightmost bits of DH without changing DH and save the result in BH.

8. Develop a sequence of instructions that will set the five leftmost bits of DI without changing DI and save the result in SI.

9. Develop a sequence of instructions that will set the four lefttmost bits of BX, clear the three rightmost bits of BX, and invert bit 8 of BX and save the result in BX.

10. Select an AND instruction that will

(a) AND AX with BX and save the result in BX.

(b) AND the data addressed by BX with CX and the sve the result in memory addressed by BX.

(c) AND BL with memory location specified by the address label WHAT and save the result in memory location WHAT.

11. Select an OR instruction that will

(a) OR BL with AH and save the result in AH.

(b) OR DX with SI and save the result in SI.

(c) OR the data addressed by BX with CX and the save the result in memory addressed by BX. (1 mark)

(d) OR the data stored 30 bytes after the location addressed by BP with AX and the save the result in the same memory locations.

(e) OR AH with memory location specified by address label WHEN and save the result in the memory location WHEN.

12. Select the correct instructions to perform each of the following tasks:

(a) shift DI right two places with zeros moved into the leftmost bits.

(b) shift DH right three places while leaving the sign bit of DH unchanged.

13. Which register is decremented by the loop instruction?

14. The following shows two different instructions, either of which can set DX to 0. What is the length of the machine code of each instruction? (Use EMU8086 to find their machine codes.)

XOR DX, DX

MOV DX, 0

15. (Interrupt Processing) The following is a partial dump of the Interrupt Vector Table:

0000:0000 68 10 A7 00 65 04 70 00-16 00 DA 05 65 04 70 00

0000:0010 65 04 70 00 D7 04 00 C0-00 00 00 C9 53 FF 00 F0

0000:0020 85 98 00 F0 28 00 DA 05-3A 00 DA 05 52 00 DA 05

0000:0030 6A 00 DA 05 82 00 DA 05-9A 00 DA 05 65 04 70 00

Given the above contents of the interrupt vector table in memory,

a) Determine the 20-bit address of the interrupt service routine for the 0BH interrupt.

b) Determine the 20-bit address of the interrupt service routine for the 07H interrupt.

16. (Interrupt type number generation)

(a) Search the internet to find the datasheets of 74148 and 74374. DON'T submit their datasheets. Use the information from the datasheets to describe the function of the circuit in the following figure.

(b) If it is required that the following 8 interrupt numbers are to be generated: 70H, 71H, 72H, 73H, 74H, 75H, 77H, 77H, describe how to make connections.

17. (Assembly Programming) Write a program to (1) store 0FH, 0EH, 0DH, 0CH, 0BH into 5 consecutive bytes of memory beginning at the segment base address of the data segment using the DB directive and (2) use the string instruction REP MOVSB to copy the above 5 consecutive data to another block of consecutive memory locations in the same segment (i.e., the data segment). The address of the first memory of the destination block should have an offset address 0010H. Type the program in emu8086, emulate and run the program. Include screenshots for the list file and memory display to show the data in the source block and data in the destination block. (No credit will be given if you don't use the REP MOVSB instruction.)

18. (Assembly Programming) The following is an assembly program.

CODE SEGMENT

START: MOV AX, DATA

MOV DS, AX

MOV CX, 3

MOV SI, OFFSET ARRAY

ITER: MOV AX, [SI]

XCHG AH, AL

ROL AX, 1

INC SI

AND [SI], AX

LOOP ITER

ENDS

DATA SEGMENT

DB * DUP (0)

ARRAY DB 02H,06H,34H,0B9H,8BH,01H,70H,0CH

ENDS

END START

Enter the above program in emu8086, obtain the list file and single step the program, to complete tasks and answer questions below.

(a) Fill in the blanks in the following table after each instruction is executed for the first run of the ITER loop:

Run 1

AX

CX

SI

8-bit data in DS:SI

8-bit data in DS:SI+1

MOV AX, [SI]

 





XCHG AH, AL

 





ROL AX, 1

 





INC SI

 





AND [SI], AX

 





LOOP ITER

 





Fill in the blanks the data of the 8 memory locations starting from ARRAY at the end of Run 1:

What is the function of ROL? Use the numbers in ROL AX,1 to explain.

What is the function of AND?

(b) Fill in the blanks in the following table after each instruction is executed for the second run of the ITER loop:

Run 2

AX

CX

SI

8-bit data in DS:SI

8-bit data in DS:SI+1

MOV AX, [SI]

 





XCHG AH, AL

 





ROL AX, 1

 





INC SI

 





AND [SI], AX

 





LOOP ITER

 





Fill in the blanks the data of the 8 memory locations starting from ARRAY at the end of Run 2:

What are the final values of them after the execution of the program? Explanation and screenshot are required.

(c) If the data transferred into CX is 6, how many times will the LOOP instruction execute?

Write an equivalent instruction to MOV AX,DATA using array.

19. Type the following program in emu8086 .exe file and single step it.

CODE_SEG SEGMENT

EX610 PROC FAR

PUSH DS

MOV AX,0

PUSH AX

CALL SUM

RETF

ENDP

SUM PROC NEAR

MOV DX,AX

ADD AX,BX

RET

ENDP

ENDS

END EX610

Fill in the white blanks in the following table after each instruction is executed


SP

CS

IP

8-bit data in SS:SP

8-bit data in SS:SP+1

PUSH DS

 





PUSH AX

 





CALL SUM

 





RET

 





RETF

 





20. Write an asm file to add two numbers and display the sum on the screen. You need to make sure that the two numbers are small such that the sum is no more than 9. Your program should be FULLY functioning to gain credit.

Screenshots are not required.

21. Type the following program in an emu8086 .com file and run it to test its function.

#start=simple.exe#

#make_bin#

name "simpleio"

; write byte value 0A7h into the port 110:

MOV AL, 0A7H

OUT 110, AL

; write word value 1234h into the port 112:

MOV AX, 1234H

OUT 112, AX

MOV AX, 0 ; reset register.

; read byte from port 110 into AL:

IN AL, 110

; read word from port 112 into AX:

IN AX, 112

HLT

After clicking on the "run" button, the program, a vitual IO device will be setup as shown below.

Now you can type a byte number in the top window and type a word number in the following window. They are displayed in the bottom two windows by emu8086. In the program, they are also read into registers. Please check which registers they are saved. (You can also save them to memory.)

Modify the above program to implement a polling scheme. The scheme tests (1) whether a port has a new number entered and (2) if there is a new number entered in a port, displays a corresponding notification message. To gain credit for this question, your group program should be fully functioning.

22. In lab 4, you learned how to use INT 21H function to obtain the hour and minute values of the current time. In a previous tutorial, you also learned about how to send a beep sound to the computer speaker also shown below. The task of this question, is to implement an alarm. A continuous beep sound is generated when the system time reaches a pre-set time. The pre-set time can be stored in a register (registers). To gain credit for this question, your group program should be fully functioning.

mov ah, 02

mov dl, 07h ;07h is the value to produce the beep tone

int 21h

23. (Analysis of an assembly program)

This is a problem solving question and can be done in group. All members in a group can submit identical work. Each group should not have more than 3 students. In your submission, please clearly state your group members.

The main program of snake-qc.asm contains four blocks: show new head, erase the old tail, check for esc key, stop the game. In lines 159 -204, there is one subroutine move the snake to shift the coordinates of each parts of the snake to right by one position.

Open the uploaded assembly program snake-qc.asm using emu8086. Execute the program to help you understand its function and ensure that you understand the functions of individual instructions and are able to find those four blocks and one subroutine.

Task 1: Answer the following questions:

What is the 20-bit address of the memory location used to store cur_dir? (Screenshot is required to justify your answer.)

What are the 20-bit addresses of the memory locations used to store the coordinates of the head of the snake?

When the snake is moving, if a key, other than any of the four direction keys and ESC key, is pressed, the snake stops moving. Explain how to overcome this problem.

Task 2: For the left movement and right movement, what changes should be made to restrict the range between column 0 and column 49h.

DOS/BIOS instructions used in the program:

The following two instructions ALTOGETHER move the cursor to the location with column number in DL and row number in DH.

MOV AH, 02H

INT 10H

The following four instructions ALTOGETHER print a character stored in AL at the current cursor location and advance the current cursor position.

MOV AL, ' '

MOV AH, 09H

MOV CX, 1 ; single char.

INT 10H

The following two instructions ALTOGETHER check for keypress in the keyboard buffer. ZF=1 if no key is pressed.

MOV AH, 01H

INT 16H

The following two instructions ALTOGETHER read a character from keyboard into AH with NO echo on screen. If no key is pressed, the processor keeps waiting for a key.

MOV AH, 00H

INT 16H

Attachment:- Assignment Files.rar

Reference no: EM132153192

Questions Cloud

What is wrongful dismissal in employment : What is wrongful dismissal in employment? Give an example. Distinguish between an insurance broker and an insurance agent.
Single-server queueing system through automation : A manager is trying to improve a single-server queueing system through automation. What is the probability that there are no customers in the grocery store?
Develop an aggregate vision of it compliance : Assess all key business processes and IT compliance factors and link to all business processes (financial and non-IT) to develop an aggregate vision.
Conduct characteristics for employees in it organization : Write down a policy listing expected ethical conduct characteristics for your employees in your IT organization.
Develop a sequence of instructions : 300076 Microprocessor Systems Assignment - Develop a sequence of instructions that add AL,BL,CL,DL and AH, and saves the sum in the DH register
Which gpo policy takes precedence in case of policy coflict : Which GPO policy takes precedence in the case of a policy conflict? Why? What is the value of the Group Policy in an enterprise environment?
Explain the global market selection process : Explain the global market selection process. Discussing a possible partnership between Exxon Mobil and the government of Qatar.
Classification methods of decision trees : For classification methods of decision trees, nearest neighbors, and neural networks, how should we choose which one to use?
Compose a two page reflective summary : Your Program Management Reflection Journal is intended to be an important part of the learning journey while you are in this program.

Reviews

len2153192

10/29/2018 2:21:27 AM

Submission: Your submission should be a word-document ONLY. The document should include questions, solutions, program, and screenshots. Submit your document online, on or prior to the due date. Instructions: This assignment is an individual work (except Questions 21-23). For other questions, you can discuss them with other students, but the final document should be written solely by you, using your own descriptions and explanations. If you type your work on a university computer, your work could be copied by other students.

len2153192

10/29/2018 2:21:19 AM

Any identical works will be given a 0 mark. It is your responsibility to protect your work against plagiarism. If you don’t understand some questions, do NOT copy solutions from other students, please ask help from the lecturer. Questions 21-23 can be done in groups. All members in a group can submit the same explanations/solutions. Each group should have no more than 3 students.

len2153192

10/29/2018 2:21:10 AM

Notes: For Question 18, * should be the last digit of your student ID. NO credit will be given if you don't replace it with the proper number. The last 2 questions are challenging ones. No detailed advice will be provided. The lecturer is happy to discuss your solutions with your group. For Questions 17-20, when starting emu8086, make sure that (1) choose .exe file, (2) Only copy or insert instructions INSIDE the data segment and code segment in the given template and (3) always keep an address label "start" at the beginning of the first instruction in code segment. After emulation, if your program can not be seen in the emulator or you end up in a bin file, no credit will be given. If that happens and you cannot resolve it, please contact Dr Qi Cheng immediately.

Write a Review

Other Engineering Questions & Answers

  What is the probability that the discharge at any instant

What is the probability that the discharge at any instant will equal or exceed 350 cfs - what is the probability that the discharge will fall within the range between 250 and 350 cfs?

  Determine the rate of emanation into the stope

If the mass flows were 20 kg/s for the first airstream and 25 kg/s for the second airstream, what would be the dry/wet bulb of the new mixed airstream?

  What address in hex is required on the address bus

What address, in HEX, is required on the address bus in order to read the switches? (RD)‾ and (MEMRQ)‾ are control lines from the CPU. What must their logic state be in order to read the switches?

  What is the cutoff frequency you measured from simulation

What is the cutoff frequency you measured from the simulation? Based on the cut off frequency, what type of active filter is constructed in this lab?

  Place to help ensure that dyesol objectives

what mechanisms do you believe should be in place to help ensure that Dyesol's objectives (and those of its parents) are met in its collaborative relationships? (innovation management - chap8)

  Relationship between the analyzed parameters for cornering

Research the roles of anti-roll bars. What do they do and how are they built into the system - Qualitatively describe the relationship between the analyzed parameters for cornering.

  Calculate the relative humidity of the exit flow

Liquid water enters at state 3: 10?C, at the rate of 400 kg per hour. A single air vapor flow exits the unit at state 4: 40?C. Calculate the relative humidity of the exit flow and the rate of heat transfer to the unit.

  Summarize the sensory pathways to the brain for gustatory

Summarize the sensory pathways to the brain for gustatory and olfactory sensations.Analyze and describe the process of hearing from the external to inner ear.Analyze and describe how the ear provides equilibrium and balance for the body.

  Preparation of manuscripts for the ieee international

Recommended length:  at least 5 double spaced pages plus a title page.  The max length is 10 pages. Handwritten papers will not be accepted. The supporting materials (figures, tables, etc.) should not exceed 25% of the paper.

  Analyse the frequency and time-domain waveform

objectives of Vibration Analysis of Gear Fault - The aim of this experiment is to conduct vibration analysis for a motor-gearbox system with some intended damaged on the gear tooth.

  Underline repeating consonant sounds

You will not have to speak your piece in this over-emphasized manner, doing this as an exercise will allow you to make more sense of the text and to find moments that are turbulent and possibly emotionally more intense for the sonnet speaker.

  Advantages of the technologies recommending for client

Be thorough in your web research to ensure you sample a broad spectrum of available wearable solutions. Present the advantages of the technologies.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd