flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
rhyno_dagreat 09 Dec 2006, 19:56
LODS basically loads the contents of the source index (si) into a* (* meaning it varies with the size of the operand, i.e. LODSB moves whatever's in SI into AL, LODSW moves whatever's in SI into AX).
I will give you this help file. It's something I keep handy on my HD and helps me when I don't know what an opcode does.
|
|||||||||||
![]() |
|
hckr83 09 Dec 2006, 20:49
so basically the lods [operand] thing is only in assembly, like truly it's just an assembly mnomec, so at the instruction(not assembly) level it doesn't have an operand?
|
|||
![]() |
|
Goplat 09 Dec 2006, 21:07
yep, the opcode is just AC for byte or AD for word/dword. I think the reason that assemblers allow the explicit operand form is so that you can use a segment override; with the "lodsb" form you'd have nowhere to put it.
Code: lodsb ; AC lods byte [si] ; AC lods byte [cs:si] ; 2E AC |
|||
![]() |
|
Tomasz Grysztar 09 Dec 2006, 21:30
Goplat wrote: I think the reason that assemblers allow the explicit operand form is so that you can use a segment override; with the "lodsb" form you'd have nowhere to put it. Not only the segment and also size of the addressing register, like: Code: lods byte [si] lods byte [esi] The LODSB is just a shortcut form that uses the default addressing for the given mode - DS:SI with USE16, DS:ESI with USE32. You've this this kind of options not only with string operations, the other example is XLAT: Code: xlat byte [cs:bx] xlat byte [fs:ebx] And analogously there's also a short form XLATB that uses the default addressing. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.