| ??? 12/16/03 16:12 Read: times |
#60745 - RE: if then construction in assembly Responding to: ???'s previous message |
hi,
Why isnt there a CJE instruction or im i just missing the point? Both yes and no. Okay, let imagine that CJE is presented, and what we will have then... CJNE requires 3 bytes of code. So, CJE might take the same size. Let say, you have all the 256 CJE comparisons in-line and so it eats 768 bytes of the program memory. Now try to answer: how may it be possible to do short jump (CJE uses relative +/-128 dimension) from middle of those CJE,CJE,CJE etc? :) Opposite it, CJNE gives you a chance to do LONG jump or CALL near comparison command if you have found appropriate condition. Btw, here you may use another way, if need: ; R0 contains examined value MOV A,#1 XRL A,R0 JZ ROUTINE_1 MOV A,#2 XRL A,R0 JZ ROUTINE_2etc And even more: if you look at code I typed above more careful than you may find even shoten way than I shown (= cu |
| Topic | Author | Date |
| if then construction in assembly | 01/01/70 00:00 | |
| RE: if then construction in assembly | 01/01/70 00:00 | |
| RE: if then construction in assembly | 01/01/70 00:00 | |
| RE: if then construction in assembly | 01/01/70 00:00 | |
| RE: if then construction in assembly | 01/01/70 00:00 | |
| Jump table | 01/01/70 00:00 | |
| RE: Jump table | 01/01/70 00:00 | |
| RE: if then construction in assembly | 01/01/70 00:00 | |
RE: if then construction in assembly | 01/01/70 00:00 | |
| don\'t forget the carry | 01/01/70 00:00 |



