??? 07/20/06 14:55 Read: times |
#120683 - a faster, simpler method Responding to: ???'s previous message |
I'm wholeheartedly open to contributions/comments/suggestions/questions/criticisms.
your code: JMP @A+DPTR ;24 JMPTBL: JMP APLYMV ;24 JMP APLYHD JMP APLYFL JMP APLYFD JMP APLYTW JMP APLYSP APLYMV: CLR HOLD ;12 CLR FLASH ;12 CLR FADE ;12 CLR TWINKLE ;12 CLR SPARKLE ;12 JMP HELLOUT ;24 APLYHD: SETB HOLD CLR FLASH CLR FADE CLR TWINKLE CLR SPARKLE JMP HELLOUTcan be made simpler and faster this way // I use C definitions; Keil accept them for assembler features ds 1 ; use some bit addressable location (e.g. 20h #define HOLD features^4 #define FLASH features^3 #define FADE features^2 #define TWINKLE features^1 #define SPARKLE features^o #define M_HOLD 0x10 #define M_FLASH 0x08 #define M_FADE 0x04 #define M_TWINKLE 0x02 #define M_SPARKLE 0x01 now the code becomes movc a,@A+DPTR mov features,a locate this elsewhere ;0 + M_HOLD + M_FLASH + M_FADE + M_TWINKLE + M_SPARKLE JMPTBL: dw 0 dw 0 + M_HOLD ....Erik |