ALWAYS 30JAN4 MOVE .MCALL DIR$,CALLR ;************************************************************************ ;* * ;* MODULE: MOVE - MOVE A BYTE/WORD * ;* * ;* AUTHOR: KEVIN ANGLEY * ;* * ;* DATE: 30-JUL-82 * ;* * ;* INPUT PARAMETERS: * ;* * ;* R0 POINTS TO COMMAND LINE IN PROCESS * ;* * ;* OUTPUT PARAMETERS: * ;* * ;* R0 POINTS JUST BEYOND COMMAND LINE * ;* * ;* DESTROYS: R1,R2,R3,R4,R5 * ;* * ;* REVISED BY: CHRIS DORAN, SIRA LTD. * ;* * ;* DATE: 3-JAN-84 * ;* * ;* MODIFICATIONS: * ;* Put BYTE and WORD keys, only used here, into this * ;* module, for overlaid code. * ;* Return cs on error. * ;* * ;************************************************************************ MOVE:: CLRB R5 ; ASSUME BYTE MOVE GETKEY BYTE ; GET BYTE KEYWORD BEQ 10$ ; EQ: GOT IT INCB R5 ; ASSUME WORD MOVE GETKEY WORD ; GET WORD KEYWORD BNE 245$ ; NE: MISSING KEYWORD 10$: GETKEY FROM ; GET FROM KEYWORD BNE 245$ ; NE: MISSING KEYWORD CMPB #'%,(R0) ; PSEUDO-REGISTER SOURCE? BNE 12$ ; NE: NO CLR R1 INC R0 CALL GETHX2 ; GET REGISTER NUMBER BCS 250$ ; CS: FAILED MOVB REGISTER(R1),R3 ; R3 CONTAINING LO BYTE TO TRANSFER TSTB R5 ; BYTE MOVE? BEQ 20$ ; EQ: YES INCB R1 ; INCREMENT PSEUDO-REG WITH WRAP MOVB REGISTER(R1),R4 ; R4 CONTAINS HIGH BYTE TO TRANSFER BR 20$ ; GO PUT INTO DESTINATION 12$: CALL GETHXL ; GET L DIGIT HEX ADDRESS BCS 250$ ; CS: FAILED MOV R1,R3 ; GET READY FOR CALL TO VALID MOV R2,R4 CALL VALID ; MUST VALIDATE + OFFSET BCS 250$ ; CS: INVALID MOVB MEMORY(R2),R3 ; R3 CONTAINS LO BYTE TO TRANSFER TSTB R5 ; BYTE MOVE? BEQ 20$ ; EQ: YES - DONE WITH SOURCE INC R2 PUSH R3 PUSH R4 CALL UNOFFST ; UN-OFFSET CALL VALID ; HIGH ADDRESS MUST ALSO BE VALID POP R4 POP R3 BCS 250$ ; CS: INVALID MOVB MEMORY(R2),R4 ; R4 CONTAINS HIGH BYTE TO TRANSFER 20$: GETKEY TO ; GET TO KEYWORD BNE 245$ ; MISSING KEYWORD CMPB #'%,(R0) ; PSEUDO-REGISTER DEST BNE 22$ ; NE: NO CLR R1 INC R0 CALL GETHX2 ; GET REGISTER NUMBER BCS 250$ ; CS: FAILED MOVB R3,REGISTER(R1) ; PUT IN LO BYTE TSTB R5 ; BYTE MOVE? BEQ 255$ ; EQ: ALL DONE INCB R1 ; INCREMENT PSEUDO-REG MOVB R4,REGISTER(R1) ; PUT IN HIGH BYTE WITH WRAP BR 255$ ; ALL DONE 22$: CALL GETHXL ; GET L DIGIT HEX ADDRESS BCS 250$ ; CS: FAILED PUSH R3 PUSH R4 MOV R1,R3 ; GET READY FOR CALL TO VALID MOV R2,R4 CALL VALID ; MUST VALIDATE AND OFFSET POP R4 POP R3 BCS 250$ ; CS: INVALID MOVB R3,MEMORY(R2) ; PUT IN LOW BYTE TSTB R5 ; BYTE MOVE? BEQ 255$ ; EQ: YES -ALL DONE INC R2 ; INCREMENT PUSH R3 PUSH R4 CALL UNOFFST ; UN-OFFSET CALL VALID ; HIGH ADDRESS MUST BE VALID ALSO POP R4 POP R3 BCS 250$ ; CS: INVALID MOVB R4,MEMORY(R2) ; PUT IN HIGH BYTE BR 255$ ; ALL DONE (CC FROM VALID) 245$: OUTPUT MSK ; MISSING KEYWORD 250$: SEC ; ERROR EXIT 255$: CALLR EXTRA ; IGNORE EXTRA + RETURN .PSECT PURE RO,D KEY BYTE KEY WORD .END