Exam2_061_Sln - Port C is connected to eight different...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Complete the following assembly language procedure named SCANg, to scan for all occurrences of the letter “g” in the memory block 21000h – 22FFFh and replaces it with letter “G”. You must use SCASB instruction and REPNE prefix. SCANg PROC MOV AX, 2000h MOV ES, AX CLD ; auto increment mode and you should complete the program MOV CX, 2000H MOV DI, 1000H MOV AL, ‘g’ BACK: REPNESCASB CMP CX, 0H JZ OUT1 DEC DI MOV ES:[DI], ‘G’ INC DI JMP BACK OUT1: RET SCANg ENDP
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2. In executing the instruction MOV [A805H], CL The 8088 processor performs a bus operation. Draw the timing diagram showing: CLK, Logic levels at the signal shown below. (Assume minimum-mode, DS=0000H, IF=1, and CX=031AH). T1 T2 T3 T4 CLK AD3 AD2 AD1 AD0 ALE IO/M’ WR’ RD’ MN/MX’ A19/S6 A18/S5 A17/S4
Background image of page 2
1. Assume you have an 8255A chip that is used as an isolated I/O with port A at address 5000H, Port B at address 5001H, Port C at address 5002H, and the Control Register at address 5003H.
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Port C is connected to eight different LED’s and port A and port B are connected to 16 switches. If any switch in port A is ON, the upper portion of port C Will be ON. If any switch in port B is turned ON, then the lower portion of port C will ON and OFF with some delay on each case. Write a DOCUMENTED program to monitor the system continually START: MOV DX, 5000H ; INPUT PORT A IN AL, DX AND AL, 0FFH ; CHECK IF ANY SWITCH IS ON JZ CONT MOV AL, 0F0H ; MAKE UPPER C ON CONTINUOUSLY MOV DX, 5002H OUT DX, AL CONT: MOV DX, 5001H ; INPUT PORT B IN AL, DX AND AL, 0FFH ; CHECK IF ANY SWITCH IN PORT B IS ON JZ START ; IF NO SWITCH IS ON, THEN REPEAT MOV AL, 0FH ; IF ANY SWTICH IN B IS ON MOV DX, 5002H ; MAKE LOWER C ON ON_OFF: OUT DX, AL CALL DELAY ; CALL DELAY XOR AL, 0FH ; ALTERNATE LOWER C ON AND OFF. JMP ON_OFF...
View Full Document

This note was uploaded on 05/17/2010 for the course EE EE390 taught by Professor Mohandes during the Spring '10 term at King Fahd University of Petroleum & Minerals.

Page1 / 3

Exam2_061_Sln - Port C is connected to eight different...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online