Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How do I program the 68HC11 Microcontroler to use time delays.?
Here is an example of the code I need to use
DELAY LDX #$FFFF
More: DEX
NOP
NOP
NOP
NOP
BNE More
RTS
That is an example the teacher gave me for a time delay of about one second. I need to know how to the number $FFFF was determined.
1 Answer
- SolLv 41 decade agoFavorite Answer
It depends on your processor speed. You need to figure out how many clock cycles your code takes (off the top of my head, I think the NOP command is 3, but you'd have to check an OPCODE sheet), and then using the processor speed (1 MHz or whatever), you can figure out how many clock cycles need to occur to creat a 1 ms delay or whatever, and then you can just cycle down from, in this case $FFFF down to $0 to cause the delay.