]>
Commit | Line | Data |
---|---|---|
9c15f366 L |
1 | ; DRAM interface for 2 RAM chips. Supports up to 4 Mbyte of DRAM. |
2 | ; This is part of the Z80-CP/M emulator written by Sprite_tm. | |
3 | ||
4 | ; Copyright (C) 2010 Leo C. | |
5 | ||
6 | ; This file is part of avrcpm. | |
7 | ; | |
8 | ; avrcpm is free software: you can redistribute it and/or modify it | |
9 | ; under the terms of the GNU General Public License as published by | |
10 | ; the Free Software Foundation, either version 3 of the License, or | |
11 | ; (at your option) any later version. | |
12 | ; | |
13 | ; avrcpm is distributed in the hope that it will be useful, | |
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ; GNU General Public License for more details. | |
17 | ; | |
18 | ; You should have received a copy of the GNU General Public License | |
19 | ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>. | |
20 | ; | |
21 | ; $Id$ | |
22 | ; | |
23 | ||
24 | .cseg | |
25 | ||
26 | ; ------------------ DRAM routines ------------- | |
27 | ||
28 | ;Loads the byte on address xh:xl into temp. | |
29 | ;must not alter xh:xl | |
30 | ||
31 | dram_read: | |
32 | cli ; | |
33 | out PORTD,xh ;1 | |
34 | out PORTC,_RAS0 ;1 | |
35 | out PORTD,xl ;1 | |
36 | out PORTC,_CAS0 ;1 | |
37 | out DDRD,_0 ;1 | |
38 | out PORTC,_OE ;1 | |
39 | rjmp PC+1 ;2 | |
40 | dram_wait DRAM_WAITSTATES ; | |
41 | in temp,PIND ;1 | |
42 | out PORTC,_255 ;1 | |
43 | out DDRD,_255 ;1 | |
44 | sei ; | |
45 | ret | |
46 | ||
47 | ||
48 | ||
49 | ;Writes the byte in temp to xh:xl | |
50 | ;must not alter xh:xl | |
51 | ||
52 | dram_write: | |
53 | cli | |
54 | out PORTD,xh ;1 | |
55 | out PORTC,_RAS0 ;1 | |
56 | out PORTD,xl ;1 | |
57 | out PORTC,_CAS0 ;1 | |
58 | out PORTD,temp ;1 | |
59 | out PORTC,_WE ;1 | |
60 | out PORTC,_255 ;1 = 7 | |
61 | sei | |
62 | ret | |
63 | ||
64 |