annotate defs/corsham.d @ 3286:b9d9e3e53107

rules.mak: Whitespace fixes
author Tormod Volden <debian.tormod@gmail.com>
date Thu, 18 Jun 2020 23:55:13 +0200
parents ea1afb494127
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3182
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
1 ifne CORSHAM.D-1
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
2 CORSHAM.D set 1
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
4 ********************************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
5 * corsham.d - NitrOS-9 System Definitions for the Corsham 6809
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
6 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
7 * This is a high level view of the Corsham 6809 memory map as setup by
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
8 * NitrOS-9.
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
9 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
10 * $0000----> ==================================
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
11 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
12 * | NitrOS-9 Globals/Stack |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
13 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
14 * $0500---->|==================================|
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
15 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
16 * . . . . . . . . . . . . . . . . .
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
17 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
18 * | RAM available for allocation |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
19 * | by NitrOS-9 and Apps |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
20 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
21 * . . . . . . . . . . . . . . . . .
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
22 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
23 * $E000---->|==================================|
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
24 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
25 * $E000-$EFFF | Memory Mapped I/O Region |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
26 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
27 * $F000---->|==================================|
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
28 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
29 * $F000-$FFFF | ROM |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
30 * | |
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
31 * |==================================|
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
32 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
33 * $Id$
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
34 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
35 * Edt/Rev YYYY/MM/DD Modified by
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
36 * Comment
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
37 * ------------------------------------------------------------------
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
38 * 2017/04/29 Boisy G. Pitre
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
39 * Started
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
40
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
41 nam corsham.d
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
42 ttl NitrOS-9 System Definitions for the Corsham 6809
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
43
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
44 **********************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
45 * Ticks per second
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
46 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
47 IFNDEF TkPerSec
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
48 TkPerSec SET 50
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
49 ENDC
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
50
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
51
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
52 *************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
53 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
54 * NitrOS-9 Level 1 Section
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
55 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
56 *************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
57
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
58 HW.Page set $E0 Device descriptor hardware page
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
59
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
60
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
61 ********************************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
62 * NitrOS-9 Memory Definitions for the Corsham 6809
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
63 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
64
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
65 ********************************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
66 * Corsham 6809 Hardware Definitions
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
67 *
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
68
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
69 DATREGS equ $FFF0 DAT RAM CHIP
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
70
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
71
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
72 S.CharOut EQU $FFE9
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
73 S.StringOut EQU $FFEB
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
74
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
75 PSETWR equ $F006 ; PIA Set Write Mode
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
76 PSETRE equ $F009 ; PIA Set Read Mode
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
77 PREAD equ $F00F ; PIA Read Byte
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
78 PWRITE equ $F00C ; PIA Write Byte
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
79 CSETIMR equ $1E ; Set Timer Command to Arduino
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
80 RACK equ $82 ; Command Ack from Arduino
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
81
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
82 CONSLOT equ 1 console slot
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
83 SDSLOT equ 6 SD card slot
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
84 SLOTSIZ equ 16
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
85 IOBASE equ $E000
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
86
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
87 ;----------------------------------------------------
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
88 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
89 ; Which slot the parallel board is in. This needs to
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
90 ; be set for the system in use. As long as the user
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
91 ; programs only call functions in here, no other
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
92 ; file/application should know which slot the board
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
93 ; is in.
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
94
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
95 PIA0Base equ SDSLOT*SLOTSIZ+IOBASE
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
96 UARTBase equ CONSLOT*SLOTSIZ+IOBASE
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
97
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
98 PIAREGA equ 0 ;data reg A
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
99 PIADDRA equ 0 ;data dir reg A
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
100 PIACTLA equ 1 ;control reg A
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
101 PIAREGB equ 2 ;data reg B
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
102 PIADDRB equ 2 ;data dir reg B
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
103 PIACTLB equ 3 ;control reg B
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
104
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
105 ;----------------------------------------------------
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
106 ; Bits in the B register
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
107 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
108 DIRECTION equ %00000001
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
109 PSTROBE equ %00000010
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
110 ACK equ %00000100
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
111 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
112
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
113 org $DFC0
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
114 C.STACK RMB 2 TOP OF INTERNAL STACK / USER VECTOR
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
115 C.SWI3 RMB 2 SOFTWARE INTERRUPT VECTOR #3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
116 C.SWI2 RMB 2 SOFTWARE INTERRUPT VECTOR #2
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
117 C.FIRQ RMB 2 FAST INTERRUPT VECTOR
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
118 C.IRQ RMB 2 INTERRUPT VECTOR
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
119 C.SWI RMB 2 SOFTWARE INTERRUPT VECTOR
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
120 SVCVO RMB 2 SUPERVISOR CALL VECTOR ORGIN
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
121 SVCVL RMB 2 SUPERVISOR CALL VECTOR LIMIT
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
122 LRARAM RMB 16 LRA ADDRESSES
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
123
3183
6c9d02baa4d1 corsham: Add Bt.Track definition to corsham.d
Tormod Volden <debian.tormod@gmail.com>
parents: 3182
diff changeset
124 Bt.Start EQU $F000 Start address of the boot ROM in memory
3182
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
125 Bt.Size EQU $1000
3183
6c9d02baa4d1 corsham: Add Bt.Track definition to corsham.d
Tormod Volden <debian.tormod@gmail.com>
parents: 3182
diff changeset
126 Bt.Track EQU 0
3278
ea1afb494127 defs: Add Bt.Sec for atari and corsham
Tormod Volden <debian.tormod@gmail.com>
parents: 3183
diff changeset
127 Bt.Sec EQU 0
3182
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
128
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
129 ;*****************************************************
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
130 ; Parallel port protocol
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
131 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
132 ; This is the header file for making applications
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
133 ; compliant with The Remote Disk Protocol Guide which
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
134 ; is on the Corsham Technologies web page somewhere:
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
135 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
136 ; www.corshamtech.com
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
137 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
138 ; This was updated 06/13/2015 to be compliant with the
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
139 ; official specification, so the opcode values changed.
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
140 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
141 ;=====================================================
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
142 ; Commands from host to Arduino
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
143 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
144 PC_GET_VERSION equ $01
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
145 PC_PING equ $05 ;ping Arduino
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
146 PC_LED_CONTROL equ $06 ;LED control
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
147 PC_GET_CLOCK equ $07 ;Get RTC
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
148 PC_SET_CLOCK equ $08 ;Set RTC
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
149 PC_GET_DIR equ $10 ;Get directory
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
150 PC_GET_MOUNTED equ $11 ;Get mounted drive list
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
151 PC_MOUNT equ $12 ;Mount drive
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
152 PC_UNMOUNT equ $13 ;Unmount drive
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
153 PC_GET_STATUS equ $14 ;Get status for one drive
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
154 PC_DONE equ $15 ;Stop data
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
155 PC_ABORT equ PC_DONE
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
156 PC_READ_FILE equ $16 ;Read regular file (non-DSK)
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
157 PC_READ_BYTES equ $17 ;Read sequential bytes
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
158 PC_RD_SECTOR equ $18 ;Read FLEX sector
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
159 PC_WR_SECTOR equ $19 ;Write FLEX sector
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
160 PC_GET_MAX equ $1a ;Get maximum drives
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
161 PC_WRITE_FILE equ $1b ;Open file for writing
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
162 PC_WRITE_BYTES equ $1c ;Data to be written
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
163 PC_SAVE_CONFIG equ $1d ;Save current config data to file
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
164 PC_SET_TIMER equ $1e ;Turn on/off RTC timer
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
165 PC_READ_LONG equ $1f ;read sector using long sector num
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
166 PC_WRITE_LONG equ $20 ;write sector using long sec number
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
167 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
168 ;=====================================================
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
169 ; Responses from Arduino to host
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
170 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
171 PR_VERSION_INFO equ $81 ;Contains version information
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
172 PR_ACK equ $82 ;ACK (no additional information)
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
173 PR_NAK equ $83 ;NAK - one status byte follows
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
174 PR_PONG equ $85 ;Reply to a ping
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
175 PR_CLOCK_DATA equ $87 ;Clock data
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
176 PR_DIR_ENTRY equ $90 ;Directory entry
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
177 PR_DIR_END equ $91 ;End of directory entries
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
178 PR_FILE_DATA equ $92 ;File data
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
179 PR_STATUS equ $93 ;Drive status
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
180 PR_SECTOR_DATA equ $94 ;Sector data
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
181 PR_MOUNT_INFO equ $95 ;Mount entry
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
182 PR_MAX_DRIVES equ $96 ;Maximum number of drives
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
183 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
184 ;=====================================================
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
185 ; Error codes for NAK events
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
186 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
187 ERR_NONE equ 00
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
188 ERR_NOT_MOUNTED equ 10
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
189 ERR_MOUNTED equ 11
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
190 ERR_NOT_FOUND equ 12
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
191 ERR_READ_ONLY equ 13
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
192 ERR_BAD_DRIVE equ 14
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
193 ERR_BAD_TRACK equ 15
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
194 ERR_BAD_SECTOR equ 16
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
195 ERR_READ_ERROR equ 17
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
196
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
197 ;=====================================================
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
198 ; PIO subroutine module offsets
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
199 ;
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
200 org 0
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
201 PIO$Init rmb 3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
202 PIO$Read rmb 3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
203 PIO$Write rmb 3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
204 PIO$Term rmb 3
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
205
185c31229f22 Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff changeset
206 endc