The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Yuri on February 23, 2012, 05:21:49 AM

Title: Jump longer than 127 bytes
Post by: Yuri on February 23, 2012, 05:21:49 AM
When I assemble this code, I get a warning (see below).

CODE SECTION

Start:
    jmp > L1
    DB 128 DUP 90h
    L1:
    ret


GoAsm.Exe Version 0.57.0.2 - Copyright Jeremy Gordon 2001/12 - JG@JGnet.co.uk

Error!
Line 6 of assembler source file (jmp.asm):-
Forward short jump was to a place more than 127 bytes away (by 1 byte)
jmp > L1

In version 0.56 it would have been "line 4", i.e. the line where the actual JMP instruction is that should be fixed. Now it is the line with the destination label. Is this a bug or by design? If I have several JMPs to this label, I will have to guess which of them I must change. In 0.56 I used to fix the one mentioned and those that were above it.
Title: Re: Jump longer than 127 bytes
Post by: wjr on March 01, 2012, 12:32:51 AM
I tracked this one down and that change doesn't seem related to any of the fixes for earlier revisions. So I would say more of a bug given that 'Line 4' is displayed... with an easy fix forwarded to Jeremy for inclusion in GoAsm version 0.57.0.3.
Title: Re: Jump longer than 127 bytes
Post by: jorgon on March 01, 2012, 05:07:17 AM
Hi Yuri

Yes, it's true.  Wayne tracked down the bug fixed it and sent the source back to me!

So GoAsm 0.57.0.3 is available from here (http://www.godevtool.com/Goasm.zip).

Thanks Wayne!
Title: Re: Jump longer than 127 bytes
Post by: Yuri on March 01, 2012, 06:27:08 AM
Thanks! :8)
Title: Re: Jump longer than 127 bytes
Post by: ragdog on March 01, 2012, 06:58:24 AM
Hi

But a jump (jmp ) Must the target maximum of 126  bytes  before and 127 bytes after the JMP instruction.

Or not?

Title: Re: Jump longer than 127 bytes
Post by: donkey on March 01, 2012, 10:04:09 AM
Quote from: ragdog on March 01, 2012, 06:58:24 AM
Hi

But a jump (jmp ) Must the target maximum of 126  bytes  before and 127 bytes after the JMP instruction.

Or not?

Only short jumps.
Title: Re: Jump longer than 127 bytes
Post by: dedndave on March 01, 2012, 11:00:53 AM
QuoteBut a jump (jmp ) Must the target maximum of 126  bytes  before and 127 bytes after the JMP instruction.
the target is referenced to the first byte following the JMP instruction
for SHORT JMP's, the target may be -128 to +127 bytes from that address
the same applies to SHORT Jcc conditional branches