Intel Spec. Processor Instructions 6 - Processor Instruction Set Reference

本文详细解析了Intel处理器指令集的组成元素,包括操作码、指令格式、内存操作数等关键概念,并介绍了如何查找特定指令及其执行周期。

Intel Spec. Processor Instructions 6 - Processor Instruction Set Reference

I. How to read the instruction set reference pages


- Opcode column

   /digital: It indicates that the ModRM byte of the instruction uses only the r/m(register or memory) operand. The reg field of the ModRM byte contains the digit(0...7) that provides an extension to the instruction's opcode

   /r: It indicates that the ModRM byte of the instruction contains both a register and an r/m operand

   cb,cw,cd,cp: is a 1-byte, 2-byte, 4-byte, or 6-byte, the value following the opcode that is used to specify a code offset and possibly a new value for the code segment register

   ib,iw,id: is a 1-byte, 2-byte, 4-byte, immediate operand to the instruction that follows the opcode, ModRM, and SIB bytes.

   +rb,+rw,+rd: is a register code from 0~7. rb[0,7] = {al,cl,dl,bl,ah,ch,dh,bh}, rw[0,7] = {ax,cx,dx,bx,sp,bp,si,di}, rd[0,7] = {eax,ecx,edx,ebx,esp,ebp,esi,edi}

- Instruction column

   r8: is one of the byte register, {al,cl,dl,bl,ah,ch,dh,bh}

   r16: is one of the word register, {ax,cx,dx,bx,sp,bp,si,di}

   r32: is one of the dword register, {eax,ecx,edx,ebx,esp,ebp,esi,edi}

   r/m8,r/m16,r/m32: is a 1-byte, 2-byte, 4-byte register or memory operand

   m8,m16,m32: is a 1-byte, 2-byte, 4-byte memory operand

   m: is a memory operand whose type is not checked by the assembler. BTS and other bit instructions for usage

   imm8,imm16,imm32: is a byte, word, dword immediate value

   rel8,rel16,rel32: is a byte, word, dword label

   ptr16:16,ptr16:32: is a FAR label

   m16:16,m16:32: is a memory operand containing a full pointer composed of two numbers like the ptr16:16 and ptr16:32

   m16&16,m16&32,m32&32: is a memory operand consisting of paired data items whose sizes are indicated on the left and the right side of ampersand. EX: lidt m16&32, lgdt m16&32

   moffs8,moffs16,moffs32: is a simple memory variable of type byte, word, dword used by the mov instruction

   Sreg: is a segment register, [0,5] = {ES,CS,SS,DS,FS,GS}

- *Clocks column

   Gives the number of clock cycles for each form of the instruction, the clock count calculations make the following assumptions:

   1. The instruction has been prefetched and decoded and is ready for execution

   2. Bus cycles do not require wait states

   3. There are no a numeric coprocessor data transfer or local bus hold requests delaying processor access to the bus

   4. No exceptions are detected during instruction execution

   5. Memory operands are aligned on 4-byte boundaries

- Description column

- Operation section

- Discussion section

- Flags affected section

- Exceptions by mode section

II. How to look up an instruction

III. Processor instructions

### ADB Shell Monkey 命令详解 #### 随机种子 (Seed) `adb shell monkey` 支持通过 `--seed` 参数设定随机数生成器的初始值。如果指定了相同的种子,则每次运行产生的事件序列会完全一致,便于重现特定场景下的问题[^1]。 #### 包名列表 (-p 或者 --pct) `-p` 参数用于限定测试的应用程序范围。可以通过 `-p` 指定单个或多个包名来约束 Monkey 的操作仅限于这些应用内部。如果不指定任何包名,默认情况下 Monkey 将在整个设备上执行随机事件[^2]。 示例代码如下: ```bash adb shell monkey -p com.example.app -p com.another.app 500 ``` 上述命令表示向两个指定的应用发送总计 500 条随机事件。 #### 事件百分比分配 (--pct-*) Monkey 提供了一系列参数用来调整不同种类用户交互的比例: - **Touch Events (`--pct-touch`)** 定义屏幕点击类事件所占比例。例如设置为 80%,意味着大部分时间模拟的是简单的点按行为[^4]。 - **Motion Events (`--pct-motion`)** 控制滑动或者拖拽动作发生的频率。适合评估界面流畅度时增加权重。 - **Application Switching (`--pct-appswitch`)** 设置切换至其他已安装软件的概率大小。这对于多任务环境中的稳定性检测尤为重要。 - **Any Event (`--pct-anyevent`)** 覆盖所有未被单独配置类型的剩余部分。当希望某些特殊类别保持较低发生率可适当提高此项数值。 以下是具体实现的一个例子: ```bash adb shell monkey \ --pct-touch 30 \ --pct-motion 20 \ --pct-appswitch 10 \ --pct-anyevent 5 \ -p your.package.name \ 1000 ``` 以上脚本设置了各类活动的大致分布情况并针对单一目标进行了压力测验。 #### 监控本地崩溃选项 为了捕获可能由自动化流程引发的问题,可以启用相应的标志位如 `--ignore-crashes`, `--ignore-timeouts`, 和 `--kill-process-after-error`. 这些开关允许即使遇到错误也能继续完成预定数量的动作而不中断整个过程[^3]. #### 忽略异常设置 除了前面提到过的忽略崩溃外还有几个额外的选择可以帮助过滤掉不必要的干扰因素: - `--monitor-native-crashes`: 记录原生层面上出现的重大失败状况. - `--wait-dbg`: 如果调试器附加则暂停直到分离为止. #### 日志保存路径 最后一点关于如何获取详细的报告信息非常重要。通常建议重定向标准输出到文件以便后续分析: ```bash adb shell monkey ... > /path/to/logfile.txt ``` 这样就可以轻松查看每一步骤的结果以及发现问题所在的位置了。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值