.TITLE IBMI4 ;++ ; ----------------------------------------------------------------------------- ; PP&L KWH System <> Standard Library Routine ; ------------------------------------------- ; ; Perform conversion from Digital INTEGER*4 internal format to IBM four-byte ; integer internal format ; ; Written by Gary Peressini ; ----------------------------------------------------------------------------- ;-- .PSECT $CODE,PIC,CON,REL,LCL,SHR,EXE,RD,NOWRT,LONG .ENTRY IBMI4,^M CMPB #2,(AP) ; must pass 2 arguments BEQL OKI ; OK CLRL R0 ; error RET ; return OKI: MOVL @4(AP),R0 ; loop count BEQL DONEI ; no integers to convert, so return MOVL 8(AP),R1 ; address of integers LOOPI: MOVL (R1)+,R2 ; put input integer in R2 and point R1 to next PUSHL R2 ; put on stack MOVB (SP)+,-(R1) ; put back in memory and point to next integer MOVB (SP)+,-(R1) ; swaping the bytes in the process MOVB (SP)+,-(R1) ; MOVB (SP)+,-(R1) ; TSTL (R1)+ ; put r1 back right SOBGTR R0,LOOPI ; repeat process DONEI: MOVL #1,R0 ; indicate success RET ; return .END