| ??? 04/04/00 23:11 Read: times |
#2081 - RE: Figuring out a detail of DJNZ |
The DJNZ is a very useful instruction to "ABUSE." By that I mean that you need not think of it as a mere looping jump.
For example, turning the loop inside-out can make for some even more useful implementations. For example: In my tasker design I thread in various background tasks, that often must delay awhile before allowing the task to run and do something useful like moving things, detasking or threading in another task. Most of my task threads start with a DJNZ: ;----------------- tsk_50ms: . djnz d_l1,xit_50ms . mov d_l1,#reload_l1 . djnz d_l2,xit_50ms ;no reload nec . setb b_50ms ;flag done . (code to detask tsk_50ms) . ;drop-through xit_50ms: . ljmp nxt_tsk ;return to tasker ;----------------- A foreground call like the following would intialize the task and thread it. ;----------------- fgnd_50ms: . clr b_50ms . mov d_l1,#reload_l1 . mov d_l2,#reload_l2 . (code to task tsk_50ms) . ret ;----------------- |
| 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 |



