Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/19/01 05:06
Read: times


 
#15032 - RE: Need Help W/someone elses code......
Here's the same code "prettied up" and commented. As J. Guy stated, this is basically an array where byte values are used to represent the state of the bits passed in the accumulator.


;This is for In41,42,43
mov r3,#3 ; r3 is a loop counter

XPT05:
rrc a ; shift bit 0 into carry
push ACC ; save value for a sec
jnc XPTOFF ; jump if bit not set

XPTON:
; here if bit is set
mov a,#ON ; acc = 'ON' value
sjmp XPT10 ; skip on down

XPTOFF:
clr a ; acc = 'OFF' value

XPT10:
movx @DPTR,a ; write bit state
inc DPTR ; next byte in array
pop ACC ; restore value
djnz r3,XPT05; loop 3 times

;now just Concentrate in IN48

rrc a ; skip the next 5 bits
inc DPTR ; and table entries
rrc a
inc DPTR
rrc a
inc DPTR
rrc a
inc DPTR
rrc a

jnc XXOFF ; same check as before
mov a,#ON
sjmp XX10

XXOFF:
clr a
XX10:
movx @DPTR,a
inc DPTR


List of 6 messages in thread
TopicAuthorDate
Need Help W/someone elses code......            01/01/70 00:00      
RE: Need Help W/someone elses code......            01/01/70 00:00      
RE: Need Help W/someone elses code......            01/01/70 00:00      
RE: Need Help W/someone elses code......            01/01/70 00:00      
RE: Need Help W/someone elses code......            01/01/70 00:00      
RE: Need Help W/someone elses code......            01/01/70 00:00      

Back to Subject List