mem.cc revision 6307:067515d22824
16019Shines@cs.fsu.edu/* Copyright (c) 2007-2008 The Florida State University
26019Shines@cs.fsu.edu * All rights reserved.
37404SAli.Saidi@ARM.com *
46019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without
56019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are
67404SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright
77404SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer;
87404SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright
97404SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the
107404SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution;
117404SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its
127404SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from
137404SAli.Saidi@ARM.com * this software without specific prior written permission.
147404SAli.Saidi@ARM.com *
156019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
166019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
176019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
186019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
196019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
206019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
216019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
226019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
236019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
246019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
256019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
266019Shines@cs.fsu.edu *
276019Shines@cs.fsu.edu * Authors: Stephen Hines
286019Shines@cs.fsu.edu */
296019Shines@cs.fsu.edu
306019Shines@cs.fsu.edu#include "arch/arm/insts/mem.hh"
316019Shines@cs.fsu.edu#include "base/loader/symtab.hh"
326019Shines@cs.fsu.edu
336019Shines@cs.fsu.edunamespace ArmISA
346019Shines@cs.fsu.edu{
356019Shines@cs.fsu.edustd::string
366019Shines@cs.fsu.eduMemory::generateDisassembly(Addr pc, const SymbolTable *symtab) const
376019Shines@cs.fsu.edu{
387404SAli.Saidi@ARM.com    std::stringstream ss;
396019Shines@cs.fsu.edu    printMnemonic(ss);
406019Shines@cs.fsu.edu    printReg(ss, machInst.rd);
416019Shines@cs.fsu.edu    ss << ", [";
427404SAli.Saidi@ARM.com    printReg(ss, machInst.rn);
438756Sgblack@eecs.umich.edu    ss << ", ";
447404SAli.Saidi@ARM.com    if (machInst.puswl.prepost == 1)
458756Sgblack@eecs.umich.edu        printOffset(ss);
468756Sgblack@eecs.umich.edu    ss << "]";
478756Sgblack@eecs.umich.edu    if (machInst.puswl.prepost == 0)
489338SAndreas.Sandberg@arm.com        printOffset(ss);
498839Sandreas.hansson@arm.com    else if (machInst.puswl.writeback)
508756Sgblack@eecs.umich.edu        ss << "!";
519258SAli.Saidi@ARM.com    return ss.str();
529258SAli.Saidi@ARM.com}
536019Shines@cs.fsu.edu}
546019Shines@cs.fsu.edu