CALC-TI: Programming Request


[Prev][Next][Index][Thread]

CALC-TI: Programming Request



When you asm programmers write delay loops, DO NOT USE NORMAL LOOPS.  If at all
possible, use the HALT instruction, which basically disables the processor until
the next interrupt occurs (every 200th of a second).  Not only does this make
your programs more efficient and smaller (by using 1-byte delay counters), but
it will ensure that the program runs at the same speed on both normal and turbo
calculators. Here is an example: (To delay 1/8 second: it takes 6 bytes)
  :
  :
  ld  b, 25    ;200/8=25
Loop:
  HALT         ;Wait 1/200 sec.
  DJNZ Loop
  :
  :

I owe this tip to Jimmy Mardell.

James Yopp