added more ports, fixed I/O problems with memory-mapped registers on some chips, support larger sram sizes (>= 256 bytes)