I use the TCP/IP stack that David ported over for the ENC28J60. It makes extensive use of structures and unions.
I've noticed in the NETUtils.bas module, there is a routine called memset which appears to set a variable with a value.
When am I supposed to use memset as opposed to just setting the variable with the normal X=Y type statement?
There seems to be a difference. I was tweaking some code in the DHCP module and using X=Y to set the remote IP address didn't work. However, using memset did work.
Here is the code for memset in case you are curious:
Code: Select all
Public Sub memset(pAddress As Word, pValue As Byte, pSize As Word)
FSR0 = pAddress
While pSize > 0
POSTINC0 = pValue
Dec(pSize)
Wend
End Sub