/****************************************************************************
*
* Realmode X86 Emulator Library
*
* Copyright (C) 1996-1999 SciTech Software, Inc.
* Copyright (C) David Mosberger-Tang
* Copyright (C) 1999 Egbert Eich
*
* ========================================================================
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of the authors not be used
* in advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. The authors makes no
* representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
* ========================================================================
*
* Language: ANSI C
* Environment: Any
* Developer: Kendall Bennett
*
* Description: This file includes subroutines to implement the decoding
* and emulation of all the x86 processor instructions.
*
* There are approximately 250 subroutines in here, which correspond
* to the 256 byte-"opcodes" found on the 8086. The table which
* dispatches this is found in the files optab.[ch].
*
* Each opcode proc has a comment preceeding it which gives it's table
* address. Several opcodes are missing (undefined) in the table.
*
* Each proc includes information for decoding (DECODE_PRINTF and
* DECODE_PRINTF2), debugging (TRACE_REGS, SINGLE_STEP), and misc
* functions (START_OF_INSTR, END_OF_INSTR).
*
* Many of the procedures are *VERY* similar in coding. This has
* allowed for a very large amount of code to be generated in a fairly
* short amount of time (i.e. cut, paste, and modify). The result is
* that much of the code below could have been folded into subroutines
* for a large reduction in size of this file. The downside would be
* that there would be a penalty in execution speed. The file could
* also have been *MUCH* larger by inlining certain functions which
* were called. This could have resulted even faster execution. The
* prime directive I used to decide whether to inline the code or to
* modularize it, was basically: 1) no unnecessary subroutine calls,
* 2) no routines more than about 200 lines in size, and 3) modularize
* any code that I might not get right the first time. The fetch_*
* subroutines fall into the latter category. The The decode_* fall
* into the second category. The coding of the "switch(mod){ .... }"
* in many of the subroutines below falls into the first category.
* Especially, the coding of {add,and,or,sub,...}_{byte,word}
* subroutines are an especially glaring case of the third guideline.
* Since so much of the code is cloned from other modules (compare
* opcode #00 to opcode #01), making the basic operations subroutine
* calls is especially important; otherwise mistakes in coding an
* "add" would represent a nightmare in maintenance.
*
****************************************************************************/
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
/****************************************************************************
PARAMETERS:
op1 - Instruction op code
REMARKS:
Handles illegal opcodes.
****************************************************************************/
void x86emuOp_illegal_op(
u8 op1)
{
START_OF_INSTR();
DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
TRACE_REGS();
printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
M.x86.R_CS, M.x86.R_IP-1,op1);
HALT_SYS();
END_OF_INSTR();
}
/****************************************************************************
REMARKS:
Handles opcode 0x00
****************************************************************************/
void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
uint destoffset;
u8 *destreg, *srcreg;
u8 destval;
START_OF_INSTR();
DECODE_PRINTF("ADD\t");
FETCH_DECODE_MODRM(mod, rh, rl);
switch (mod) {
case 0:
destoffset = decode_rm00_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_byte(destoffset);
srcreg = DECODE_RM_BYTE_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_byte(destval, *srcreg);
store_data_byte(destoffset, destval);
break;
case 1:
destoffset = decode_rm01_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_byte(destoffset);
srcreg = DECODE_RM_BYTE_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_byte(destval, *srcreg);
store_data_byte(destoffset, destval);
break;
case 2:
destoffset = decode_rm10_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_byte(destoffset);
srcreg = DECODE_RM_BYTE_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_byte(destval, *srcreg);
store_data_byte(destoffset, destval);
break;
case 3: /* register to register */
destreg = DECODE_RM_BYTE_REGISTER(rl);
DECODE_PRINTF(",");
srcreg = DECODE_RM_BYTE_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
*destreg = add_byte(*destreg, *srcreg);
break;
}
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
}
/****************************************************************************
REMARKS:
Handles opcode 0x01
****************************************************************************/
void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
{
int mod, rl, rh;
uint destoffset;
START_OF_INSTR();
DECODE_PRINTF("ADD\t");
FETCH_DECODE_MODRM(mod, rh, rl);
switch (mod) {
case 0:
if (M.x86.mode & SYSMODE_PREFIX_DATA) {
u32 destval;
u32 *srcreg;
destoffset = decode_rm00_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_long(destoffset);
srcreg = DECODE_RM_LONG_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_long(destval, *srcreg);
store_data_long(destoffset, destval);
} else {
u16 destval;
u16 *srcreg;
destoffset = decode_rm00_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_word(destoffset);
srcreg = DECODE_RM_WORD_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_word(destval, *srcreg);
store_data_word(destoffset, destval);
}
break;
case 1:
if (M.x86.mode & SYSMODE_PREFIX_DATA) {
u32 destval;
u32 *srcreg;
destoffset = decode_rm01_address(rl);
DECODE_PRINTF(",");
destval = fetch_data_long(destoffset);
srcreg = DECODE_RM_LONG_REGISTER(rh);
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = add_long(destval, *srcreg);
store_data_long(destoffset, destval);
} else {
u16 destval;
u16 *srcreg;
destoffset = decode_rm01_address(rl);
D
没有合适的资源?快使用搜索试试~ 我知道了~
AT91RM9200-U-Boot.rar_AT91RM9200-U-Boot_at91rm9200
共2000个文件
c:823个
h:578个
repository:240个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 136 浏览量
2022-09-21
05:55:03
上传
评论
收藏 5.57MB RAR 举报
温馨提示
AT91RM9200-U-Boot 傅里叶开发板移植通过
资源推荐
资源详情
资源评论
收起资源包目录
AT91RM9200-U-Boot.rar_AT91RM9200-U-Boot_at91rm9200 (2000个子文件)
README.amigaone 525B
_pmdos.asm 36KB
_pmsmx.asm 32KB
_vflat.asm 23KB
_vflat.asm 23KB
_cpuinfo.asm 20KB
_pm.asm 19KB
_lztimer.asm 15KB
_pm.asm 13KB
_pcihelp.asm 10KB
_irq.asm 10KB
_int64.asm 9KB
_pm.asm 9KB
_gatimer.asm 9KB
_pm.asm 8KB
_mtrr.asm 8KB
_joy.asm 8KB
_dma.asm 8KB
_mtrrqnx.asm 7KB
_event.asm 7KB
_pm_imp.asm 7KB
_pmos2.asm 6KB
_event.asm 6KB
_ga_imp.asm 6KB
_pmwin32.asm 3KB
_aa_imp.asm 3KB
_lztimer.asm 2KB
README.autoboot 6KB
x2c.awk 151B
build_it.bat 7KB
set-vars.bat 4KB
bcb5-tnt.bat 2KB
bc50-tnt.bat 2KB
bc45-tnt.bat 2KB
wc10atnt.bat 2KB
wc11-tnt.bat 2KB
wc10-tnt.bat 2KB
vc60-tnt.bat 2KB
vc50-tnt.bat 1KB
makelib.bat 1KB
vc40-tnt.bat 1KB
bcb5-w32.bat 1KB
bcb5-c32.bat 1KB
bc50-w32.bat 1KB
bc50-c32.bat 1KB
w2kddk.bat 1KB
wc11-c32.bat 1KB
wc11-w32.bat 1KB
vc50-w32.bat 1KB
vc50-c32.bat 1KB
vc60-c32.bat 1KB
vc60-w32.bat 1KB
ntddk.bat 1KB
bc45-w32.bat 1KB
bc45-c32.bat 1KB
vc40-w32.bat 979B
vc40-c32.bat 977B
bcb5-smx.bat 967B
bcb5-d32.bat 967B
bcb5-w16.bat 959B
bcb5-vxd.bat 957B
bcb5-x11.bat 956B
bcb5-d16.bat 945B
bc50-d32.bat 942B
bc50-smx.bat 942B
bc50-w16.bat 934B
bc50-vxd.bat 932B
bc50-x11.bat 931B
wc10ac32.bat 924B
wc10-c32.bat 923B
bcb5-snp.bat 922B
wc11-d32.bat 922B
wc10-d32.bat 922B
wc11-x11.bat 921B
wc10aw32.bat 921B
wc10-w32.bat 920B
bc50-d16.bat 920B
wc11-qnx.bat 912B
wc10-qnx.bat 912B
bc45-d32.bat 910B
wc10ad32.bat 907B
bc45-w16.bat 901B
bc50-snp.bat 898B
wc11-snp.bat 895B
wc10-snp.bat 894B
bc45-vxd.bat 894B
bc45-d16.bat 887B
vc50-rtt.bat 883B
wc10asnp.bat 880B
bc45-snp.bat 866B
vc60-snp.bat 857B
vc50-snp.bat 857B
wc10ao32.bat 830B
wc10-w16.bat 826B
wc10-o32.bat 826B
wc11-o32.bat 826B
wc11-w16.bat 825B
wc10aw16.bat 824B
wc10-p32.bat 823B
wc11-p32.bat 823B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
朱moyimi
- 粉丝: 61
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 解决未在远程桌面会话中捕获到鼠标,vmguest.iso软件分享给大家
- JSP+SQL基于WEB的开放性实验管理系统设计与实现(源代码+论文+开题报告+中英文献+答辩PPT).rar
- log4net配置文件!!!!!!!!!!!!!!!!!
- 河南统计面板数据集(2010-2022年).xlsx
- OrcaleDBHelper帮助类!!!!!!!!!!!!
- log4net帮助类,用来写日志!!!!!!!!!!!!!
- Windows10时间同步源
- 信呼OA系统2.1.7版源码
- 3122080306 邹子轩 实验报告二.docx
- 基于STM32 NUCLEO板设计彩色LED照明灯(纯cubeMX开发)(大赛作品,文档完整,可直接运行)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功