Lab Assignment #2 8255A INTERFACE (LED) : Green

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

1

Lab Assignment #2 8255A INTERFACE (LED)


ADDRESS
10H ~ 17H

I/O PORT
8255A-CS1/ 8255A-CS2

DESCRIPTION
8255A-CS1(DOT & ADC INTERFACE) 18H : A PORT DATA REGISTER 1AH : B PORT DATA REGISTER 1CH : C PORT CONTROL REGISTER 8255-CS2(LED & STEPPING MOTOR) 19H : A PORT DATA REGISTER 1BH : B PORT DATA REGISTER 1DH : C PORT CONTROL REGISTER 1FH : CONTROL REGISTER

8255 is a programmable peripheral interface. It has 3 I/O ports named as port A, B, C Port B is controlling the four LEDs on the board, by we keeping high any of the first four bits as following: (0001 for the upper RED LED) (0010 for the GREEN LED) (0100 for the YELLOW LED) (1000 for the Second RED LED)

Prepared By: Ibrahim Hazmi

2 This Code was used to Glow the upper RED, the GREEN, the YELLOW, then the Second RED LED Respectively. The Task is to REVERSE the ORDER of LEDs Glowing to be from the Second RED to the upper RED LED by CHANGING the RED PART of the Code ;***************************************** ; MDA-Win8086 EXPERIMENT PROGRAM * ; FILENAME : LED.ASM ; PROCESSOR : I8086 ;***************************************** CODE SEGMENT ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE ; PPIC_C EQU 1FH PPIB EQU 1BH ; ORG 1000H MOV AL,10000000B OUT PPIC_C,AL ; L1: MOV AL,11110001B L2: OUT PPIB,AL CALL TIMER SHL AL,1 TEST AL,00010000B JNZ L1 OR AL,11110000B JMP L2 ; INT 3 ; TIMER: MOV CX,1 TIMER2: PUSH CX MOV CX,0 TIMER1: NOP NOP NOP NOP LOOP TIMER1 POP CX LOOP TIMER2 RET ; CODE ENDS END

Prepared By: Ibrahim Hazmi

You might also like