奇怪的“salc”(setalc,机器代码:D6h):masm32V9里怎么没有这个指令啊???

rularys 2006-12-22 02:15:35
奇怪,奇怪,那么这个指令的助记符号在这里应该用什么捏?我用的是masm32V9
...全文
273 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
大熊猫侯佩 2006-12-22
  • 打赏
  • 举报
回复
嗯~
rularys 2006-12-22
  • 打赏
  • 举报
回复
在一个有趣的16位程序里面,好像是在随机函数产生器里面用到这个指令,在IDA里它被翻译成
setalc
大熊猫侯佩 2006-12-22
  • 打赏
  • 举报
回复
我在intel手册上也么找到,如果真是undocument恐怕只有硬编码。
你在哪看到这个指令的?
rularys 2006-12-22
  • 打赏
  • 举报
回复
那么说,在代码里面我只能这样用它了:

.
.
.
db d6h
.
.
.

*_* @_#
大熊猫侯佩 2006-12-22
  • 打赏
  • 举报
回复
[zt]

SALC - D6 - Set AL on Carry
An undocumented op code that performs an operation common to every
Assembly language subroutine to C and many other higher level languages.
This instruction is a C programmers 'dream' instruction for interfacing
to assembly language.


Undocumented: Available to all Intel x86 processors
Useful in production source code.
SALC
Flags: SET Carry flag to AL
+-+-+-+-+-+-+-+-+-+ +----------+
|O|D|I|T|S|Z|A|P|C| | 11010110 |
+-+-+-+-+-+-+-+-+-+ +----------+
| | | | | | | | | | | D6 |
+-+-+-+-+-+-+-+-+-+ +----------+


The name SALC simply stands for SET the Carry flag in AL. This
instruction is categorized as an undocumented single-byte proprietary
instruction. Intel claims it can be emulated as a NOP. Hardly a NOP,
this instruction sets AL=FF if the Carry Flag is set (CF=1), or resets
AL=00 if the Carry Flag is clear (CF=0). It can best be emulated as SBB
AL,AL. SALC doesn't change any flags, where SBB AL,AL does. This
instruction is most useful to high-level language programmers whose
programs call assembly language, and expect AL to indicate success or
failure. Since it is convenient for assembly language programs to return
status in the CF, this instruction will convert that status to a form
compatible with high level languages.

Over the years, this instruction has been given many names by various
discoverers. I originally gave it the name SETCAL, but the most common
name I've seen in print is SETALC. The name given above, SALC is an
official Intel name. While perusing the P6 opcode map, I always check
for known, undocumented opcodes. After weeding through the map for many
minutes, my patience and perseverance paid off. I found the opcode, and
its name. Intel's name for this opcode is SALC. This would indicate that
Intel plans to officially document this instruction, beginning with the

21,458

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧