问题描述
这是一个相当幼稚的问题。我只是玩弄一些分配可执行内存和手工装配的一些86 code在运行它。我对如何解决64位模式下工作有点混乱。如果我有我的C code的变量,我想RAX的内容移动到这个变量,我应该使用哪一个MOV指令的形式? (这是不使用内联汇编,所以我不能让编译器做对我来说,我只是有与放大器的价值; VAR一起玩)
This is a rather naive question. I'm just playing around with allocating some executable memory and manually assembling some x86 code to run in it. I'm a bit confused by how addressing works in 64-bit mode. If I have a variable in my C code, and I want to move the contents of RAX into this variable, which form of the MOV instruction should I use? (This isn't using inline assembly, so I can't get the compiler to do it for me; I just have the value of &var to play with.)
推荐答案
使用Intel语法,它会像 MOV [VAR],RAX
,其中 VAR
基本上是64位立即地址。
Using Intel syntax, it will be something like mov [var],rax
, where var
is basically the 64-bit immediate address.
我觉得这是什么英特尔调用 MOV moffs64 *,RAX
在英特尔®64和IA-32架构
软件开发人员手册。
I think this what Intel call MOV moffs64*,RAX
in "Intel® 64 and IA-32 ArchitecturesSoftware Developer’s Manual".
这篇关于移动RAX的内容对C变量(x86-64的ASM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!