NASM 16位英特尔 [英] NASM 16bit Intel

查看:188
本文介绍了NASM 16位英特尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有指向一个地址,并在我的情况字节的变量写大小麻​​烦。这给我的错误错误:无效的有效地址:

I am having trouble with pointing to a address and write in my case a variable of byte in size. This gives me the error "error: invalid effective address":

mov byte[AX], byte 0x0

一些试错后,我测试相同,但与EAX。这将编译就好了:

After some trail and error i tested the same but with EAX. This compiles just fine:

mov byte[EAX], byte 0x0

我是什么在这里失踪?

What am I missing here?

推荐答案

[AX] 是一个无效的内存操作数规格。

[AX] is an invalid memory operand specification.

在有效的16位的是:

[常量]结果
[BX]结果
[SI]结果
[二]结果
[BX +常数]结果
[BP +常数]结果
[SI +常数]结果
[DI +常数]结果
[BX + SI]结果
[BX + DI]结果
[BP + SI]结果
[BP + DI]结果
[BX + SI +常数]结果
[BX + DI +常数]结果
[BP + SI +常数]结果
[BP + DI +常数]

[constant]
[BX]
[SI]
[DI]
[BX+constant]
[BP+constant]
[SI+constant]
[DI+constant]
[BX+SI]
[BX+DI]
[BP+SI]
[BP+DI]
[BX+SI+constant]
[BX+DI+constant]
[BP+SI+constant]
[BP+DI+constant]

[BP]形式上是无效的,但许多组装会悄悄地把它转换成[BP + 0]

[BP] is formally invalid, but many assemblers will quietly convert it into [BP+0].

请参阅内存操作编码和MODR / M和SIB字节的CPU手册。

See the CPU manual for memory operand encodings and the ModR/M and SIB bytes.

这篇关于NASM 16位英特尔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆