[comp.sys.ibm.pc.programmer] How to generate JMP FAR 0:0 w/TASM 1.5 + TLINK 1.01

mbeck@wheaties.ai.mit.edu (Mark Becker) (02/17/90)

Hello *

If the code below looks odd.. my background is EE and I'm used to
assemblers that Do What I Want.

Anyway, here's some code.  It's supposed to be compiled in tiny model
to generate a .COM file.
--------------------
farptr	LABEL	FAR
	.
	.
vect:	JMP	farptr
revect	EQU	$-4
	.
	.
init:	mov	ax,352Fh	; Get multiplexed interrupt point.
	int	21h
	mov	cs:WORD PTR [revect],bx
	mov	cs:WORD PTR [revect+2],es
--------------------

I'm using TASM 1.01 and TLINK 1.5.  TLINK complains that it can't
generate a COM file because there are relocatable items present.
Where?

This is a segment of a medium-sized TSR I'm writing.  There are
several references to the label farptr but all of them are to generate
the correct binary for a far jump to location 0:0 which is then
overwritten to point to the correct place.  I can't seem to get TASM
to accept an instruction of the form JMP FAR 0 .. TASM outputs an
immediate argument error.

What am I doing wrong?

And if someone can tell me how to get TASM to generate a 16-bit
in-segment jump to the next executable statement, I'd like to hear
about it.  Like:

	JMP	next
next:	<code>

TASM generates offset jumps with NOP fillers.. but thats not what I
want.

Save net.bandwidth: respond via e-mail.  I will summarize.

Mark Becker
mbeck@ai.mit.edu
-- 
+-----------------------------------------------+-----------------------+
| Mark Becker					| .signature under	|
| Internet: mbeck@ai.mit.edu			|	construction	|
+-----------------------------------------------+-----------------------+

howardm@Neon.Stanford.EDU (Howard A. Miller) (02/21/90)

MASM and TASM aren't very good are allowing FAR jumps.  The following
code is used in the BIOS where I work (HP) try it.  (I know it's a hack,
but it does work!

d	SEGMENT at 0h
lab     dw    ?
d       ENDS

    .....
;   Somewhare in your code
;   JMP FAR lab
    DB    0EAh
    DW    OFFSET lab
    DW    SEG d