🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.asm
4 messages
4 total messages Started by Matuzalem Mon, 16 Oct 2006 06:52
NASM: invalid effective address
#756
Author: Matuzalem
Date: Mon, 16 Oct 2006 06:52
28 lines
1965 bytes
Witam

; ----------------------

msg db "Welcome", 0

; (...)

mov dx, msg
mov al, [byte dx] ; error: invalid effective address

; ----------------------

NASM Manual:
"However, you can force NASM to generate an effective address in a
particular form by the use of the keywords BYTE, WORD, DWORD and
NOSPLIT. If you need [eax+3] to be assembled using a double-word offset
field instead of the one byte NASM will normally generate, you can code
[dword eax+3]. Similarly, you can force NASM to use a byte offset for a
small value which it hasn't seen on the first pass (see section 3.8 for
an example of such a code fragment) by using [byte eax+offset]. As
special cases, [byte eax] will code [eax+0] with a byte offset of zero,
and [dword eax] will code it with a double-word offset of zero. The
normal form, [eax], will be coded with no offset field."

Czemu mam ten błąd?

Pozdrawiam
Re: NASM: invalid effective address
#757
Author: Bogdan (bogdro)
Date: Mon, 16 Oct 2006 08:05
26 lines
1590 bytes
Matuzalem napisał(a):
> Witam
> 
> ; ----------------------
> 
> msg db "Welcome", 0
> 
> ; (...)
> 
> mov dx, msg
> mov al, [byte dx] ; error: invalid effective address

[...]

> Czemu mam ten błąd?

 DX nie jest dopuszczalnym rejestrem adresowym w adresowaniu
16-bitowym. Dopuszczalne kombinacje to:
 [(bp albo bx) + (si albo di) +- liczba]


-- 
Pozdrawiam, Bogdan                                  (Linux i FreeDOS)
Kurs assemblera x86 (DOS i Linuks): http://rudy.mif.pg.gda.pl/~bogdro
Grupy dyskusyjne o asm:  pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32
Prawdziwy, bezpieczny komunikator:                   www.JabberPL.org
Re: NASM: invalid effective address
#758
Author: Matuzalem
Date: Mon, 16 Oct 2006 08:36
32 lines
2014 bytes
Bogdan (bogdro) napisał(a):
> Matuzalem napisał(a):
> > Witam
> >
> > ; ----------------------
> >
> > msg db "Welcome", 0
> >
> > ; (...)
> >
> > mov dx, msg
> > mov al, [byte dx] ; error: invalid effective address
>
> [...]
>
> > Czemu mam ten błąd?
>
>  DX nie jest dopuszczalnym rejestrem adresowym w adresowaniu
> 16-bitowym. Dopuszczalne kombinacje to:
>  [(bp albo bx) + (si albo di) +- liczba]
>
>
> --
> Pozdrawiam, Bogdan                                  (Linux i FreeDOS)
> Kurs assemblera x86 (DOS i Linuks): http://rudy.mif.pg.gda.pl/~bogdro
> Grupy dyskusyjne o asm:  pl.comp.lang.asm alt.pl.asm alt.pl.asm.win32
> Prawdziwy, bezpieczny komunikator:                   www.JabberPL.org

Ja dałem dx ... głupio mi :P ide spać.. :]

Pozdrawiam
Re: NASM: invalid effective address
#759
Author: Pawel Kraszewski
Date: Mon, 16 Oct 2006 09:22
15 lines
1309 bytes
Bogdan (bogdro) wrote:


>> mov al, [byte dx] ; error: invalid effective address

>  DX nie jest dopuszczalnym rejestrem adresowym w adresowaniu
> 16-bitowym. Dopuszczalne kombinacje to:
>  [(bp albo bx) + (si albo di) +- liczba]

Dodatkowo do AL możesz wczytać tylko bajt, więc deklaracja [byte xxx] jest
nadmiarowa.

-- 
 Pawel Kraszewski
 www.kraszewscy.net
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads