Page 1 of 1

i need help

Posted: Mon Feb 23, 2015 4:22 am
by mohandes

Code: Select all

equ   ping_len   16383      ;Max ping delay length (left) 
clr                                   ; Clear the ACC 
or    ping_len*256      ; Put delay length into ACC alligned to ACC[22:8] 



it's a part of ping pong code by frank .
what is it in the third line? and what did mean (ACC[22:8]) ?
is the symbol(*) meaning the multiply?

Posted: Mon Feb 23, 2015 10:08 am
by frank
Yes, * means multiply, it is to align the address in the accumulator. For more detail see the SpinAsm manual at http://spinsemi.com/Products/datasheets ... Manual.pdf

Posted: Wed Feb 25, 2015 1:32 am
by mohandes
first tank you frank
so , there's 0x3fff00 in acc, but why?
why the delay length multiply by 256?
i dont figure out the [22:8]. the result have 22 bits it's true.
but what about the 8?

Posted: Wed Feb 25, 2015 1:38 am
by mohandes
first tank you frank
so , there's 0x3fff00 in acc, but why?
why the delay length multiply by 256?
i dont figure out the [22:8]. the result have 22 bits it's true.
but what about the 8?

Posted: Wed Feb 25, 2015 9:52 am
by frank
For the RMPA later in the code the address needs to be in acc[22:8] to write to addr_ptr

Posted: Thu Feb 26, 2015 12:41 am
by mohandes
but frank
what does the [22:8] meaning?

Posted: Thu Feb 26, 2015 12:47 am
by mohandes
but frank
what does the [22:8] meaning?

Posted: Thu Feb 26, 2015 2:09 pm
by frank
No offense, but if you don't understand what the acc[22:8] means you need to pick up a basic book on microprocessor programming. It indicates the used bit range of a register/memory/value.