Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Valid operation?

2 views
Skip to first unread message

Qyz

unread,
Dec 28, 2009, 11:31:44 PM12/28/09
to

Hi all,

Is this valid?

mov byte [ebx], di

It assembles just fine with NASM. I want to move the lowest byte of
EDI
to the byte at [ebx].

If it's not valid, I guess I can do this:

mov ax, di
mov byte [ebx], al

... but that would take longer etc.

Thanks.

Frank Kotler

unread,
Dec 28, 2009, 11:59:01 PM12/28/09
to

Qyz wrote:
> Hi all,
>
> Is this valid?
>
> mov byte [ebx], di

No.

> It assembles just fine with NASM.

Get a version of Nasm that's not broken at:

http://www.nasm.us/

...latest snapshot seems okay...

> I want to move the lowest byte of
> EDI
> to the byte at [ebx].
>
> If it's not valid, I guess I can do this:
>
> mov ax, di
> mov byte [ebx], al
>
> ... but that would take longer etc.

Yeah. Can you use some register that has an 8-bit part instead of edi?
Swap edi and ebx, perhaps? "mov [edi], bl" would be fine - wouldn't even
have to tell Nasm, "byte"! :)

Best,
Frank

James Van Buskirk

unread,
Dec 29, 2009, 8:37:03 AM12/29/09
to

"Qyz" <questi...@MUNGED.microcosmotalk.com> wrote in message
news:4b39862f$0$5076$9a6e...@unlimited.newshosting.com...

> Is this valid?

> mov byte [ebx], di

The right syntax is

mov [ebx], dil

although it's unusual to address with ebx. More typical would be

mov [rbx], dil

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


Rod Pemberton

unread,
Dec 29, 2009, 8:38:41 AM12/29/09
to

"Qyz" <questi...@MUNGED.microcosmotalk.com> wrote in message
news:4b39862f$0$5076$9a6e...@unlimited.newshosting.com...
>
> mov byte [ebx], di
>
> It assembles just fine with NASM.

Are you sure about that? If so, what version? What BITS size?

I've got a few versions here. For all BITS sizes (16, 32, and 64 where
applicable), they all report:

file.asm:3: error: mismatch in operand sizes


Rod Pemberton


0 new messages