Fascinating new switch mechanism in assembler

Lionello Lunesu lio at lunesu.remove.com
Wed Apr 26 02:56:31 PDT 2006


Dan wrote:
> In article <e1qf9o$1me0$1 at digitaldaemon.com>, Lionello Lunesu says...
>> I'm no Walter, but I think he had it right.
>>
>>>> jmp dword ptr FLAT:_DATA[00h][EBX*4]
>> It's not jumping to "ebx" but to "[ebx*4], which means the value (dword) 
>> at (ebx*4) is read first.
>>
>> The *4 also shows that the table contains dwords: the offsets of the 
>> code jumped to for each case.
>>>> dd offset FLAT:?test@@YAHH at Z[014h]
>> L.
> 
> Lionello, I have no idea what "dd offset FLAT:?test@@YAHH at Z[014h]" means.  I can
> read assembly, even a touch of hex, but I skipped gibberish class.  Anyways,
> [EBX*4] makes sense to me, so I know you're right.  : )

LOL, well, it breaks down to segment:symbol[offset], segment being FLAT 
(from 0 to infinity and beyond), the nearest symbol being ?test@@YAHH at Z 
(the label at the start) and 014h the offset from that label, 
?test@@YAHH at Z+0x14 points to the mov right after the jmp, I think :)

L.



More information about the Digitalmars-d mailing list