Re: Uniform spacing of labels in MASM32



Silly me... it's been like 6 months since I coded using an assembler...
imagine forgetting something like 'org'? Yikes... I'm embarrassed...

But thank you so much, Randy. It works beautifully.

....just one question... how the heck does it work?

- Craig

randyhyde@xxxxxxxxxxxxx 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))
>
> > ; Instruction 0x0001 code
> > jmp LoopStart
> >
> > [END MASM32 CODE]
>
>
> Cheers,
> Randy Hyde

.