a couple of memory routines
- Posted by Hayden McKay <hmck1 at dodo.com.au> Sep 07, 2004
- 506 views
This is just a couple of memory routines I want to share. I feel that they should be in the tk_misc/tk_maths library.
function getBCDval(atom addr) integer temp temp = (and_bits(peek(addr), #FF) * #100) + and_bits(peek(addr+2), #FF) return remainder(temp, #100) + (floor(temp / #100) /10) end function function farPtr(atom addr) return and_bits(peek4u(addr), #FFFF) + (and_bits(peek4u(addr+2), #FFFF) * 16) end function function peek2u(atom addr) return and_bits(peek4u(addr), #FFFF) end function