1 ; DRAM interface for *one* 256K x 4 bit DRAM chip.
2 ; This is part of the Z80-CP/M emulator written by Sprite_tm.
4 ; Copyright (C) 2010 Sprite_tm
5 ; Copyright (C) 2010 Leo C.
7 ; This file is part of avrcpm.
9 ; avrcpm is free software: you can redistribute it and/or modify it
10 ; under the terms of the GNU General Public License as published by
11 ; the Free Software Foundation, either version 3 of the License, or
12 ; (at your option) any later version.
14 ; avrcpm is distributed in the hope that it will be useful,
15 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ; GNU General Public License for more details.
19 ; You should have received a copy of the GNU General Public License
20 ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
26 ;----------------------------------------------
28 ; Loads the byte on address xh:xl into temp.
29 ; Uses temp2. Must not alter xh:xl
34 DRAM_SETADDR xh, ~0,(1<<ram_ras), ~(1<<ram_a8), (1<<ram_oe)
36 DRAM_SETADDR xl, ~(1<<ram_ras),0, ~((1<<ram_oe)), (1<<ram_a8)
39 dram_wait DRAM_WAITSTATES ;
46 dram_wait DRAM_WAITSTATES ;
58 ;Writes the byte in temp to xh:xl
59 ; Uses temp2. Must not alter xh:xl
63 ldi temp2,RAM_DQ_MASK | (1<<ram_w) | (1<<ram_cas)
67 andi temp,RAM_DQ_MASK & ~(1<<ram_w)
70 DRAM_SETADDR xh, ~0,(1<<ram_ras), ~(1<<ram_a8),(1<<ram_oe)
72 DRAM_SETADDR xl, ~(1<<ram_ras),0, ~((1<<ram_a8)),(1<<ram_oe)
79 andi temp2,RAM_DQ_MASK & ~(1<<ram_w)
80 ori temp2,(1<<ram_cas)
82 cbr temp2,(1<<ram_cas)
84 ldi temp,~RAM_DQ_MASK | (1<<ram_w) | (1<<ram_cas)
91 ; vim:set ts=8 noet nowrap