a couple of memory routines

new topic     » topic index » view thread      » older message » newer message

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


new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu