; mp5.h -- by Douglas W. Jones, Oct. 30, 2014 ; these macros were lifted from sparrowhawk.h, Oct. 30, 2014 revision. ; this version is identical to the macros that are automatically omitted ; when the user defines STRICTSPARROW prior to using sparrowhawk.h ; --------------------- ; macros for constant pool needed for relocatable LIL MACRO CONSTPOOL ALIGN 4 qCONSTPOOLq=. ENDMAC ; --------------------- ; support macros that are not to be called except by macros in this file MACRO qEACOMPq =x,=const IF LEN(const)>0 LIS R1,const >> 8 ORIS R1,const & #FF PLUS R1,x ELSE qPCRELq = x-(.+6) LIS R1,qPCRELq >> 8 ORIS R1,qPCRELq & #FF PLUS R1,R0 ENDIF ENDMAC ; --------------------- ; macros for long Hawk instructions MACRO LEA =dst,=x,=const qEACOMPq x,const MOVE dst,R1 ENDMAC MACRO LEACC =dst,=x,=const qEACOMPq x,const MOVECC dst,R1 ENDMAC MACRO LOAD =dst,=x,=const qEACOMPq x,const LOADS dst,R1 ENDMAC MACRO LOADCC =dst,=x,=const qEACOMPq x,const LOADSCC dst,R1 ENDMAC MACRO JSR =dst,=x,=const qEACOMPq x,const JSRS dst,R1 ENDMAC MACRO STORE =dst,=x,=const qEACOMPq x,const STORES dst,R1 ENDMAC MACRO LIL =dst,=const IF TYP(const)=0 IF (const > 32767) ! (const < -32768) LIS dst, (const >> 16) ORIS dst, (const >> 8) & #FF ORIS dst, (const ) & #FF ELSEIF (const > 127) ! (const < -128) LIS dst, (const > 8) ORIS dst, (const ) & #FF ELSE LIS dst, const ENDIF ELSE LOAD dst,qCONSTPOOLq qLCSAVEq=. .=qCONSTPOOLq W const qCONSTPOOLq=. .=qLCSAVEq ENDIF ENDMAC ; --------------------- ; macros for derived long hawk instructions MACRO TEST =x,=disp LOADCC R0,x,disp ENDMAC MACRO ADDI =dst,=src,=const LEACC dst,src,const ENDMAC MACRO CMPI =x,=disp LEACC R0,x,-disp ENDMAC MACRO JUMP =x,=disp IF LEN(disp)>0 JSR R0,x,disp ELSE JSR R0,x ENDIF ENDMAC MACRO LIW =dst, =const LIL dst, const >> 8 ORIS dst, const & #FF ENDMAC