
180
ADVANCED INSTRUCTIONS
Example 12.3
Purpose: Application of XCH instruction.
Problem
Write a program to interchange data between data memory locations 30H and 31H.
Solution
is may be performed in various ways, and one of them may be as follows. e original content of the ac-
cumulator remains unchanged.
START; XCH A, 30H ; accumulator gets data from 30H
XCH A, 31H ; data at 30H goes to 31H, 31H data in A
XCH A, 30H ; 31H data placed in 30H, original data in A
RET ; register A unchanged, 30H and 31H exchanged
SUMMARY
Instructions such as MOVC, MOVX, XCH, MUL, DIV and
DA A were discussed in this chapter. These are very
powerful ...