anyone know how to give a straight replacement of SFR2 / POSTINC2 in FW and PIC24?
From an application note talking about Wn ++
In FW is direct access to Wn?
Can anyone give me an example?
Many thanks to the "samaritan".
I tried to give me an answer but I'm dubious about the SAVE RESTORE mechanism.
The literal translation from SF:
- Code: Select all
Save(FSR2)
FSR2 = pBufAddr
While len > 0
SPI.WriteByte(POSTINC2)
Dec(LEN)
End While
Restore()
.. in FW is this ?
- Code: Select all
Addr0 = AddressOf(pBufAddr)
While len > 0
SPI.WriteByte(*(Addr0+))
len -= 1
End While
.. and always in FW accordingly as above:
- Code: Select all
Addr0 = AddressOf(pDest)
While len<>0
len -= 1
*(Addr0+) = CByte(value)
End While