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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/26/99 12:31
Read: times


 
#394 - RE: Greater then less then
ORG 0000H
MOV A,P1
CLR C
CJNE A,#126,CHECK1 ; if a=126 go to next line acall ;on
ACALL ON ; else jump to check1
AJMP 0000h
CHECK1: JNC UP ; if A>126 then C is not ;set...jump to up
ACALL ON ; else acall on
AJMP 0000h
UP: CJNE A,#254,TURNOFFV1 ; if a=254 go to next line ;acall off
ACALL OFF
AJMP 0000h
TURNOFFV1: CLR P2.0
SETB P2.1
AJMP 0000H

ON: ORL P2,#00000011B
RET
OFF: ANL P2,#11111100B
RET


------------------------------------------------------------------------------------------------------

U can have the same result with this code use subb instruction


ORG 0000H
MOV A,P1
MOV R0,P1
CLR C
SUBB A,#127
JNC UP
ORL P2,#00000011B
AJMP 0000H
UP: MOV A,R0
XRL A,#254
JZ OFF
CLR P2.0
SETB P2.1
AJMP 0000H
OFF: ANL P2,#11111100B
AJMP 0000H


List of 6 messages in thread
TopicAuthorDate
Greater then less then            01/01/70 00:00      
RE: Greater then less then            01/01/70 00:00      
RE: Greater then less then            01/01/70 00:00      
RE: Greater then less then            01/01/70 00:00      
RE: Greater then less then            01/01/70 00:00      
RE: Greater then less then            01/01/70 00:00      

Back to Subject List