Blame | Last modification | View Log | Download | RSS feed
ifndef __st6instrinc__st6instrinc equ 1;****************************************************************************;* *;* AS 1.42 - File INSTR.INC *;* *;* contains macros for some commonly missing instructions on ST6 *;* *;****************************************************************************; Add/Subtract with Carry: first operand must be A (accumulator)adc macro dst,srcjrnc NoCarryinc dstNoCarry: add dst,src ; Rest normal addierenendmsbc macro dst,srcjrnc NoCarrydec dstNoCarry: sub dst,srcendm; OR operator:; uses De Morgan's rule: A OR B = /((/A) AND (/B)); uses W register; dst must be A (accumulator)or macro dst,srccom dstld w,dstld dst,srccom dstand dst,wcom dstendm; XOR Operator:; uses the principle of four NAND gates, i.e. does not have to use the OR macro; uses V and W register; dst must be A (accumulator)xor macro dst,srcld v,dst ; Op1 rettenand dst,src ; Hilfsergebnis A NAND B bildencom dstld w,dst ; in W rettenld dst,v ; Op1 nochmal holenand dst,w ; 1. Teilergebnis A NAND W bildencom dstld v,dst ; in V rettenld dst,src ; 2. Teilergebnis B NAND W bildenand dst,wcom dstand dst,vcom dstendifendm; rotate right with carry; fairly brute force, I did not have any better idea...; dst must be A (accumulator)rrc macro dstrept 7rlc dstendmendm;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; For those missing the ROMWIN statement:romwin macro adrassume rombase:adr>>6endmendif ; __st6instrinc