AVE5: ; SUM(DATA_BUF) = A*5 + B MOV R0, #DATA_BUF MOV R2, #5 CLR A MOV R3, A AVE5LP: ADD A, @R0 INC R0 JNC AVE5L1 INC A XCH A, R3 ADD A, #51 XCH A, R3 AVE5L1: DJNZ R2, AVE5LP MOV B, #5 DIV AB ADD A, R3 RET
AVE5: ; SUM(DATA_BUF) = A*5 + B MOV R0, #DATA_BUF MOV R2, #5 CLR A MOV R3, A AVE5LP: ADD A, @R0 INC R0 DA A JNC AVE5L1 INC R3 AVE5L1: DJNZ R2, AVE5LP ADD A, ACC DA A XCH A, R3 RLC A SWAP A XCH A, R3 MOV B, A ANL A, #1110B RR A XCH A, B SWAP A ANL A, #0FH ORL A, R3 RET