Rookie SX/B question
I am new to the SX/B and my project requires a byte wide output port on port C. When I code this in SX/B, I get a less than optimum output. The code snippet below shows my SX/B vs. ASM for the same function. I would prefer not to inline - Is there a better method or trick that would help?
Thanks
' set port C to 8 bits of output
SXB_code:
output RC.0
output RC.1
output RC.2
output RC.3
output RC.4
output RC.5
output RC.6
output RC.7
SASM_code:
'' inline asm version
\ MOV FSR,#TRIS_C 'output RC.0-RC.7
\ CLR IND ' all outputs
\ MODE $0F
\ MOV !RC,IND
\ BANK $00
Thanks
' set port C to 8 bits of output
SXB_code:
output RC.0
output RC.1
output RC.2
output RC.3
output RC.4
output RC.5
output RC.6
output RC.7
SASM_code:
'' inline asm version
\ MOV FSR,#TRIS_C 'output RC.0-RC.7
\ CLR IND ' all outputs
\ MODE $0F
\ MOV !RC,IND
\ BANK $00
Comments
· TRIS_C = %00000000
-- this will make RC.0-RC.7 outputs.· Here's the compiler output:
·· 201· 0041· 0CFC······· MOV FSR,#TRIS_C··············· ;· TRIS_C = %00000000
······· 0042· 0024
·· 202· 0043· 0060······· CLR IND······················
·· 203· 0044· 005F······· MODE $0F·····················
·· 204· 0045· 0200······· MOV !RC,IND··
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax