This may be very basic, but I can't really understand it.
I'm using 8255's A and B ports to input a word. I have something like:
PORT_A EQU 0008h // inputs low byte
PORT_B EQU 000Ah // inputs high byte
Later on in the code segment, I have a part that does this:
MOV DX, PORT_B
IN AL, DX
MOV AH, AL
MOV DX, PORT_A
IN AL, DX
MOV DX, AX
I have several questions here. What does MOV DX, PORT_B effectively do? Does it store PORT_B's address in DX? Why does it input B's high byte in AL, and then moving AL to AH, instead of simple writing it down as IN AH, DX?
What is it takes makes "0008h" and "000Ah" wise choices for addresses for port A and B? I've only ever worked with 8085 assembly, and over there I wouldn't choose 000A (0000 0000 0000 1010b) if I'd chosen 0008h (0000 0000 0000 1000b) previously, because the A3 bit overlaps (for example, I'd choose 0001h (... 0001b) and 0002h (.... 0010b), so that no bits overlap).