MACRO &N SWAPREG &R1,&R2 * ******************************************************************* * * * * S W A P R E G * * * * Swaps the contents of two registers. * * * LCLC ®1,®2,®3,&LAB AIF (K'&N EQ 0).LABEND &LAB SETC '&N' &LAB DS 0H .LABEND ANOP AIF (K'&R1 NE 0).REG1OK MNOTE 8,'***** No registers specified ***********************' AGO .END .REG1OK ANOP AIF ('&R1'(1,1) NE 'R').NUMB ®1 SETC '&R1'(2,2) AGO .COMP .NUMB ANOP ®1 SETC '&R1' .COMP ANOP AIF ('®1' GT '15').E1 ®1 SETC '&R1' AIF (K'&R2 NE 0).REG2OK MNOTE 8,'***** No second register specified *****************' AGO .END .REG2OK ANOP AIF ('&R2'(1,1) NE 'R').NUMB2 ®2 SETC '&R2'(2,2) AGO .COMP2 .NUMB2 ANOP ®2 SETC '&R2' .COMP2 ANOP AIF ('®2' GT '15').E1 ®2 SETC '&R2' AIF ('®1' EQ '®2').E2 .CONT ANOP ®3 SETC '®1 * Exchange registers ®1 and ®2' CR ®1,®2 * See if registers are the smae * BE *+10 * Skip if they are * XR ®1,®2 * * XR ®2,®3 * Swap them * XR ®1,®2 * * * * * Copyright - Abbydale Systems LLC. * * ******************************************************************* * MEXIT .E2 MNOTE 8,'Duplicate register specification' AGO .END .E1 MNOTE 8,'Improper register specified, No statements generated' .END ANOP MEND