flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
asmfan 11 Jan 2009, 09:45
i think it's purposely cuz lodsb is a separate 1 byte (w/o REX) command with defined size operand, but lods is a hint to use that command with appropriate segment (if overridden) and size for operand.
|
|||
![]() |
|
edfed 11 Jan 2009, 09:47
error: extra characters on line
lodsb[gs:si] i think it is normal as lodsb is a short version of lods, it don't need operand under 1.67.26 |
|||
![]() |
|
vid 11 Jan 2009, 10:12
Proper syntax would be "lods byte [gs:si]", but I am not sure if that would work
|
|||
![]() |
|
Tomasz Grysztar 11 Jan 2009, 12:44
You can look it up in Intel manuals - LODSB, LODSW, XLATB, etc. are all the "shortcuts", which do not take any arguments and use the default operands. To specify other than default, you need to use the proper instruction. Like:
Code: use32 lodsb ; = lods byte [ds:esi] lods byte [gs:si] ; some different variant xlatb ; = xlat byte [ds:ebx] xlat byte [fs:bx] ; some different variant |
|||
![]() |
|
DOS386 11 Jan 2009, 14:39
Thanks ...
![]() > You can look it up in Intel manuals Not much in. ![]() vid wrote: > Proper syntax would be "lods byte [gs:si]", but I am not sure if that would work Why ? It seems to work. But since "lodsb" and "lods byte" is the very same instruction it was and still is inobvious to me why only the latter accepts segment prefix. |
|||
![]() |
|
Tomasz Grysztar 11 Jan 2009, 21:06
DOS386 wrote: > You can look it up in Intel manuals This is what my copy of "IA-32 Intel® Architecture Software Developer’s Manual Volume 2A" says. ![]()
|
||||||||||
![]() |
|
DOS386 12 Jan 2009, 08:42
Tomasz Grysztar wrote: This is what my copy of "IA-32 Intel® Architecture Software Developer’s Manual Volume 2A" says. That's what the famous manual you originally learned ASM from says: Quote: LODS loads the AL, AX, or EAX register with the memory byte, word, _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
![]() |
|
MazeGen 12 Jan 2009, 10:16
LODSB/MOVSB/CMPSB/... takes no operands and therefore you can't override default DS: segment.
The manual explains it clearly: there is short form and long form of all string instructions' syntax. Always use the long form if you want to use segment override. |
|||
![]() |
|
DOS386 12 Jan 2009, 10:47
MazeGen wrote: LODSB/MOVSB/CMPSB/... takes no operands and therefore you can't override default DS: segment. The manual explains it clearly: there is short form and long form of all string instructions' syntax. NOT the one I quoted from ![]() Quote: Always use the long form if you want to use segment override. OK ... minor thing. |
|||
![]() |
|
MazeGen 12 Jan 2009, 11:03
Always use the latest manuals when in doubt.
... |
|||
![]() |
|
revolution 12 Jan 2009, 11:15
MazeGen wrote: Always use the latest manuals when in doubt. Just like the software and hardware, manuals/documentation can also have "bugs". So the latest version is always the best place to start. Perhaps the old adage "if in doubt RTFM" can be slightly modified to "if in doubt RTLFM" where "L" stands for "latest"? ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.