#macro RotPos0(variable,inc,dec)
ifvar(variable,EQU,2) inc else dec
setvar(variable,0)
#endmac
#macro RotPos1(variable,inc,dec)
ifvar(variable,EQU,0) inc else dec
setvar(variable,1)
#endmac
#macro RotPos2(variable,inc,dec)
ifvar(variable,EQU,1) inc else dec
setvar(variable,2)
#endmac
#macro stripBCD(variable)
push(variable);
popv16(temp1); //toss fracts
popv16(temp2); //int value to left of DP
popv16(temp1); //toss TThs
#endmac
// divide
// ------
// This divides a 16-bit value by a constant,
// keeping both quotient and remainder. The
// quotient replaces the dividend.
// *******************************************
#macro divide(wordv,remdr,const)
pushv16(wordv)
pushc(const)
exec(91)
popv16(wordv)
popv16(remdr)
#endmac
#macro mult(wordv, hi8, div)
pushv8(hi8)
pushc(div)
exec(90) // mult by DIV
popv16(wordv)
#endmac
#macro makedec16(wordv, hi8,
lo8)
pushv8(hi8)
pushc(100)
exec(90) // mult by 100
pushv8(lo8)
exec(74) // add two together
popv16(wordv)
#endmac
#macro makedec8(bytev, hi4,
lo4)
pushv8(hi4)
pushc(10)
exec(90) // mult by 10
pushv8(lo4)
exec(74) // add two together
popv8(bytev)
#endmac
#macro getPH8(bytev, phnum)
pushc(phnum)
exec(67)
popv8(bytev)
#endmac
#macro getPH16(wordv, phnum)
pushc(phnum)
exec(68)
popv16(wordv)
#endmac
#macro wordcmp(bytev,word1,const)
pushv16(word1)
pushc(const)
exec(76) // Compare, result 0=1<2, 1=equal, 2=1>2
popv8(bytev)
#endmac