Re: a couple of memory routines
- Posted by Hayden McKay <hmck1 at dodo.com.au> Sep 09, 2004
- 459 views
Oop's! A friend of mine pointed out an mistake in getBCDval() This one works correctly. function getBCDval(atom addr) integer temp temp = (and_bits(peek(addr), #FF) * #100) + and_bits(peek(addr+1), #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