關於80x86組合語言偏移地址計算和語法錯誤的問題?
作者:由 初面初安 發表于 曲藝時間:2022-02-02
第一個原因:
The default segment register is SS for the effective addresses containing a BP index, DS for other effective addresses。
別問為什麼,反正手冊上就這麼寫的。
Intel手冊:Intel® 64 and IA-32 Architectures Software Developer‘s Manual Volume 2 (2A, 2B, 2C & 2D): Instruction Set Reference, A-Z
Table 2-1。 16-Bit Addressing Forms with the ModR/M Byte
第二個原因(我猜你問的是MOV EAX, EIP):
操作EIP暫存器只能用JMP/CALL/RET/PUSH/POP這些,MOV指令不支援直接操作EIP,不要問為什麼,因為這就是Intel手冊上的規定。
手冊上沒有給EIP預留編碼的位置: