;********************************************************************** ; Subroutines to do logic functions ;********************************************************************** andfn: and op2hi, op1hi ;op2 = op2 AND op1 and op2lo, op1lo ret ;return orfn: or op2hi, op1hi ;op2 = op2 OR op1 or op2lo, op1lo ret ;return xorfn: ;use the equation: op1 xor op2 = (op1)(op2')+(op1')(op2) ;perform equation on high part of numbers mov temp, op2hi com temp and temp, op1hi mov temp0, op1hi com temp0 and temp0,op2hi or temp, temp0 mov op2hi, temp ;store result in op2hi ;perform equation on low part of numbers mov temp, op2lo com temp and temp, op1lo mov temp0, op1lo com temp0 and temp0,op2lo or temp, temp0 mov op2lo, temp ;store result in op2lo ret ;return from function not: com op1hi ;op2 = 1's compliment of op1 mov op2hi, op1hi com op1lo mov op2lo, op1lo ret ;return