]> cloudbase.mooo.com Git - z180-stamp.git/blob - Z180/config.inc
check in Z180 subtree
[z180-stamp.git] / Z180 / config.inc
1
2
3 FOSC equ 18432 ;Oscillator frequency [KHz]
4 PHI equ FOSC/2 ;CPU frequency
5
6 ;-----------------------------------------------------
7 ; Programmable Reload Timer (PRT)
8
9 PRT_PRE equ 20 ;PRT prescaler
10
11 ; Reload value for 10 ms Int. (0.1KHz):
12 ; tc10ms = phi/prescale/0.1KHz = phi / (prescale/10)
13
14 PRT_TC10MS equ PHI / (PRT_PRE/10)
15
16 ;-----------------------------------------------------
17 ; MMU
18
19 SYS$CBAR equ 0C8h
20 USR$CBAR equ 0F0h
21
22
23 BANKS equ 18 ;max nr. of banks
24
25 ;-----------------------------------------------------
26
27 CREFSH equ 0 ;Refresh rate register (disable refresh)
28 CWAITIO equ 3 shl IWI0 ;Max I/O Wait States, 0 Memory Wait States
29
30
31 ROMSYS equ 0
32
33 if ROMSYS
34 c$rom equ 0a5h
35 ROM_EN equ 0C0h
36 ROM_DIS equ ROMEN+1
37 CWAITROM equ 2 shl MWI0
38 endif
39
40
41 DRSTNUM equ 30h ;DDTZ Restart vector (breakpoints)
42
43
44 msg_fb_len equ 256
45 rx.buf_len equ 20h
46 tx.buf_len equ 80h
47 rx.buf_len equ 20h
48 tx.buf_len equ 80h
49
50
51 s1.rx_len equ 256 ;Serial 1 (ASCI1) buffers
52 s1.tx_len equ 256 ;
53
54 PMSG equ 80h
55
56 ;-----------------------------------------------------
57 ; Definition of (locical) top 2 memory pages
58
59 sysram_start equ 0FE00h
60 stacksize equ 80
61
62 isvsw_loc equ 0FEE0h
63
64 ivtab equ 0ffc0h ;int vector table
65 iv2tab equ ivtab + 2*9
66
67
68
69 ;-----------------------------------------------------
70
71
72 o.mask equ -3
73 o.in_idx equ -2
74 o.out_idx equ -1
75
76 .lall
77
78 mkbuf macro name,size
79 if ((size & (size-1)) ne 0) or (size gt 256)
80 .printx Error: buffer ^size must be power of 2 and in range 0..256!
81 name&.mask equ ;wrong size error
82 else
83 ds 3
84 name:: ds size
85 name&.mask equ low (size-1)
86 if size ne 0
87 name&.end equ $-1
88 name&.len equ size
89 endif
90 endif
91 endm
92
93 ;-----------------------------------------------------
94
95 inidat macro
96 cseg
97 ??ps.a defl $
98 endm
99
100 inidate macro
101 ??ps.len defl $ - ??ps.a
102 dseg
103 ds ??ps.len
104 endm
105