This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reg near and far call syntax


Hi!
   I am trying to use near and far jump calls in a
assembly code. I am using gcc 2.96 on Linux 2.4.18-10
(redhat)on Intel 686. I am having certain doubts:
For near calls, we can either specify offset relative
to the EIP or using R/M encoding. 
My doubt is is it possible to specify offset in any
way
other than using label. Whenever we use label compiler
generates code having relative offset. Is there any
other case in which compiler generates such code?
When specifying using MOD R/M encoding, for AT&T
syntax, I tried to specify a 32 bit displacement as
follows: call 0x80404142. This supposed to generate
error but it didn't (no preceeding *). It compiled and
produced some wrong code. Is this a known bug?
I tried making a far call in intel syntax using
call far %es:0x80404142. This gave me an error saying
undefined reference to far (linker). GNU AS manual
says that this is the intel syntax. It compiled when I
used AT&T syntax (in intel syntax mode)lcall
%es:0x80404142.Is this bug again?
When I compiled above code, it used CALL m16:32 form
of far call (opcode : FF/3).I couldn't figure out how
to write mnemonic that would generate far call
corresponding to CALL ptr16:32 (Opcode: 9A). Any
ideas?
In summary, I want to know mnemonic syntax in
AT&T,Intel format for near calls (relative offset,
indirect addressing), far calls (m16:32,ptr16:32).
Sorry for the lengthy mail.
Thanks,
Sunil.


=====
Who you are speaks so loudly I can't hear what you're saying.
To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
The glory of friendship is not the outstretched hand, nor the kindly smile nor the joy of companionship; it is the spiritual inspiration that comes to one when he discovers that someone else believes in him and is willing to trust him.
A friend is a person with whom I may be sincere. Before him, I may think aloud
          Ralph Waldo Emerson
Arise,Awake, Stop not till goal is reached.
          Swami Vivekananda

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]