Download ZFx86 IDS Quick Start Guide

Transcript
Demonstration Program 224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
call
mov
process_RLE_header
ebp, BasketSize
LEA
CALL
mov
call
DI, message3
Print
eax, FlashBase
SerOut32
LEA
CALL
DI, message4
Print
PrgLoop:
;
4
; process RLE header if any
; total bytes to program
; Erase sector now
; ’0x’
; write AX as xxxx in hex
; ’: Erasing .. ’
There are two 3-byte sequences to do a sector erase.
push
pop
xor
(PRGBASE/10h)
fs
si, si
mov
call
mov
call
al, 80h
JEDEC_Cmd_8
al, 30h
JEDEC_Cmd_8
; fs:0 points to our memory window
; sector erase command part 1
; sector erase command part 2
comment * Erase is now in progress. Check, when we are ready. There is a
bur variable which is incremented 18.2 times/second. 182 times is a 10
second timeout. *
call
mov
mov
DSBX2Var
ax, 182
ds:[bx.CountDown], ax
mov
mov
out
inc
in
and
out
dx,
al,
dx,
dx
al,
al,
dx,
call
ZTPrepareRead
ZFINDEX
ZT_WRITE
al
dx
11110101b
al
; DS:BX -> BUR data area (RAM)
; gives 10sec. timeout
; ZT_SIG_OUT
;
;
;
; turn off LED’s
; ZFLogic back to track
comment * to test for erase, you only need to look at D7 which is forced to
a 0 until the erase is done. The FFFFFFF test below will accomplish the
Lines 224-225: Subroutine process_RLE_header will set variable BasketSize to the real (expanded value)
if this is a compressed basket. We then store BasketSize in EBP as we will use that as a count-down register. This is a rather unconventional use of EPB, but we are not using stack frame parameter passing...
Lines 241-245: There are 6 bytes which need to be output to the AMDFLASH chip to cause an erase.
Bytes 1-2 and 4-5 are the same. JEDEC_Cmd_8 will output two bytes and then take the third from the
value passed in AL. See the AMD Data Sheet. The code is in flashpgm.asm. It uses PRGBASE to access
the memory segment.
Line 251: DSBS2Var sets DS:BX to point to a common data area in the BUR. Included in this is a word
variable which is decremented ever time tick, bx.CountDown. The ".CountDown" is a structure reference
and provides in the assembler the proper OFFSET and TYPE for the variable.
Manual Revision 1.4
IDS Quick Start Guide
Page 41