eeec
Newbie level 4
- Joined
- Jan 21, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,355
encoder = ra
out = rb.1
direction = rb.0
flash = rb.5
temp = 0Ch
counter = 0Dh
old = 0Eh
new = 0Fh
flag = 1Fh
armed = 1Eh
device pic16c54,rc_osc,wdt_off,protect_on
reset start
org 0
start mov !rb,#00100000b Why is there an exclamation mark?
mov !ra,#255
mov counter,#128
clrb out
mov old, encoder
and old, #00000011b loop
jb flash,test
call check_encoder
flashing cje counter,#128,loop
jb flag,timeout
mov OPTION,#00000111b
mov RTCC,#248
setb flag
timeout mov w,RTCC
jz drive
jmp loop
drive clrb flag
jb out,lower
setb out
clrb armed
jmp cont
lower clrb out
setb armed
cont cja counter,#128,down
clrb direction
snb armed
inc counter
jmp try_done
down setb direction
snb armed
dec counter
try_done cjne counter,#128,loop
clrb flag
jmp loop
check_encoder mov new, encoder
and new, #00000011b
mov temp, new
xor temp, old
jz :return
clc
rl old
xor old, new
jb old.1, :up
:down dec counter
skip
:up inc counter
mov old,new
:return ret
test mov counter,#129
jmp flashing
------------------------------------------------------------------------------------------
END
-------------------------------------------------------------------------------------------
can someone explain these code to me? especially the one in bold?
anyone can help me? thanks a million
i have to explain it to my supervisor but i don't know how. attachment for the 2 files.
out = rb.1
direction = rb.0
flash = rb.5
temp = 0Ch
counter = 0Dh
old = 0Eh
new = 0Fh
flag = 1Fh
armed = 1Eh
device pic16c54,rc_osc,wdt_off,protect_on
reset start
org 0
start mov !rb,#00100000b Why is there an exclamation mark?
mov !ra,#255
mov counter,#128
clrb out
mov old, encoder
and old, #00000011b loop
jb flash,test
call check_encoder
flashing cje counter,#128,loop
jb flag,timeout
mov OPTION,#00000111b
mov RTCC,#248
setb flag
timeout mov w,RTCC
jz drive
jmp loop
drive clrb flag
jb out,lower
setb out
clrb armed
jmp cont
lower clrb out
setb armed
cont cja counter,#128,down
clrb direction
snb armed
inc counter
jmp try_done
down setb direction
snb armed
dec counter
try_done cjne counter,#128,loop
clrb flag
jmp loop
check_encoder mov new, encoder
and new, #00000011b
mov temp, new
xor temp, old
jz :return
clc
rl old
xor old, new
jb old.1, :up
:down dec counter
skip
:up inc counter
mov old,new
:return ret
test mov counter,#129
jmp flashing
------------------------------------------------------------------------------------------
END
-------------------------------------------------------------------------------------------
can someone explain these code to me? especially the one in bold?
anyone can help me? thanks a million
i have to explain it to my supervisor but i don't know how. attachment for the 2 files.