spin and assembly mix
i am trying to figure out how to read a variable declaired by spin in hub ram modify it on the cog then write back to hub ram.
startDate is an assembly constant. ulDate is not recognized though in assembly so what can I use?
VAR
long ulDate,ulTime
PUB start
cognew(@TimeKeeper,0)
DAT
org 0
'initialize
TimeKeeper wrlong startDate,ulDate
startDate is an assembly constant. ulDate is not recognized though in assembly so what can I use?

Comments
wrlong <destination_address_in_HUB>,<source_address_in_COG>
The point here is that ulDate may be in stack or somewhere else. You have to give a pointer to it to the assembler program. Then it is much better to just define it in a DAT section:
Something like that
The access to variables in DAT section should be done with the long[noparse]/noparse, word[noparse]/noparse and byte[noparse]/noparse ways. The variables defined in VAR sections can be used directly. If I'm not mistaken. The Propeller manual is a very good source of information on the topic.
Btw, wrlong is actually wrlong <cog address>, <hub address> (the reverse of what Ale wrote). It's a little confusing because it violates the expected "destination, source" order. Just remember that all the hub memory ops (rdbyte, wrbyte, rdword, etc.) expect <cog address>, <hub address>.
And, sorry to correct Ale again, but you can access variables in dat sections just as you would an ordinary variable.
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 sound_port = 10 Dat ulTime long 3_500_000 ''ulTime <-- msec Var long stack[noparse][[/noparse]100] long ulTemp byte ubHour byte ubMin OBJ oT : "talk" PUB start cognew(@TimeKeeper,0) cognew(sayNow,@stack) PUB sayNow dira[noparse][[/noparse]16]~ oT.start(sound_port) oT.set_speaker(0, 90) oT.set_speaker(1, 110) oT.set_speaker(2, 100) repeat sayTime waitpeq(|<16,|<16,0) sayTime waitpeq(0,|<16,0) pub sayTime ubHour:=ulTime/3_600_000 ulTemp:=ulTime//3_600_000 ubMin:=ulTemp/60_000 ubHour:=ubHour//12 if ubHour==0 ubHour:=12 'ubHour:=1 'ubMin:=46 oT.say(sayNumber(ubHour)) if ubMin<10 if ubMin>0 oT.say(string("oa")) sayNumber(ubMin) PUB sayNumber(uiNum) case uiNum 0 : oT.say(string("oa~klok")) 1 : oT.say(string("wun~")) 2 : oT.say(string("too")) 3 : oT.say(string("three")) 4 : oT.say(string("for")) 5 : oT.say(string("faev")) 6 : oT.say(string("siks")) 7 : oT.say(string("s'even~")) 8 : oT.say(string("ayt")) 9 : oT.say(string("naen~")) 10: oT.say(string("ten~")) 11: oT.say(string("el'even~")) 12: oT.say(string("twelv~")) 13: oT.say(string("th'irteen~")) 14: oT.say(string("f'orteen~")) 15: oT.say(string("f'ifteen~")) 16: oT.say(string("s'iksteen~")) 17: oT.say(string("s'eventeen~")) 18: oT.say(string("'aytteen~")) 19: oT.say(string("n'aenteen~")) 20: oT.say(string("tw'entee")) 30: oT.say(string("th'irtee")) 40: oT.say(string("f'ortee")) 50: oT.say(string("f'iftee")) other: sayNumber((uiNum/10)*10) sayNumber(uiNum/10) DAT org 0 'run every ms TimeKeeper rdlong ulMSec,ulTime 'Copy sec over add ulMSec,#1 'Add 1 to MSec cmp ulMSec,ulDayLength 'See if day done if_b jmp :updateTime 'If day is done jump to end of routine 'run every day mov ulMSec,#0 'Set Time to midnight :updateTime wrlong ulMSec,ulTime 'Update the time waitcnt cnt, ticTime 'Delay for 1ms jmp #TimeKeeper 'Locale Time Value ulMSec long 0 'constants ulDayLength long 86_400_000 ticTime long 80_000 fit 496:updateTime wrlong ulMSec, ptrToUlTime 'Update the time *** CHANGED *** waitcnt cnt, ticTime 'Delay for 1ms jmp #TimeKeeper ptrToulMSec long 0 ' *** NEW ***If they help, I'll explain what's happening. If they don't, let us never speak of this post again.
changed ptrToulMSec on last line to ptrToUlTime still does not work. Canged read instruction to use this still no luck.
Read seems not to be working. [noparse]:([/noparse]