什么是奔腾指令,它和asm指令有什么区别,可以给一个实用的例子吗?

pz1 2001-07-11 01:44:59
...全文
152 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
pz1 2001-07-14
  • 打赏
  • 举报
回复
我不是不给分,我要的是用纯汇编的程序,我一定给分
Kelvin9230 2001-07-13
  • 打赏
  • 举报
回复
/*Just a simple example for MMX instruction in Pentium MMX*/

#include <stdio.h>
void main(void)
{
__int64 src1 = 0xffffffffffffffff;
__int64 src2 = 0x1111111111111111;
__int64 dst = 0;

printf("Before excuting MMX instruction \"psubsw\"\n");
printf("src1 = %016I64x\n", src1);
printf("src2 = %016I64x\n", src2);
printf("dst = %016I64x\n", dst);
__asm emms
__asm
{
movq mm0, src1
movq mm1, src2
psubsw mm0, mm1
movq dst, mm0
emms
}
printf("After excuting MMX instruction \"psubsw\"\n");
printf("src1 = %016I64x\n", src1);
printf("src2 = %016I64x\n", src2);
printf("dst = %016I64x\n", dst);
}

/*Use Micosoft VC 6.0 or above to compile and link this case. Run it either on Pentium MMX PC or on None MMX PC. If your CPU dos not support MMX instructions, there will be an exception.

This is the result I get from my Pentium PC

Before excuting MMX instruction "psubsw"
src1 = ffffffffffffffff
src2 = 1111111111111111
dst = 0000000000000000
After excuting MMX instruction "psubsw"
src1 = ffffffffffffffff
src2 = 1111111111111111
dst = eeeeeeeeeeeeeeee
*/

You can visit Intel's site to get a document
http://developer.intel.com/design/pentiumiii/manuals


IA-32 Intel® Architecture Software Developer's Manual, Volume 1: Basic Architecture

IA-32 Intel® Architecture Software Developer's Manual, Volume 2: Instruction Set Reference Manual

IA-32 Intel® Architecture Software Developer's Manual, Volume 3: System Programming Guide
Areslee 2001-07-12
  • 打赏
  • 举报
回复
.486
code segment
start:
db 0fh,0a2h
mov ax,4c00h
int 21h
code ends
end start

编译它,试试在486DX4/100以上和以下的CPU的运行结果。
pz1 2001-07-11
  • 打赏
  • 举报
回复
Areslee(易水):
可以详细点吗?最好给我例子。谢谢!!
我不是大明 2001-07-11
  • 打赏
  • 举报
回复
这个我以前怎么没听说过的!
Areslee 2001-07-11
  • 打赏
  • 举报
回复
就是奔腾芯片中新加入的指令
比如cpuid在486以前的CPU上就不能运行

21,496

社区成员

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

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