?? branch.cpp
字號:
/*************************************************************************
Copyright (C) 2002,2003,2004,2005 Wei Qin
See file COPYING for more information.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*************************************************************************/
#include <cstdio>
#include <armemul.h>
#include "branch.h"
using namespace emulator;
void impl_branch(IMPL_FORMALS)
{
SInt32 offset;
offset = (SInt32)(inst<<8)>>6;
WRITE_REG(PC_REAL_IND, PC + offset);
EMULATOR_STUB(branch,inst);
}
void impl_branch_link(IMPL_FORMALS)
{
SInt32 offset;
offset = (SInt32)(inst<<8)>>6;
WRITE_REG(LRIND, PC - 4);
WRITE_REG(PC_REAL_IND, PC + offset);
EMULATOR_STUB(branch_link,inst);
}
char *disasm_branch(arm_inst_t inst, arm_addr_t pc, char *buf)
{
SInt32 offset = (SInt32)(inst<<8)>>6;
buf += sprintf(buf, "b%s 0x%x;\n",
arm_conditional[COND], pc+8+offset);
return buf;
}
char *disasm_branch_link(arm_inst_t inst, arm_addr_t pc, char *buf)
{
SInt32 offset = (SInt32)(inst<<8)>>6;
buf += sprintf(buf, "bl%s 0x%x;\n",
arm_conditional[COND], pc+8+offset);
return buf;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -