OR gate
Lightfoot
Posts: 228
I attempted to program an or gate using the ra channel for inputs. It does not work. This code may not work, it is an approximation of what I did.
plp_a = 0
tris_b = 0
rb = 0
a var byte
b var byte
cc var byte
d var byte
result var byte
Main
a = ra.0
b = ra.1
cc = ra.2
d = ra.3
result = a | b
result = result | cc
result = result | d
rb.0 = result
goto Main:
plp_a = 0
tris_b = 0
rb = 0
a var byte
b var byte
cc var byte
d var byte
result var byte
Main
a = ra.0
b = ra.1
cc = ra.2
d = ra.3
result = a | b
result = result | cc
result = result | d
rb.0 = result
goto Main:
Comments
tris_b = 0
rb = 0
Main:
· ra = ra & $0F ' This doesn't affect ra port, it just sets the zero flag
· rb.0 = ~Z
· GOTO Main
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Forget about the past, plan for the future, and live for today.
·