Answer II Detered Exam

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Answers_II

Q1:A: since T flag is the 9​th​ bit in PSW so the MASK is


1111111011111111=FEFFH or 0000000100000000= 0100 H for setting [8
Marks]
● PUS​HF ;save flags(there is no space between PUS​H F​)
● MOV BP, SP ; Move [SP] => [BP]
● AND 0[BP], 0FEFFH ; Clear TF (the leading zero is very important if
starts with letter of number)
● PO​PF ;Pop flags(there is no space between PO​P F​)

And for the setting;


● PUS​HF ;save flags(there is no space between PUS​H F​)
● MOV BP, SP ; Move [SP] => [BP]
● OR 0[BP], 0100H ; Set TF (the leading zero is not important if
starts with digit number)
● PO​PF ;Pop flags(there is no space between PO​P F​)
B: Interrupt signal: An interrupt is a hardware- or software-initiated call that
interrupts the currently executing program at any point and calls a
procedure. The procedure is called by the interrupt Service Routine (ISR).
Interrupts are useful when an I/O device needs to be serviced only
occasionally at low data transfer rates.
Interrupts
S/W(Internal) H/W(External)
Happened When: INT nn executed signal on NMI or INTR

C: the 1st address of vector interrupt :


[00000] for IP and [00002] for CS
And the last one FF = 255 * 4 = [003FCH] for IP and [003FEH] for CS
D: refer to I/O lecture
Q2:A:the reasons to use SRAM it stores the data as long as power is on, no
extra circuit for refreshing as well as it is suitable for small memory system.
B:the design is similar to example 3 in Memory Interface lecture except the
RAM should start from A000H.

C:refer to the microcontroller lecture to show the difference in diagram.


D: partial decoding is used for small system, where hardware can be
eliminated and the cost very low and overall system will be simple.

Q3: A:the DMA method is one of the I/O techniques where the CPU has not
related to the whole I/O operation(it will know the start and the end of
operation) and DMA is the fastest method where block of data transfer can be
applied between memory and I/O devices. The diagram refer to I/O lecture.

B:Bit 7 of command byte if equals to 1; states that each Port what to be (IN,
OUT, or control) as well as define the modes of 8255 mode 0 (simple I/O no
handshake) mode 1 (strobe I/O) and mode 2 (Strobed Bidirectional I/O)
And when Bit 7=0 it will program the C port bits. Refer to diagram in I/O
lecture.

C:the second part is the condition of first part IN first then OUT
Up: IN AL, 98H ; input the value to accumulator
CMP AL, 0FFH ; is equal to FF
JNE UP ; if not wait
MOV DX, 55BFH ; 16 bit address
MOV AL, 0A6H ; get the pattern
OUT DX, AL ; output the pattern to output port
CALL Delay_sub ; you write this subroutine as we learned
HLT
Write here the Delay subroutine as given in delay lecture

You might also like