📄 ec_x86.c
字号:
#include "stdafx.h"
uint32 cq_ntohl(uint32 a) {
__asm{
mov eax, a;
bswap eax;
}
}
void cq_ntohl_array(uint32* p, uint32 num) {
__asm{
mov eax, dword ptr [p];
mov ecx, num;
next:
mov ebx, [eax];
bswap ebx;
mov dword ptr[eax], ebx;
add eax, 4;
loop next;
}
}
uint16 cq_ntohs(uint16 a) {
__asm{
mov ax, a;
ror ax, 8;
}
}
void cq_ntohs_array(uint16* arr, uint32 num) {
__asm{
mov eax, dword ptr [arr];
mov ecx, num;
next:
mov bx, word ptr [eax];
ror bx, 8;
mov word ptr[eax], bx;
add eax, 2;
loop next;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -