memory banks in z180 (Development MSX Fora)MSX Resource Center PassionMSX MSX2 contest           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 48 gasten en 1 MSX vriend online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - memory banks in z180

Schrijver

memory banks in z180

ARTRAG
msx master
Berichten: 1685
Geplaatst: 15 Oktober 2006, 18:36   
Does anyone has experinece on how memory banks work in z180 cpu?

this code

    global  lcall, lret, lretp, __Lbasecode
    psect   lowtext,class=CODE

BBR equ 39h     ;Bank base register


;   lcall - perform a far call

lcall:  ex  af,af'      ;save new bank number
    in0 a,(BBR)     ;get current bank
    push    af      ;save it
    ex  af,af'      ;restore new bank
    sub __Lbasecode/1000h   ;adjust bank number
    out0    (BBR),a
    jp  (HL)        ;go to new routine

lret:   pop af      ;restore bank number
    out0    (BBR),a     ;select it
    ret         ;back to caller

lretp:  push    bc      ;get adjustment
    exx         ;get some unused regs
    pop hl      ;adjustment value
    pop af      ;bank number
    pop de      ;return address
    add hl,sp
    ld  sp,hl       ;remove parameters
    push    de      ;push return address back
    exx
    out0    (BBR),a     ;restore bank
    ret         ;done.


should manage "long calls" i.e. calls to functions outside the active banks
I need to modify it to support ASCII 8K megaroms.
Any suggestion?



AuroraMSX

msx master
Berichten: 1248
Geplaatst: 17 Oktober 2006, 10:21   
Quote:

Does anyone has experinece on how memory banks work in z180 cpu?


Does this article help?

The german Wikipedia page on the Z180 suggests, that memory is switched in pages of 4K in the memory area 1000-EFFF. Common areas 0 and 1 would be fixed physical memory at adress ranges 0000-0FFF and EFFF-FFFF respectively.

And Zilog also has the specifications of the z180 available as downloadable PDF ...
Huey
msx professional
Berichten: 586
Geplaatst: 17 Oktober 2006, 11:41   
Is this of any help?:

[ Memory address management of HI-TECH C ]
...removed......

Never mind it was memory management till 0xFFFF
Huey
msx professional
Berichten: 586
Geplaatst: 17 Oktober 2006, 12:26   
 
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.