[comp.sys.apple] JMP/JML differences

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") (05/08/89)

I've just been wondering what the advantages vs. disadvantages of
using a JML instead of a JMP would be.  I guess an advantage of the JML
would be that it wouldn't need space in a loader relocation dictionary.
Is there any other difference??

   -Gonzo

/**********************************************************************\
|*  Joe "Gonzo" Wankerl          |*|                                  *|
|*                               |*|   The views expressed here are   *|
|* BitNet =>  JWANKERL@UTCVM     |*|   not necessarily yours...       *|
|*                               |*|   ...but they should be.         *|
\**********************************************************************/

farrier@Apple.COM (Cary Farrier) (05/09/89)

In article <8905081131.aa03291@SMOKE.BRL.MIL> JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>
>I've just been wondering what the advantages vs. disadvantages of
>using a JML instead of a JMP would be.  I guess an advantage of the JML
>would be that it wouldn't need space in a loader relocation dictionary.
>Is there any other difference??

	Actually, any label reference (which isn't thrown out by optimizing),
	except brances (they contain an offset in the operand), will find 
	its way into a relocation table.

	The difference between a JMP and a JML is that a JMP instruction
	can only jump to an address within the current code bank, while a JML
	can jump to any address in any bank.  The reason is because the JMP
	only uses a 16 bit address, and the JML uses a 24 bit address.  The
	JMP will affect only the program counter (PC), and not the code bank
	register (K), while the JML will affect both.

	Most decent assemblers will convert any JMP instructions to JML if
	long addressing is required, so your code may vary.

Cary Farrier


-- 
+--------------+-------------------+
| Cary Farrier | farrier@apple.com | Ok, how's this for net traffic?
+--------------+-------------------+

delton@pro-carolina.cts.com (Don Elton) (05/09/89)

Network Comment: to #2379 by obsolete!JWANKERL%UTCVM.BITNET%cunyvm.cuny.edu

A JMP is limited to the current 64K bank the code is sitting in while the JML
is not.  The JML also requires a 3 byte address while the JMP requires a 2
byte address.

UUCP: [ sdcsvax nosc ] !crash!pro-carolina!delton
ARPA: crash!pro-carolina!delton@nosc.mil
INET: delton@pro-carolina.cts.com

Pro-Carolina: 803-776-3936 (300-2400 baud, login as 'register')
     US Mail: 3207 Berkeley Forest Drive, Columbia, SC  29209-4111

shawn@pnet51.cts.com (Shawn Stanley) (05/11/89)

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") writes:
>I've just been wondering what the advantages vs. disadvantages of
>using a JML instead of a JMP would be.  I guess an advantage of the JML
>would be that it wouldn't need space in a loader relocation dictionary.
>Is there any other difference??

The space taken in a loader relocation dictionary isn't directly minimized by
the use of a JML statement, mainly because the addresses have to come from
*somewhere*.  The savings comes when you use the jump table more than once.

One of the forms of the JMP instruction is the absolute indirect.  The JML
instruction has *only* the absolute indirect.  For example:

JMP (address)
JML (address)

The address must be 16 bits.  However, the JMP instruction assumes bank zero
for the destination address.  In both cases, the address specified is taken
from the current PBR, not the DBR.  Here are some examples, using $AAAA within
the current program bank as a load address:

$551010 JMP ($AAAA)

This will take a 16-bit address from locations $55AAAA-55AAAB and prefix it
with a PBR of $00, thus transferring control to an address within bank zero.
On the other hand:

$551010 JML ($AAAA)

This will take a 24-bit address from locations $55AAAA-55AAAC and transfer
control to that address.

UUCP: {uunet!rosevax, amdahl!bungia, chinet, killer}!orbit!pnet51!shawn
INET: shawn@pnet51.cts.com

JWANKERL@UTCVM.BITNET ("Josef W. Wankerl") (05/11/89)

On Wed, 10 May 89 21:25:18 GMT Shawn Stanley said:
>One of the forms of the JMP instruction is the absolute indirect.  The JML
>instruction has *only* the absolute indirect.  For example:
>
>JMP (address)
>JML (address)
>
>The address must be 16 bits.  However, the JMP instruction assumes bank zero
>for the destination address.  In both cases, the address specified is taken
Bank zero???  I think not.  The JMP would branch execution within the
same bank the code is executing, not bank zero.  Either that or the
programs I've written are not working.  :-)

>UUCP: {uunet!rosevax, amdahl!bungia, chinet, killer}!orbit!pnet51!shawn
>INET: shawn@pnet51.cts.com

  -Gonzo

/**********************************************************************\
|*  Joe "Gonzo" Wankerl          |*|                                  *|
|*                               |*|   The views expressed here are   *|
|* BitNet =>  JWANKERL@UTCVM     |*|   not necessarily yours...       *|
|*                               |*|   ...but they should be.         *|
\**********************************************************************/