Solved

far call in assembly

Posted on 2000-04-07
3
2,504 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Suggested Courses

751 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