microldstop.cc (4804:4a707cb7065b) microldstop.cc (4842:e792fcf17ff9)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 50 unchanged lines hidden (view full) ---

59#include <string>
60
61namespace X86ISA
62{
63 std::string LdStOp::generateDisassembly(Addr pc,
64 const SymbolTable *symtab) const
65 {
66 std::stringstream response;
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 50 unchanged lines hidden (view full) ---

59#include <string>
60
61namespace X86ISA
62{
63 std::string LdStOp::generateDisassembly(Addr pc,
64 const SymbolTable *symtab) const
65 {
66 std::stringstream response;
67 bool someAddr = false;
67
68 printMnemonic(response, instMnem, mnemonic);
68
69 printMnemonic(response, instMnem, mnemonic);
69 printDestReg(response, 0, dataSize);
70 if(flags[IsLoad])
71 printDestReg(response, 0, dataSize);
72 else
73 printSrcReg(response, 2, dataSize);
70 response << ", ";
71 printSegment(response, segment);
74 response << ", ";
75 printSegment(response, segment);
72 ccprintf(response, ":[%d*", scale);
73 printSrcReg(response, 0, addressSize);
74 response << " + ";
75 printSrcReg(response, 1, addressSize);
76 ccprintf(response, " + %#x]", disp);
76 response << ":[";
77 if(scale != 0 && _srcRegIdx[0] != ZeroReg)
78 {
79 if(scale != 1)
80 ccprintf(response, "%d*", scale);
81 printSrcReg(response, 0, addressSize);
82 someAddr = true;
83 }
84 if(_srcRegIdx[1] != ZeroReg)
85 {
86 if(someAddr)
87 response << " + ";
88 printSrcReg(response, 1, addressSize);
89 someAddr = true;
90 }
91 if(disp != 0)
92 {
93 if(someAddr)
94 response << " + ";
95 ccprintf(response, "%#x", disp);
96 someAddr = true;
97 }
98 if(!someAddr)
99 response << "0";
100 response << "]";
77 return response.str();
78 }
79}
101 return response.str();
102 }
103}