| ??? 12/02/03 10:25 Read: times |
#59769 - RE: 6 Decimal Digits Counter Responding to: ???'s previous message |
When I have had to program a PIC16Cxx series part I have always used the PARALLAX assembler. This assembler has a set of opcodes that are actually assembled into a sequence of from 1 to 5 PIC instructions. These high level macro type instructions allow you to code in an assembler syntax that looks a whole lot more like an Intel type instruction set. Here is a snippet of code from a 16C54 project that used these PARALLAX assembler opcodes.
;
;
;routine to get the key stroke status for two key roll over check.
;this maintains two active key strokes in the "key1" and "key2"
;variables. key2 is the second key down code. This routine should
;be called periodically (about once each 10-30 milliseconds)
;
KEYfetch
cjae key1,#KEY_NONE,keyfet_d ;there is no key 1
mov W,key1
call keycheck ;see if key1 still down
jc keyfet_a ;key 1 still down
;
mov key1,key2 ;key 1 went away to copy 2 to 1
mov key2,#KEY_NONE
jmp keyfetch ;retest the new key 1
;
;processing section when key1 still down
keyfet_a
cjae key2,#KEY_NONE,keyfet_b ;look for new key2 if none now
mov W,key2
call keycheck ;see if key2 still down
jc keyfet_x ;exit if key2 still down
;
keyfet_b
call keycode ;look for a new key2
cjne keycnt,key1,keyfet_c ;skip if this is same as key1
call keynext ;look beyond the key1 bit
keyfet_c
mov key2,keycnt ;save the "new" key 2 code
jmp keyfet_x
;
;processing section when no key so look for new one
keyfet_d
call keycode
mov key1,keycnt ;save the "new" key 1 code
;
keyfet_x
ret
Looks a lot like 8051 code huh!!! Michael Karas |



