1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
9 int main(int argc, char** argv) {
14 // Branching tests first so the offsets are not always adjusting in the
15 // output diassembler when we add new tests.
20 cb.call(Operand(EAX));
21 cb.call(Operand(EDX, 15));
23 cb.fs(); cb.mov(EAX, Operand(3));
24 cb.fs(); cb.mov(EDX, Operand(0x04));
26 cb.lea(EAX, Operand(EAX));
27 cb.lea(EAX, Operand(0x12345678));
28 cb.lea(EAX, Operand(EBX, 0x12345678));
29 cb.lea(EAX, Operand(EBX, ECX, SCALE_TIMES_2, 0x12345678));
30 cb.lea(EAX, Operand(ECX, SCALE_TIMES_2, 0x12345678));
31 cb.lea(EAX, Operand(EAX, SCALE_TIMES_2, 0));
32 cb.lea(EAX, Operand(EBX, SCALE_TIMES_2, 0));
33 cb.lea(EBP, Operand(EBP, SCALE_TIMES_2, 1));
40 cb.mov(EAX, Operand(ESP, 0x20));
41 cb.mov(EAX, Operand(EBP, 8));
43 cb.mov_imm(EAX, 0x12345678);
47 cb.pop(Operand(EBX, 0));
48 cb.pop(Operand(EBX, 12));
51 cb.push(Operand(EBX));
52 cb.push(Operand(EBX, 0));
53 cb.push(Operand(EDI, -4));
54 cb.push(Operand(EDI, -8));
57 cb.push(Operand(EBX, 12));
58 cb.push(Operand(ESP, 0x1234));
76 cb.xchg(ECX, Operand(ESP));
77 cb.xchg(ECX, Operand(ESP, 5));
78 cb.xchg(ECX, Operand(EDX, 4));
80 fwrite(buf, 1, cb.size(), stdout);