Mercurial > hg > Members > kono > nitros9-code
annotate level1/modules/boot_dw.asm @ 2773:ce3dba57003b lwtools-port
boot_dw now uses dwinit.asm.
dwinit.asm updated for Arduino
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Wed, 23 Jan 2013 14:54:29 -0600 |
parents | 05b648103e78 |
children | e0614e08fa5e |
rev | line source |
---|---|
2180 | 1 ******************************************************************** |
2 * Boot - DriveWire 3 Boot Module | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Edt/Rev YYYY/MM/DD Modified by | |
7 * Comment | |
8 * ------------------------------------------------------------------ | |
9 * 1 2008/02/09 Boisy G. Pitre | |
10 * Created. | |
11 | |
12 NAM Boot | |
13 TTL DriveWire Boot Module | |
14 | |
15 IFP1 | |
16 USE defsfile | |
2624 | 17 USE drivewire.d |
2180 | 18 ENDC |
19 | |
20 tylg SET Systm+Objct | |
21 atrv SET ReEnt+rev | |
22 rev SET 0 | |
23 edition SET 1 | |
24 | |
25 MOD eom,name,tylg,atrv,start,size | |
26 | |
27 * on-stack buffer to use | |
28 ORG 0 | |
29 seglist RMB 2 pointer to segment list | |
30 blockloc RMB 2 pointer to memory requested | |
31 blockimg RMB 2 duplicate of the above | |
32 bootloc RMB 3 sector pointer; not byte pointer | |
33 bootsize RMB 2 size in bytes | |
34 LSN0Ptr RMB 2 LSN0 pointer | |
35 size EQU . | |
36 | |
37 name EQU * | |
38 FCS /Boot/ | |
39 FCB edition | |
40 | |
41 | |
42 * Common booter-required defines | |
43 LSN24BIT EQU 1 | |
44 FLOPPY EQU 0 | |
45 | |
46 | |
47 USE boot_common.asm | |
48 | |
49 | |
50 ************************************************************ | |
51 ************************************************************ | |
52 * Hardware-Specific Booter Area * | |
53 ************************************************************ | |
54 ************************************************************ | |
55 | |
56 * HWInit - Initialize the device | |
57 * Entry: Y = hardware address | |
58 * Exit: Carry Clear = OK, Set = Error | |
59 * B = error (Carry Set) | |
60 HWInit | |
2773
ce3dba57003b
boot_dw now uses dwinit.asm.
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2724
diff
changeset
|
61 use dwinit.asm |
2180 | 62 |
63 HWTerm clrb | |
64 rts | |
65 | |
66 | |
67 * HWRead - Read a 256 byte sector from the device | |
68 * Entry: Y = hardware address | |
69 * B = bits 23-16 of LSN | |
70 * X = bits 15-0 of LSN | |
71 * blockloc,u = ptr to 256 byte sector | |
72 * Exit: X = ptr to data (i.e. ptr in blockloc,u) | |
73 HWRead | |
74 pshs cc,d,x | |
75 * Send out op code and 3 byte LSN | |
76 lda #OP_READEX load A with READ opcode | |
77 Read2 ldb WhichDrv,pcr | |
78 std ,s | |
79 leax ,s | |
80 ldy #5 | |
2182 | 81 lbsr DWWrite send it to server |
2180 | 82 * Get 256 bytes of sector data |
83 ldx blockloc,u | |
2231
27f07aa0bca0
Updated modules to use Darren Atkinson's latest changes to low level read/write routines
boisy
parents:
2182
diff
changeset
|
84 ldy #256 |
2182 | 85 bsr DWRead read bytes from server |
2180 | 86 bcs ReadEr branch if framing error |
2231
27f07aa0bca0
Updated modules to use Darren Atkinson's latest changes to low level read/write routines
boisy
parents:
2182
diff
changeset
|
87 bne ReadEr2 |
2180 | 88 |
89 * Send two byte checksum | |
90 pshs y | |
91 leax ,s | |
92 ldy #2 | |
2182 | 93 lbsr DWWrite |
2231
27f07aa0bca0
Updated modules to use Darren Atkinson's latest changes to low level read/write routines
boisy
parents:
2182
diff
changeset
|
94 ldy #1 |
2182 | 95 bsr DWRead |
2180 | 96 leas 2,s |
97 bcs ReadEx | |
98 bne ReadEr2 | |
99 ldb ,s | |
100 beq ReadEx | |
101 cmpb #E_CRC | |
102 bne ReadEr | |
103 lda #OP_REREADEX | |
104 bra Read2 | |
105 ReadEx EQU * | |
106 leas 5,s eat stack | |
107 ldx blockloc,u | |
108 clrb | |
109 rts | |
110 ReadEr2 ldb #E$Read | |
111 ReadEr | |
112 leas 5,s eat stack | |
113 orcc #Carry | |
114 rts | |
115 | |
116 USE dwread.asm | |
117 USE dwwrite.asm | |
118 | |
119 IFGT Level-1 | |
120 Pad FILL $39,$1D0-3-2-1-* | |
121 ENDC | |
122 | |
123 Address FDB $0000 | |
124 WhichDrv FCB $00 | |
125 EMOD | |
126 eom EQU * | |
127 END |