X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/0c728c8de88d86247d2a75348e71f5af37838c28..31f423d23267efa289e032e5b98d9760727381b4:/z180/config.inc diff --git a/z180/config.inc b/z180/config.inc index 7b6d7ac..bea6e05 100644 --- a/z180/config.inc +++ b/z180/config.inc @@ -3,8 +3,6 @@ FALSE equ 0 TRUE equ NOT FALSE -DEBUG equ true - banked equ true ;----------------------------------------------------- @@ -21,8 +19,8 @@ AVRCLK equ 18432 ;[KHz] if CPU_Z180 ;----------------------------------------------------- -FOSC equ AVRCLK/2 ;Oscillator frequency [KHz] -PHI equ FOSC*2 ;CPU frequency (clock doubler enabled) +;FOSC equ AVRCLK/2 ;Oscillator frequency [KHz] +;PHI equ FOSC*2 ;CPU frequency (clock doubler enabled) ;---------------------------------------------------------------------- ; Baudrate Generator for x16 clock mode: @@ -43,32 +41,39 @@ PHI equ FOSC*2 ;CPU frequency (clock doubler enabled) PRT_PRE equ 20 ;PRT prescaler -; Reload value for 10 ms Int. (0.1KHz): -; tc10ms = phi/prescale/0.1KHz = phi / (prescale/10) - -PRT_TC10MS equ PHI / (PRT_PRE/10) - ;----------------------------------------------------- ; MMU -COMMON_SIZE equ 16*1024 ;Common Area size in bytes +COMMON_SIZE equ 4*1024 ;Common Area size in bytes ;must be multiple of 4K - if (COMMON_SIZE mod 1000h) .printx COMMON_SIZE not multiple of 4K! end ;stop assembly endif +CMN_SIZE equ COMMON_SIZE/1000h ;4K units +BNK_SIZE equ 64/4 - CMN_SIZE ;bank size (4K units) +BANKS equ (512/4 - CMN_SIZE)/BNK_SIZE ;max nr. of banks -CSK equ COMMON_SIZE/1000h ; -CA equ 10h - CSK ;common area start -BA equ 0 ;banked area start +; Logical address space, CBAR values + +CA equ 10h - CMN_SIZE ;common area start (64K - common size) +BA equ 0 ;banked area start + + if 0 SYS$CBR equ 0 SYS$CBAR equ CA*16 + CA ;CBAR in system mode USR$CBAR equ CA*16 + BA ;CBAR in user mode (CP/M) + endif + if 1 + +SYS$CBR equ BNK_SIZE +SYS$CBAR equ CA*16 + CA ;CBAR in system mode +USR$CBAR equ CA*16 + BA ;CBAR in user mode (CP/M) + + endif -BANKS equ 18 ;max nr. of banks ;----------------------------------------------------- @@ -128,30 +133,37 @@ DDTZRSTVEC equ 030h ;DDTZ Restart vector (breakpoints) INIDONE equ 03Fh ;CP/M skip hw init, if this address INIDONEVAL equ 080h ; is set to this value. -mtx.fifo_len equ 32 ;Message transfer fifos +mtx.fifo_len equ 64 ;Message transfer fifos mtx.fifo_id equ 0 ; This *must* have #0 -mrx.fifo_len equ 32 +mrx.fifo_len equ 64 mrx.fifo_id equ 1 -ci.fifo_len equ 32 ;AVRCON Character I/O via AVR +ci.fifo_len equ 32 ;AVRCON (USB0) Character I/O via AVR ci.fifo_id equ 2 co.fifo_len equ 32 co.fifo_id equ 3 +s0.rx_len equ 128 ;Serial 0 (ASCI0) buffers +s0.rx_id equ 4 ; +s0.tx_len equ 128 ; +s0.tx_id equ 5 ; + s1.rx_len equ 128 ;Serial 1 (ASCI1) buffers -s1.rx_id equ 4 ; +s1.rx_id equ 6 ; s1.tx_len equ 128 ; -s1.tx_id equ 5 ; +s1.tx_id equ 7 ; AVRINT5 equ 4Fh AVRINT6 equ 5Fh ;PMSG equ 80h +IDEBASE equ 60h + ;----------------------------------------------------- ; Definition of (logical) top 2 memory pages sysram_start equ 0FE00h -stacksize equ 80 +bs$stack$size equ 80 isvsw_loc equ 0FEE0h @@ -175,7 +187,8 @@ mkbuf macro id,name,size name&.mask equ ;wrong size error else db id - ds 3 + db size-1 + ds 2 name:: ds size name&.mask equ low (size-1) if size ne 0 @@ -198,3 +211,10 @@ inidate macro dseg ds ??ps.len endm + +;----------------------------------------------------- + +b0call macro address + call _b0call + dw address + endm