1 ; Various functions for the Interaction with the CPM Filesystem
3 ; Copyright (C) 2010 Frank Zoll
5 ; This file is part of avrcpm.
7 ; avrcpm is free software: you can redistribute it and/or modify it
8 ; under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, either version 3 of the License, or
10 ; (at your option) any later version.
12 ; avrcpm is distributed in the hope that it will be useful,
13 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ; GNU General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with avrcpm. If not, see <http://www.gnu.org/licenses/>.
23 #ifndef RAMDSK_SUPPORT
24 #define RAMDSK_SUPPORT 0
29 ;-------------------------------------- Defines for RAMDISK Structures
31 ;----------------------------------------------- Start of Data Segment
35 rdskbuf: .byte 128 ; Buffer for RAM-Disk interaktions
37 ; ---------------------------------------------- Start of Code Segment
40 ; ====================================================================
41 ; Function: Calculate an sets the adress of Sector within the RAMDISK
42 ; ====================================================================
44 ; --------------------------------------------------------------------
46 ; Variables : [r] seeksec Sector to read
47 ; [r] seektrk Track to read
48 ; [w] temp3 Number of Bytes per Sector (128)
49 ; --------------------------------------------------------------------
51 ; ====================================================================
69 DRAM_SETADDR xh, ~0,(1<<ram_ras), ~0,(1<<ram_a8)|(1<<ram_oe)
82 ; ====================================================================
83 ; Function: Does a read opperation on a RAMDISK
84 ; ====================================================================
86 ; --------------------------------------------------------------------
88 ; Variables : [r] seeksec Sector to read
89 ; [r] seektrk Track to read
90 ; [r] flags RW operation Flags
91 ; [w] erflag Error Status of the operation
92 ; --------------------------------------------------------------------
94 ; ====================================================================
101 printstring "rd-adr: "
106 DRAM_SETADDR xl, ~(1<<ram_ras),0, ~((1<<ram_oe)), (1<<ram_a8)
110 dram_wait DRAM_WAITSTATES ;
117 dram_wait DRAM_WAITSTATES ;
118 in temp2,P_DQ-2 ; PIN
141 ; ====================================================================
142 ; Function: Does a write opperation on a RAMDISK
143 ; ====================================================================
145 ; --------------------------------------------------------------------
147 ; Variables : [r] seeksec Sector to read
148 ; [r] seektrk Track to read
149 ; [r] flags RW operation Flags
150 ; [w] erflag Error Status of the operation
151 ; --------------------------------------------------------------------
153 ; ====================================================================
158 printstring "wr-adr: "
171 ldi temp2,RAM_DQ_MASK | (1<<ram_w) | (1<<ram_cas)
177 andi temp,RAM_DQ_MASK & ~(1<<ram_w)
178 ori temp,(1<<ram_cas)
180 DRAM_SETADDR xl, ~(1<<ram_ras),0, ~((1<<ram_a8)),(1<<ram_oe)
185 andi temp2,RAM_DQ_MASK & ~(1<<ram_w)
186 ori temp2,(1<<ram_cas)
195 ldi temp,~RAM_DQ_MASK | (1<<ram_w) | (1<<ram_cas)