首页
社区
课程
招聘
请教一行汇编代码
2004-9-12 19:54 4501

请教一行汇编代码

2004-9-12 19:54
4501
请教,下面一行代码中是什么意思?为什么要加个lock?

lock inc dword ptr ds:[eax-8]

[培训]科锐软件逆向50期预科班报名即将截止,速来!!! 50期正式班报名火爆招生中!!!

收藏
免费 1
打赏
分享
最新回复 (10)
雪    币: 392
活跃值: (909)
能力值: ( LV9,RANK:690 )
在线值:
发帖
回帖
粉丝
cyclotron 17 2004-9-12 20:07
2
0
lock是锁定总线的前缀,对一行代码没什么意义的
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
moon 5 2004-9-12 20:31
3
0
就是说没有意义,等于inc dword ptr ds:[eax-8]?
雪    币: 1540
活跃值: (2807)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
limee 2004-9-12 20:33
4
0
就是执行inc指令后,将总线锁定!
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
moon 5 2004-9-12 20:41
5
0
多谢回答,那将总线锁定会对以后的运算有何影响呢?
雪    币: 1540
活跃值: (2807)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
limee 2004-9-12 23:11
6
0
在没有开锁之前inc [******]里面的变量,
就无法访问到了!

最初由 moon 发布
多谢回答,那将总线锁定会对以后的运算有何影响呢?
雪    币: 339
活跃值: (1510)
能力值: ( LV13,RANK:970 )
在线值:
发帖
回帖
粉丝
nbw 24 2004-9-13 00:31
7
0
This instruction is a prefix that causes the CPU assert bus lock
        signal during the execution of the next instruction.  Used to
        avoid two processors from updating the same data location.  The
        286 always asserts lock during an XCHG with memory operands.  This
        should only be used to lock the bus prior to XCHG, MOV, IN and

        OUT instructions.

锁定当前被操作对象.防止发生错误交换数据.当然,一般来说对我们意义不太大
雪    币: 258
活跃值: (230)
能力值: ( LV12,RANK:770 )
在线值:
发帖
回帖
粉丝
qiweixue 19 2004-9-13 12:24
8
0
偶也学习一下:偶到是原来没有遇到过这前缀,支持一下;

最初由 nbw 发布
This instruction is a prefix that causes the CPU assert bus lock
signal during the execution of the next instruction. Used to
avoid two processors from updating the same data location. The
286 always asserts lock during an XCHG with memory operands. This
should only be used to lock the bus prior to XCHG, MOV, IN and
........
雪    币: 140
活跃值: (70)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
流哥 2004-9-13 15:48
9
0
hohoh,是不是 原可执行文件中要使用到互斥对象的啥
雪    币: 253
活跃值: (250)
能力值: ( LV9,RANK:210 )
在线值:
发帖
回帖
粉丝
moon 5 2004-9-13 16:16
10
0
还是不太明白,是不是以后想访问dword ptr ds:[eax-8]还要unlock dword ptr ds:[eax-8]?
雪    币: 12334
活跃值: (3492)
能力值: ( LV15,RANK:1565 )
在线值:
发帖
回帖
粉丝
AloneWolf 3 2004-9-13 18:16
11
0
unlock 是不用(也没有这样的前缀)...那个lock只是在这一条指令中有效...
应该是针对多处理器才有用的.一般不用去理它...
游客
登录 | 注册 方可回帖
返回