News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Jump longer than 127 bytes

Started by Yuri, February 23, 2012, 05:21:49 AM

Previous topic - Next topic

Yuri

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.

wjr

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.

jorgon

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.

Thanks Wayne!
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Yuri


ragdog

Hi

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

Or not?


donkey

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.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

dedndave

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