176/317
6 - STMicroelectronics Programming Tools
Delay500:
ld a, #DELAY1
; 2 cycles
ld Time, a
; 4 cycles
Loop1:
ld a, #DELAY2
; 2 cycles
ld {Time+1}, a
; 4 cycles
Loop2:
ld a, #DELAY3
; 2 cycles
ld {Time+2}, a
; 4 cycles
Loop3
ld a, #watch
; 2 cycles
ld wdgr, a
; 4 cycles
dec {Time+2}
; 5 cycles
jrne Loop3
; 3 cycles
dec {Time+1}
; 5 cycles
jrne Loop2
; 3 cycles
dec Time
; 5 cycles
jrne Loop1
; 3 cycles
ret
END
; Internal loop: 14 cycles
; Intermediate loop: 14 cycles
; External loop: 14 cycles
; total: (((((14*14)*14)*14)*0.25
; =493519 microseconds
You may have noticed that the secondary source file provides one public label, and that the
corresponding external declaration stands in the main program.
6.4.3.3 The
REG72251.ASM
file and the
REGISTER.INC
file
The
REG72251.ASM
file contains the declaration of all the registers of the ST72251 in an abso-
lute segment, because their addresses are fixed by hardware. E ach declaration is made
public by adding a dot before each label, so that any other source file of the project can make
refe rence to the registers, pro vided the necessary
EXTERN
statem ents are a dded to tha t
source file. Here is an excerpt from the
REG72251.ASM
file:
ST7/
;*************************************************************
;*
ST72251 registers :
;*
This file declares the labels of all the registers
;*
of the Input/Output peripherals. The bit numbers
;*
within each register and the corresponding EXTERN
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...