Re: Uniform spacing of labels in MASM32



"randyhyde@xxxxxxxxxxxxx" <spamtrap@xxxxxxxxxx> wrote:

>
>Chris Martens wrote:
>>
>> [MASM32 CODE]
>>
>> mov ebx, offset Instruction
>> sub ebx, 2 ; Each instruction is two bytes wide (WORD)
>>
>> LoopStart:
>> add ebx, 2
>> xor edx, edx
>> mov dx, WORD PTR [ebx]
>> sal edx, 6
>> add edx, offset ExecStart
>> jmp edx
>>
>> ExecStart:
>> ; Instruction 0x0000 code
>> jmp LoopStart
>>
>> ExecStart + 40h:
>
>Instead, use:
>
> org $+(40h-($-ExecStart))

Umm, won't

org ExecStart + 40h

do exactly the same thing with a lot less typing?
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

.



Relevant Pages

  • Re: Question about jumps
    ... mov ecx, msg1 ... mov edx, len1 ...
    (alt.lang.asm)
  • Re: Syscall problem
    ... or eax, eax ... mov ebx, prog2run ... xor edx, edx ... mov ecx, goodbye ...
    (alt.lang.asm)
  • Re: modulo
    ... > mov ebx, 146097 ... > xor edx, edx ... > mov ebx, 1461 ...
    (borland.public.delphi.language.basm)
  • Re: Uniform spacing of labels in MASM32
    ... > mov ebx, offset Instruction ... > xor edx, edx ... > jmp LoopStart ... > [END MASM32 CODE] ...
    (comp.lang.asm.x86)