Re: asm and nasm newbie
- From: "Zhang Huan" <spamtrap@xxxxxxxxxx>
- Date: Mon, 26 Sep 2005 18:20:34 +0000 (UTC)
wolfgang kern wrote:
> Zhang Huan wrote:
>
> | do you mean that for such code
> | jmp addr32
> | by adding 66h prefix, the operand will be only 16bit and, the high
> | 16bit is ignored
>
> No. I better hadn't mentioned this rare usable options :)
> I once used it for tricky mixed 16/32 code links,
> but I soon replaced it by more flexible ways.
when i knew the 66h prefix, i wondered whether it can help me. actually
i must write an INT13h handler, an implementing a simplied RPC
protocol. it would be much better if i can implement it in c, for time
is so limited. however gcc cannot correctly compile c to 16bit-code in
the case of memory access. but i think i can do something to change the
assemble code gcc compiled.
>
> If you use (assuming 16 bits by default yet):
>
> 66 e9 xx xx xx xx jmp +x ;then the branch offset is also affected.
>
> But as the jumped target cannot be outside the 64KB segment,
> it is somehow useless in 16-bit mode.
>
sorry for my poor english :), do you mean that high 16bit address is
ignored??
and how to add such prefix, for example, in gas
> | and what about the "call" instruction
>
> Same as for jump, but rare recomendable!
> the pushed return address is 32-bits wide then,
> this means it will need a RETD (66 c3) to come back.
>
> The opposite, if in 32-bit mode:
>
> 66 e9 xx xx jmp+x ;will work as jump to Zero-page
> ;because the high word of EIP becomes truncated
>
> | and what about the "call" instruction
>
> Same as for jump, but not recomendable at all!
> the pushed return address is just 16 bits wide then.
>
> I hope I didn't add too many confusion with the uncommon...
>
no, you're justing "unconfusing" me :)
> __
> wolfgang
.
- Follow-Ups:
- Re: asm and nasm newbie
- From: wolfgang kern
- Re: asm and nasm newbie
- References:
- asm and nasm newbie
- From: Zhang Huan
- Re: asm and nasm newbie
- From: Frank Kotler
- Re: asm and nasm newbie
- From: Zhang Huan
- Re: asm and nasm newbie
- From: wolfgang kern
- Re: asm and nasm newbie
- From: Zhang Huan
- asm and nasm newbie
- Prev by Date: Re: Getting Back to Real Mode problem
- Next by Date: Re: opening and reading a character from a file with emu8086 assembler
- Previous by thread: Re: asm and nasm newbie
- Next by thread: Re: asm and nasm newbie
- Index(es):
Relevant Pages
|