1 ; Configuration and common defs for avrcpm BIOS and IPL
3 ; Copyright (C) 2010 Leo C.
5 ; This program is free software: you can redistribute it and/or modify
6 ; it under the terms of the GNU General Public License as published by
7 ; the Free Software Foundation, either version 3 of the License, or
8 ; (at your option) any later version.
10 ; This program is distributed in the hope that it will be useful,
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ; GNU General Public License for more details.
15 ; You should have received a copy of the GNU General Public License
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
21 msize equ 62 ;size of available RAM in k
23 bias equ (msize-20) * 1024
24 ccp equ 3400h+bias ;base of cpm ccp
25 bdos equ ccp+806h ;base of bdos
26 bios equ ccp+1600h ;base of bios
27 cdisk equ 0004h ;current disk number (0 ... 15)
28 iobyte equ 0003h ;intel iobyte
29 buff equ 0080h ;default buffer address
30 retry equ 3 ;max retries on disk i/o before error
33 ;copy from avr/virt_ports.asm:
34 ; Port Direction Function
36 ;-------------------------------------------------------------------------
37 ;00 0 in - Con status.
38 ; Returns 0xFF if the UART has a byte, 0 otherwise.
39 ;01 1 in/out - Console input, aka UDR. / Console Output
40 ;02 2 out - Console Output (deprecated)
41 ;03 3 in - "UART" status: bit 0 = rx, bit 1 = tx
42 ;04 4 in - "UART" data register, no wait
44 ;------------------------ Virtual I2C interface --------------------------
45 ;05 5 out - Control Port: 1 = Start read operation
46 ; 2 = Start write operation
47 ;05 5 in - Status of last Transfer: 0 = ok, else fail
48 ;06 6 in/out - Number of bytes to transfer, including Slave address
49 ;07,08 7,8 in/out - Read/Write address low/high
51 ;------------------------ Disk I/O ---------------------------------------
52 ;0D,0E 13,14 in/out - Set address of Bios Controll Block
53 ;0F 15 in/out - Disk select
54 ;10,11 16,17 in/out - Track select
55 ;12,13 18,19 in/out - Sector select
56 ;14,15 20,21 in/out - Write addr
58 ;16 22 out - Trigger disk i/o operations
59 ; Bit 7 = 1: Read sector
60 ; Bit 6 = 1: Write sector
61 ; Bit 5 = 1: BIOS WBOOT
62 ; Bit 4 = 1: BIOS Home
63 ; Only one of bits 4..7 may be set.
64 ; If Write function (bit 6=1):
65 ; Bits 0..2: 0 - write to allocated
66 ; 1 - write to directory
67 ; 2 - write unallocated
68 ; 3 - write to directory
70 ;16 22 in - Result of last read/write operation.
71 ; 0x00 = ok, 0xff = error (--> Bad Sector)
75 ;------------------------ Wall Clock and Timers --------------------------
76 ;40 64-71 in/out - Timer/Clock control.
79 ;47-4D clock - BCD format: ss, mm, hh, DD, MM, YYl, YYh
81 ;------------------------ Ports ------------------------------------------
82 ;80-87 in/out - Port-Expander PCF8574 (max. 8 Chips)
83 ;88-8F in/out - Port-Expander PCF8574A (not implemented yet!)
92 TIMER_MSECS equ TIMERCTL+1
93 TIMER_SECS equ TIMER_MSECS+2
99 CLOCKPORT equ TIMERCTL+7