A bit of extra decoding is required to put a cartridge ROM into the unused part of the memory map at 8000-9fff
The easiest way I can see is by feeding E, RW, A15, A14 & A13 into an LS138 decoder to generate the OE signal for the ROM. You can even get a couple of bonus signals that are active during writes to 8000 and c000 if you wanted for example to add a couple of registers for general outputs.
I'm not not sure if I understand. I know the input pin 1 (A) R/W, pin 2 (B) A14, pin 3 (C) A15, pin 4 (nG2A) 0V, pin 5 (nG2B) A13 and pin 6 (G1) E but the output I don't understand what do they hook up to?
UPDATE:
I want to play dungeons of daggorath threw the expansion header but there is no CART/.
Y5 is the output you want to use as the missing /CART. This would go to the output enable and/or chip select of the external ROM. The other LS138 outputs are not necessary, but possibly useful for other projects.
Regarding playing Dungeons of Daggorath, if you're talking about the original game on cart, then it sounds like there may be a fair amount of work ahead of you, to modify the source code to work with the address map and I/O of the SBC, plus rework the graphics to a terminal-friendly format. It would be pretty cool if you did though!