2014年10月18日

stos 串存储指令

摘要: stos 包括 stosb stosw stosd, 涉及的寄存器是eax, edi,功能如下:stosb 将al中的值复制到 byte ptr es:[edi] 中, 同时edi++stosw 将ax中的值复制到 wordptr es:[edi] 中, 同时edi++stosd 将eax... 阅读全文

posted @ 2014-10-18 10:02 大呵呵 阅读(1246) 评论(0) 推荐(0) 编辑

LOOP

摘要: mov ecx, 7 start: mov eax, 0x1234 loop start //loop指令将ecx = ecx -1; 并检测ecx是否为0, 不为0跳到start处,继续循环; ecx == 0终止循环,执行下面的指令. _________________________... 阅读全文

posted @ 2014-10-18 10:01 大呵呵 阅读(174) 评论(0) 推荐(0) 编辑

设置字串遍历的方向 CLD STD

摘要: CLD(CLear Direction flag 即DF置 0) 向右遍历字串STD(Set Direction flag 即DF 置1) 向左遍历字串 阅读全文

posted @ 2014-10-18 10:00 大呵呵 阅读(148) 评论(0) 推荐(0) 编辑

字串比较函数 strcmp

摘要: //重点在于函数中需要手动push一些寄存器, 且以ebp为基址计算参数的地址.#include "stdafx.h"__declspec(naked)int strcmpA(char *s1, char *s2) //__declspec(naked) 不用编译器自动附带各种push ebp p... 阅读全文

posted @ 2014-10-18 09:59 大呵呵 阅读(292) 评论(0) 推荐(0) 编辑

获取ZF值

摘要: 获取ZF的值, 可用SETE指令(zf值放到al中), 也可以用 JNZ JNE 跳转指令间接获得, 请看下面这段代码:char *s1 = "123";char *s2 = "1234";__asm{ xor al, al mov edi, s1 mov ecx, -1 repnz sc... 阅读全文

posted @ 2014-10-18 09:57 大呵呵 阅读(286) 评论(0) 推荐(0) 编辑

导航