Write an assembly language instruction to program the 82C55 to get data from port A and send it to port B, if PA=IN, PB=OUT, PC0-PC3=IN, and PC4- PC7=OUT and operating in Mode 0. Use port addresses of 300H-303H for the 82C55 chip.
;labelling addresses for each port and control register
porta equ 300h
portb equ 301h
portc equ 302h
creg equ 303h
;initalising 8255
mov al,10010001b
out creg,al
;taking data from port A
in al, porta
;sending to port A
out portb, al
The bits sent to control register for initialisation are as follows (0 is LSB):
7 - 0 for BSR mode and 1 for regular input output mode
6, 5 - mode for port A (mode 0 will be 00)
4 - Port A, 1 for input and 0 for output
3 - Port C upper, 1 for input and 0 for output
2 - mode for port B (mode 0 will be 0)
1 - Port B, 1 for input and 0 for output
0 - Port C lower,1 for input and 0 for output
Get Answers For Free
Most questions answered within 1 hours.