]> cloudbase.mooo.com Git - z180-stamp.git/blob - z180/config.inc
my_getchar() parameter: allow return without new character
[z180-stamp.git] / z180 / config.inc
1
2
3 FOSC equ 9216 ;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_rx_fifo_len equ 256
45 msg_tx_fifo_len equ 256
46
47
48 s1.rx_len equ 256 ;Serial 1 (ASCI1) buffers
49 s1.tx_len equ 256 ;
50
51 AVRINT5 equ 40h
52 AVRINT6 equ 50h
53 ;PMSG equ 80h
54
55 ;-----------------------------------------------------
56 ; Definition of (locical) top 2 memory pages
57
58 sysram_start equ 0FE00h
59 stacksize equ 80
60
61 isvsw_loc equ 0FEE0h
62
63 ivtab equ 0ffc0h ;int vector table
64 iv2tab equ ivtab + 2*9
65
66
67
68 ;-----------------------------------------------------
69
70
71 o.mask equ -3
72 o.in_idx equ -2
73 o.out_idx equ -1
74
75 .lall
76
77 mkbuf macro name,size
78 if ((size & (size-1)) ne 0) or (size gt 256)
79 .printx Error: buffer ^size must be power of 2 and in range 0..256!
80 name&.mask equ ;wrong size error
81 else
82 ds 3
83 name:: ds size
84 name&.mask equ low (size-1)
85 if size ne 0
86 name&.end equ $-1
87 name&.len equ size
88 endif
89 endif
90 endm
91
92 ;-----------------------------------------------------
93
94 inidat macro
95 cseg
96 ??ps.a defl $
97 endm
98
99 inidate macro
100 ??ps.len defl $ - ??ps.a
101 dseg
102 ds ??ps.len
103 endm
104