what is this chip? the pinout is similar to a 6520 PIA. the DBx lines are bidirectional and connect to an 8-bit CPU or MCU data bus. pins 21-29 are control lines, maybe chip select, internal address, etc.
there's a chance it is a PLA, but I don't know of any in a 40-DIP package. it also reminds me of some of the 82Cxx interface chips.
@tubetime
can you identify the package? plastic/ceramic
molding like us or japanese parts?