Solved

far call in assembly

Posted on 2000-04-07
3
2,424 Views
Last Modified: 2011-09-20
How can I call a procedure if I know offset and segment?
When I execute

call 1122:3344

TASM complains "Near jump or call to different CS"

I can make a jump like
db 'EAh'
dw Offset
dw Segment

But how to make a call?
0
Comment
Question by:serg111
  • 2
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 2694648
CALL CS:OFFSET

is the right syntax.  Are you using a .MODEL directive and specifiying SMALL?

The correct bytes for this would be:

db '9Ah'
dw OFFSET
dw SEGMENT
0
 
LVL 32

Accepted Solution

by:
jhance earned 30 total points
ID: 2694663
You might try it this way:

CALL FAR PTR SEG:OFFSET

This is the MS syntax to force a FAR CALL when the current default memory model specifies a NEAR CALL.  It seems to me that TASM is very close in its syntax.
0
 
LVL 2

Author Comment

by:serg111
ID: 2696533
Thanks it helped
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now