Shop OBEX P1 Docs P2 Docs Learn Events
debug(udec_reg_array(#CogVar01,10)) Syntax question — Parallax Forums

debug(udec_reg_array(#CogVar01,10)) Syntax question

Why do I get 4 more registers than what is asked for in the following Code. I should get 10 but 14 values are returnded the first 10 are what I expected. Thanks in advance.
Regards
Bob (WRD)

CON
  _clkfreq = 200_000_000

VAR
  long  adrHubVar01[10]
  long  adrCogVar01[10]

PUB main()|x
    regload(@CogCodePrm)
    call(@strtCogCode1)
    getregs(@adrCogVar01,#CogVar01,10)
    repeat x from 0 to 9
        adrHubVar01[x] := adrCogVar01[x]+1     'add 1 to make data different than sent
    setregs(@adrHubVar01,#CogVar02,10)
    waitms(2000)
    call(@strtCogCode2)
    debug(udec_long_array(@adrHubVar01,10))
    debug(udec_long_array(@adrCogVar01,10))
    debug(udec_long_array(@CogVar01,10))
    debug(udec_long_array(@CogVar02,10))
    repeat
DAT
                ORGH
CogCodePrm      word   strtCogCode1,endCogCode-strtCogCode1-1
                  ORG 0
strtCogCode1      nop
                  debug(udec_reg_array(#CogVar01,10))
                  ret
strtCogCode2      nop
                  debug(udec_reg_array(#CogVar02,10))
                  ret
CogVar01        long  10,11,12,13,14,151,16,17,18,19
CogVar02        long  "A"[10]
endCogCode

Comments

Sign In or Register to comment.