Hello, > Am 31.08.2013 15:51, schrieb Michael Hawkins: >> The 8051 has built in support for bank switching. >> >> The Z80 does not.
Neither the (original) 8051 nor the Z80 have built in support for bank switching. I'd almost say that bank switching by definition goes beyond built in support of the processor core. However there are derivatives that do support it. >> SDCC has support for 8051 bank switching. SDCC supports code memory bank switching for 8051. >> Z80 bank switching (and for other CPU's that don't natively support it) >> is usually done with a simple latch circuit. >> >> Why can't SDCC provide Z80 with bank switching support? If I had to do >> it myself, what files in the Z80 would I need to modify? Which files in >> 8051 provide the bank switching? For the 8051 bank switching is handled by crtbank.asm. But the calls are generated by src/mcs51/gen.c. To add support for Z80 you'd have to modify src/z80/gen.c. There is also support needed in src/z80/main.c to compensate for the extra required stack space. > sdcc provides some support. See the section on named address spaces in > the manual. > Esentially, you have to provide a function that switches to a specific > bank, and tell sdcc which variable is meant to go into which bank. Then > sdcc will insert the function calls for you. > > Philipp Named address spaces can provide data memory bank switching. This is not implemented for 8051. Maarten ------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user