Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incrementing a 64-bit memory location in assembly

Status
Not open for further replies.

ekanth

Programmer
Jul 28, 2001
28
US
Hai all,
I need to maintain a value in memory which can overflow at a very fast rate. So I need it to be a 64-bit value. I will have to increment it for every timer interrupt(to put it simply, at a very fast rate say some 20 or 30 times a second) and the system will run continuoulsy for days together. This will cause a overflow if its a 32-bit value.
Since I need to do this in assembly, I want a way to increment the counter value in one shot, I mean in a single instruction. Do we have any instruction that could do this (increment a 64 bit value in memory)?
If we could not get it with a single instruction, what else can be done? One possibility is to increment the lower order 32-bit value and when it overflows increment the higher order value. Any other possibility? Please help.

Thanks and Regards,
Ekanth Sethuramalingam [thumbsup2] Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
add lowdword,1
adc hidword,0
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Thanks AmkG for the info. But this is the option I have mentioned. Is there a way to do in single shot, an instruction that could do this?
Thanks and Regards
Ekanth Sethuramalingam [thumbsup2] Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
No. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top