9 ;-----------------------------------------------------
10 ; CPU and BANKING types
18 AVRCLK equ 18432 ;[KHz]
22 ;-----------------------------------------------------
23 ;FOSC equ AVRCLK/2 ;Oscillator frequency [KHz]
24 ;PHI equ FOSC*2 ;CPU frequency (clock doubler enabled)
26 ;----------------------------------------------------------------------
27 ; Baudrate Generator for x16 clock mode:
28 ; TC = (f PHI / (32 * baudrate)) - 2
30 ; PHI [MHz]: 9.216 18.432
32 ; ----------------------
40 ;-----------------------------------------------------
41 ; Programmable Reload Timer (PRT)
43 PRT_PRE equ 20 ;PRT prescaler
45 ;-----------------------------------------------------
48 COMMON_SIZE equ 4*1024 ;Common Area size in bytes
49 ;must be multiple of 4K
50 if (COMMON_SIZE mod 1000h)
51 .printx COMMON_SIZE not multiple of 4K!
54 CMN_SIZE equ COMMON_SIZE/1000h ;4K units
55 BNK_SIZE equ 64/4 - CMN_SIZE ;bank size (4K units)
56 BANKS equ (512/4 - CMN_SIZE)/BNK_SIZE ;max nr. of banks
58 ; Logical address space, CBAR values
60 CA equ 10h - CMN_SIZE ;common area start (64K - common size)
61 BA equ 0 ;banked area start
66 SYS$CBAR equ CA*16 + CA ;CBAR in system mode
67 USR$CBAR equ CA*16 + BA ;CBAR in user mode (CP/M)
73 SYS$CBAR equ CA*16 + CA ;CBAR in system mode
74 USR$CBAR equ CA*16 + BA ;CBAR in user mode (CP/M)
79 ;-----------------------------------------------------
81 CREFSH equ 0 ;Refresh rate register (disable refresh)
82 CWAITIO equ 3 shl IWI0 ;Max I/O Wait States, 0 Memory Wait States
83 PHI_X2 equ 0 ;set to M_X2CM to enable the clock doubler
88 PHI equ AVRCLK/5 ;CPU frequency [KHz]
89 BAUDCLCK equ AVRCLK/10 ;Baudrate clock [KHz]
103 ; Init Serial I/O for console input and output (SIO-A)
105 ; Baudrate clock: 1843200 Hz (Bus connector pin A17)
107 ; Baudrate Divider SIO CTC
108 ; ---------------------------------
127 CWAITROM equ 2 shl MWI0
132 DDTZRSTVEC equ 030h ;DDTZ Restart vector (breakpoints)
134 mtx.fifo_len equ 64 ;Message transfer fifos
135 mtx.fifo_id equ 0 ; This *must* have #0
139 ci.fifo_len equ 32 ;AVRCON (USB0) Character I/O via AVR
144 s0.rx_len equ 128 ;Serial 0 (ASCI0) buffers
149 s1.rx_len equ 128 ;Serial 1 (ASCI1) buffers
160 ;-----------------------------------------------------
161 ; Definition of (logical) top 2 memory pages
163 sysram_start equ 0FE00h
168 ivtab equ 0ffc0h ;int vector table
169 iv2tab equ ivtab + 2*9
173 ;-----------------------------------------------------
182 mkbuf macro id,name,size
183 if ((size AND (size-1)) NE 0) OR (size GT 256)
184 .printx Error: buffer ^size must be power of 2 and in range 0..256!
185 name&.mask equ ;wrong size error
191 name&.mask equ low (size-1)
200 ;-----------------------------------------------------
208 ??ps.len defl $ - ??ps.a
213 ;-----------------------------------------------------
215 b0hlcall macro address
220 ;-----------------------------------------------------
221 ; shift accu right logical n bits
250 ;-----------------------------------------------------
251 ; convert bit mask to bit number