From: Alan Cox Date: Thu, 12 Feb 2015 01:42:54 +0000 (+0000) Subject: z80: update banking documentation X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=519a6147e0d6b650c85fb0b700810ea6a03343ed;p=FUZIX.git z80: update banking documentation --- diff --git a/Kernel/doc/SDCCBanking b/Kernel/doc/SDCCBanking index 0e83f9a0..26b02c9a 100644 --- a/Kernel/doc/SDCCBanking +++ b/Kernel/doc/SDCCBanking @@ -24,7 +24,7 @@ Code Segments: _CODE2 is "bank 2" _CODE3 is "bank 3" _VIDEO is "bank 3" - _DISCARD is "bank 3" + _DISCARD is common (bank 0) _COMMONMEM is common (bank 0) Data Segments: @@ -76,33 +76,36 @@ break. Hopefully SDCC never decides to create one behind our back. Stubs: - CALL __bank_n_from_m - defw xx - RET +either + + LD DE, #function + JP __stub_n_from_m + +or + + LD HL, #function + JP __stub_n_from_0 + The stubs may live in the bank of the invoking function, while __bank_x is -common +common. This is done to process tables. It means that function tables like device or syscall tables correctly generate inter bank calls. Banking Handlers +See platform-zx128/zx128.s + + +Assumptions + +__sdcc_callhl +__enter +__enter_s + +must live in common memory + +You must use a sdcc support library modified to expect 'far' style offsets +on helpers, but they may be banked. -__bank_0_from_1: - POP HL ; return - LD DE, (HL) - INC HL - LD D, (HL) - INC HL - PUSH HL ; true return - LD A, #bank0op - OUT (port), A - EX DE, HL - CALL __callhl -__bank1_ret: - LD A, #1 - OUT (port), A - RET -__callhl: - JP (HL) \ No newline at end of file