相关疑难解决方法(0)

EAX寄存器的反向字节顺序

示例:0xAABBCCDD将变为0xDDCCBBAA

由于第一次XOR操作中的访问冲突异常,我的程序崩溃了.

似乎有一个更好的天真解决方案,使用移位或旋转,但无论如何,这里是代码:

  ;; #########################################################################

      .486
      .model flat, stdcall
      option casemap :none   ; case sensitive

;; #########################################################################

      include \masm32\include\masm32.inc
      include \masm32\include\kernel32.inc

      includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\masm32.lib


.code
;; The following program will flip the sequence of the bytes in the eax
;; example : 0xAABBCCDD will turn into 0xDDCCBBAA
start:
MOV eax, 0AABBCCDDh 
XOR BYTE PTR [eax], al ;; Swap first byte and last byte
XOR al, BYTE PTR [eax]
XOR BYTE PTR [eax], al 
XOR BYTE PTR …
Run Code Online (Sandbox Code Playgroud)

x86 assembly masm endianness masm32

3
推荐指数
1
解决办法
6912
查看次数

标签 统计

assembly ×1

endianness ×1

masm ×1

masm32 ×1

x86 ×1