Re: a couple of memory routines

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

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu