| ??? 03/24/00 01:54 Read: times |
#1928 - Figuring out a detail of DJNZ |
There has been an argument between my lab partner and I about how DJNZ works.
Background: Say I have the following code: MOV RO, #233 MOV R1, #1 ; DELAY: DJNZ R0, DELAY DJNZ R1, DELAY The documentation seems to say that the content of the first argument of DJNZ gets decremented and if it's not zero, control goes to the location specfied in the second argument. (I know, hardly news). The question is whether the decrement is a "real" decrement, that is, does the actual contents of R0 get changed or not. If it is a real decrement, then when "DJNZ R1, DELAY" executes, making "DJNZ R0, DELAY" execute, the contents of R0 will be zero, not 233, since the first bunch of loops involving "DJNZ R0, DELAY" (before "DJNZ R1, DELAY" got around to being executed) will have caused the content of R0 to be decremented until the content of R0 become zero. If the decrement isn't real, then when "DJNZ R1, DELAY" executes, making "DJNZ R0, DELAY" execute, the contents of R0 will still be 233, since the actual value of R0 was untouched. The reason this matter is it affects how long a pause those DJNZ loops make. So is the decrement done in DJNZ real or not? |
| Topic | Author | Date |
| Figuring out a detail of DJNZ | 01/01/70 00:00 | |
| RE: Figuring out a detail of DJNZ | 01/01/70 00:00 | |
| RE: Figuring out a detail of DJNZ | 01/01/70 00:00 | |
| RE: Figuring out a detail of DJNZ | 01/01/70 00:00 | |
| RE: Figuring out a detail of DJNZ | 01/01/70 00:00 | |
RE: Figuring out a detail of DJNZ | 01/01/70 00:00 |



