C– – Efficiency
5-52
playing. In some cases speech files can be played to debounce keys. This is
why there is no delay in the main() function. Pressing SW2 calls a function, but
the switch will not be read again until the time has been spoken so there is no
need for a delay there.
Example 5–3. Third Project (C–– with an LCD)
The main difference between this project and the second project is the addition
of an LCD display. The variables storing the time were also changed to an
array of ints instead of separate int variables to demonstrate the use of C– –
arrays. This is not the clearest or easiest way to keep track of the time. It was
added as an example of C– – arrays. Multidimensional arrays are not
supported in C– –, but the same functionality can be achieved by multiplying
and adding the indices. For example, if an array is defined as:
int a [3*4]; // equivalent to int a [3][4] in C
Then the element at row x column y can be accessed by using index = rowNum
* row + column.
value = a[3*1+0]; // equivalent to value = a[1][0] in C
-
[Root]
J
cmm1.asm
J
cmm1_ram.irx
J
flags.irx
J
main.cmm
J
main.irx
J
main_ram.irx
J
mainasm.asm
J
vroncof2.asm
J
rtc.rpj
J
[dsp]
H
[celp]
celp.irx
celp4.obj
H
[common]
util.obj
util2.obj
H
[general]
dsp_var.irx
dsputil.asm
getbits.asm
speak.asm
speak.irx
spk_ram.irx
H
[melp]
Содержание MSP50C6xx
Страница 1: ...MSP50C6xx Mixed Signal Processor User s Guide Mixed Signal Products SPSU014A Printed on Recycled Paper...
Страница 6: ...vi...
Страница 14: ...xiv...
Страница 24: ...1 10...
Страница 296: ...Instruction Set Summay 4 210 Assembly Language Instructions...
Страница 332: ...Implementation Details 5 36 R7 Return Addr Return Addr Param 2 Param 2 Param 1 Param 1 R5 Stack data Function call...
Страница 366: ...6 12...