SX/B RAM to RAM move
John Couture
Posts: 370
I think I'm just getting tired.· What I want to do is call a function that will copy 8 bytes from one ram variable to another.· Something like:
'
' variable declarations
DSTemp···· var byte(8)
DSDir····· var byte(8)
DSSpeed··· var byte(8)
SerialNum· var byte(8)
.
.
'
'subroutine call in main program
··· ' program figures out the serial number and stores
··· ' it in SerialNum array
··· copySerialNumber DSTemp·
'
' subroutine definition
copySerialNumber:
···· temp1 = __Param1
···· for temp2 = 0 to 7
········· temp1(temp2) = SerialNum(temp2)
·····next
···· return··
P.S. YEA!· I FINALLY figured out the 1Wire protocol and have got the AAG weather station talking to the SX18.· The above is so that I can optimize the code and be able to fit all four routines (search,temp,speed,dir) into one program (however I'll probably have to use an SX48/52 for the additional memory.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
'
' variable declarations
DSTemp···· var byte(8)
DSDir····· var byte(8)
DSSpeed··· var byte(8)
SerialNum· var byte(8)
.
.
'
'subroutine call in main program
··· ' program figures out the serial number and stores
··· ' it in SerialNum array
··· copySerialNumber DSTemp·
'
' subroutine definition
copySerialNumber:
···· temp1 = __Param1
···· for temp2 = 0 to 7
········· temp1(temp2) = SerialNum(temp2)
·····next
···· return··
P.S. YEA!· I FINALLY figured out the 1Wire protocol and have got the AAG weather station talking to the SX18.· The above is so that I can optimize the code and be able to fit all four routines (search,temp,speed,dir) into one program (however I'll probably have to use an SX48/52 for the additional memory.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Comments
· Try this:
When you pass an array name to a subroutine you are actually passing it's ADDRESS in the virtual __RAM array.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
When you get finished with this I hope you will post in the 'projects' section. Converting the Nuts & Volts article: 'Weather on a Wire' to the SX48/52·has been on my TODO list for a while!
Mike
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"OEM NMEA GPS Module" Now available on ebay for only $17.49
Product web site: http://www.allsurplus.net/Axiom/
Yes, I do plan on posting it as soon as I clean it up and insert some meaningful comments.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College