Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1.         cpu     z180
  2.  
  3.         ; default mapping:
  4.         ; - no common area 0
  5.         ; - bank area 0000h...0efffh
  6.         ; - common area 1 0f000...0ffffh
  7.  
  8.         assume  cbar:0f0h,cbr:00h, bbr:00h
  9.         ;prwins
  10.  
  11.         dw      phys2cpu(00000h)        ; 00000h (bank area) -> 0000h
  12.         dw      phys2cpu(01000h)        ; 01000h (bank area) -> 1000h
  13.         dw      phys2cpu(02000h)        ; 02000h (bank area) -> 2000h
  14.         dw      phys2cpu(03000h)        ; 03000h (bank area) -> 3000h
  15.         dw      phys2cpu(04000h)        ; 04000h (bank area) -> 4000h
  16.         dw      phys2cpu(05000h)        ; 05000h (bank area) -> 5000h
  17.         dw      phys2cpu(06000h)        ; 06000h (bank area) -> 6000h
  18.         dw      phys2cpu(07000h)        ; 07000h (bank area) -> 7000h
  19.         dw      phys2cpu(08000h)        ; 08000h (bank area) -> 8000h
  20.         dw      phys2cpu(09000h)        ; 09000h (bank area) -> 9000h
  21.         dw      phys2cpu(0a000h)        ; 0a000h (bank area) -> a000h
  22.         dw      phys2cpu(0b000h)        ; 0b000h (bank area) -> b000h
  23.         dw      phys2cpu(0c000h)        ; 0c000h (bank area) -> c000h
  24.         dw      phys2cpu(0d000h)        ; 0d000h (bank area) -> d000h
  25.         dw      phys2cpu(0e000h)        ; 0e000h (bank area) -> e000h
  26.         dw      phys2cpu(0f000h)        ; 0f000h (common area 1) -> f000h
  27.  
  28.         ; example mapping:
  29.         ; - common area 0 0000h...3fffh -> 0000h...3fffh
  30.         ; - bank area     4000h...0cfffh -> 20000h...28fff
  31.         ; - common area 1 0d000...0ffffh -> 10000h...11fff
  32.  
  33.         assume  cbar:0d4h,cbr:03h, bbr:1ch
  34.         ;prwins
  35.  
  36.         dw      phys2cpu(00000h)        ; 00000h (common area 0) -> 0000h
  37.         dw      phys2cpu(01000h)        ; 01000h (common area 0) -> 1000h
  38.         dw      phys2cpu(02000h)        ; 02000h (common area 0) -> 2000h
  39.         dw      phys2cpu(03000h)        ; 03000h (common area 0) -> 3000h
  40.         dw      phys2cpu(20000h)        ; 04000h (bank area) -> 20000h
  41.         dw      phys2cpu(21000h)        ; 05000h (bank area) -> 21000h
  42.         dw      phys2cpu(22000h)        ; 06000h (bank area) -> 22000h
  43.         dw      phys2cpu(23000h)        ; 07000h (bank area) -> 23000h
  44.         dw      phys2cpu(24000h)        ; 08000h (bank area) -> 24000h
  45.         dw      phys2cpu(25000h)        ; 09000h (bank area) -> 25000h
  46.         dw      phys2cpu(26000h)        ; 0a000h (bank area) -> 26000h
  47.         dw      phys2cpu(27000h)        ; 0b000h (bank area) -> 27000h
  48.         dw      phys2cpu(28000h)        ; 0c000h (bank area) -> 28000h
  49.         dw      phys2cpu(10000h)        ; 0d000h (common area 1) -> 10000h
  50.         dw      phys2cpu(11000h)        ; 0e000h (common area 1) -> 11000h
  51.         dw      phys2cpu(12000h)        ; 0f000h (common area 1) -> 12000h
  52.  
  53.         ; test symmetry of mappings:
  54.  
  55.         listing off
  56. addr    set     0000h
  57.         while   addr<10000h
  58.         if      phys2cpu(cpu2phys(addr)) != addr
  59.         error   "mapping error at $\{ADDR}"
  60.         endif
  61. addr    set     addr+100h
  62.         endm
  63.         listing on
  64.