English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In assembler, is it possible to switch two fieds in three statements without using a temp field or any other storage.

2006-09-28 15:23:32 · 2 answers · asked by robyn 4 in Computers & Internet Programming & Design

2 answers

r1 = r1 xor r2
r2 = r1 xor r2
r1 = r1 xor r2

2006-09-28 15:33:04 · answer #1 · answered by muon 3 · 1 0

Im not sure what you mean, or what assembly language, but in Intel 8 bit assembly there is a command called XCH which will exchange a byte with whats in the accumulator.
example:
Accumulator = 50
mybyte = 100

XCH A,mybyte

now the accumulator holds 100 and mybyte holds 50

2006-09-29 10:00:10 · answer #2 · answered by justme 7 · 0 0

fedest.com, questions and answers