The Z80 can input/output a byte from/to any of 256 ports, which is useful for sending and receiving data from other parts of the system. On the SMS, these are the relevant ports - note that almost all of them are mirrored in other places but it gets confusing if you use the mirrors so I won't go into it.
Port | Input | Output |
---|---|---|
$3e | Memory control | |
$3f | I/O port control | |
$7e | V counter | |
$7f | H counter | PSG |
$be | VDP (data) | |
$bf | VDP (control) | |
$dc, $dd | Controllers | Controllers |
The main ones you will use with are highlighted in bold. To get a program running, you only really need the VDP ones.