First, map 8255 as an external memory - that's the easiest way ..
See attached picture ..
On power on all mode/direction bits in the Control Register are set to "0" and that means that all 3 ports are set to be outputs ..
To send data to, say, port A, use the following command:
Code:
MOV DPTR, #addres of A; in this example it is #4000h
MOV A, #what you want to send
MOVX @DPTR, A
Other addresses are as follows:
Address 4000H: port A
Address 4001H: port B
Address 4002H: port C
Address 4003H: configuration register
To set Port A as inputs, you have to set D4 in the Control Register.