473,657 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

indirect jmp

Hi,

What C statement(s) would translate to indirect jmp in assembly? I know
that function pointer invocation would translate to indirect 'call'
instruction, but I am not sure what will lead to indirect jmp (eg. jmp
<register>).

Ganesh

Nov 15 '05 #1
13 6928
In article <11************ **********@g14g 2000cwa.googleg roups.com>,
<ga*****@gmail. com> wrote:
What C statement(s) would translate to indirect jmp in assembly? I know
that function pointer invocation would translate to indirect 'call'
instruction, but I am not sure what will lead to indirect jmp (eg. jmp
<register>).


longjump() would be the closest. Not that it's particularily close,
but it's all that there is.

In particular, you cannot take the address of a label or of
a statement block or of any executable element other than a routine,
and (as you note) there is no goto a routine.

Depending on what you are trying to do, you might want to look
into techniques that people have developed for emulating
"co-routines".
--
Watch for our new, improved .signatures -- Wittier! Profounder! and
with less than 2 grams of Trite!
Nov 15 '05 #2
ga*****@gmail.c om writes:
What C statement(s) would translate to indirect jmp in assembly? I know
that function pointer invocation would translate to indirect 'call'
instruction, but I am not sure what will lead to indirect jmp (eg. jmp
<register>).


There is no direct equivalent. A switch statement comes close.

What are you trying to do? An indirect jump is a technique, not a
problem; what problem are you trying to solve?

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #3
ga*****@gmail.c om wrote:
# Hi,
#
# What C statement(s) would translate to indirect jmp in assembly? I know
# that function pointer invocation would translate to indirect 'call'
# instruction, but I am not sure what will lead to indirect jmp (eg. jmp
# <register>).

No direct equivalent in ANSI C. gcc has label variables.
--
SM Ryan http://www.rawbw.com/~wyrmwif/
So basically, you just trace.
Nov 15 '05 #4
I am not trying to solve any problem. I am just wondering why indirect
jmp is kept in an instruction set.

Nov 15 '05 #5
ga*****@gmail.c om wrote:
I am not trying to solve any problem. I am just wondering why indirect
jmp is kept in an instruction set.


This group is nothing to do with the whats and whys of processor
instruction sets, only to do with the C language. So, as far as I can
see, any such wondering is not relevant here.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #6
I will re-state my problem. Name a C statement(s) that would certainly
make any compiler to generate indirect jmp instruction? (BTW, I am yet
to look into the co-routine suggestion given by one of the posters).

Ganesh

Nov 15 '05 #7
In article <11************ **********@g14g 2000cwa.googleg roups.com>,
<ga*****@gmail. com> wrote:
I will re-state my problem. Name a C statement(s) that would certainly
make any compiler to generate indirect jmp instruction?
There is no such statement. C may be implimented on machines whose
processor lacks indirect branches.

On some architectures, with some compilers, with some code patterns,
C compilers have been known to generate indirect branches for some switch
statements.
(BTW, I am yet
to look into the co-routine suggestion given by one of the posters).


That was me, and my suggestion to look at co-routines was in
the opposite direction completely: it was a suggestion to look
at a particular field of programming in which people have worked
on techniques to get around the *lack* of an indirect branch.
That is, if you had a particular problem in which you were thinking,
"Gee, I'm not sure how to solve this without using an indirect
branch", then you could look at successful co-routine implementations
to see how they got around the lack of an indirect branch.
--
University of Calgary researcher Christopher Auld has found that
milk is the most "rational addiction" amongst the several studied.
Nov 15 '05 #8
ga*****@gmail.c om wrote:
I will re-state my problem. Name a C statement(s) that would certainly
make any compiler to generate indirect jmp instruction?
None. For a start, there is nothing to say C cannot be implemented on a
processor which does not support indirect jumps. The same answer applies
to any other instruction.

We do not deal with system specifics here.
(BTW, I am yet
to look into the co-routine suggestion given by one of the posters).


They are also off topic here since they are not part of standard C.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #9
ga*****@gmail.c om wrote:

I am not trying to solve any problem. I am just wondering why indirect
jmp is kept in an instruction set.


Umm... Because they're useful?

Even if no C compiler in the world ever used an indirect jump, they would
still be useful to people who program in something other than C.

If you're looking for a C construct which _might_ generate an indirect
jump on a system which has such an instruction, look at switch/case.

And finally, read some of the multitude of posts on this list which show
how to properly use Google's broken interface to reply.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer .h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5810
by: Hal Vaughan | last post by:
I'm not sure what the correct name for this would be. I'd think it's either an indirect reference, or a pointer, or something like that. I'm working on a program that would call a series of classes in different orders and there are times where I may add extra classes that weren't part of the original design. I'd like to be able to store a list of the classes, in the order that they are used, in a text file. Then I could have the first...
1
2273
by: suresh | last post by:
Namasivayah, Stroustrup says when indirect array is used for reordering a valarray the index cannot be repeated twice(page 679). But Nicolai Josuttis in his book on C++ standard library, page 567, says, index may occur twice. g++ version 3.3.5 compiles code with repeated index without any complaint.
2
4240
by: Christopher Burns | last post by:
Hi all, We are using VB.NET (VS2K3), sitting on VSS6. I have sorted out a configuration problem that was preventing us from building from scratch for new developers, but now I am having a very odd references problem. Here is the scoop. I will make this brief, and if more info is needed please let me know... I don't want to ramble, as the details are vast. :) There are 3 projects involved in this issue, and it appears to be a...
1
1715
by: James | last post by:
I am looking for a way to delete indirect children records when a root record is removed. The same action that occurs if you delete a directory that contains sub directories of sub directories. The Relationship Integerity and Cascade Delete features works well with direct relationships, but I can't get it to work for my situation. For example:
1
3073
by: Sam Phillips | last post by:
Howdy, I'm trying to apply color schemes to forms and subforms. I'm using a global function to change the colors/fonts of controls. Right now it correctly loops over the controls in the main form, what I want is recursive behavior to format the subforms. Here's a sketch: Function ApplyColorScheme(strFormName As String)
0
3533
by: Eric Barr | last post by:
I saw a small number of old threads about a strange build error, but never saw a solution. I just spent about 4 hours debugging this so i hoped i could help out people who come across this problem by posting a solution. Anyway, here is what i was experiencing and how i fixed it ... The Build Error: Project '<projectname>' makes an indirect reference to assembly '<assemblyname>' which contains '<classname>'. Add a reference to...
2
1726
by: Zioth | last post by:
class A { function Get() {return $this;} } $obj = new A(); In php5, the following statement is valid: $x = $obj->Get()->Get(); In php4, I get the following error:
2
3097
by: misogsk | last post by:
Hi all, can someone help with to handle this error: BC32206: Indirect reference is being made to assembly ? Code i used was written in ASP.NET 1.1 and I run it on ASP.NET 2.0. The error code: <asp:label id="lbl_start" runat="server" text='<%#TimeZoneInformation.FromUniversalTime(userObject.TimeZoneID,Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "window_Start")))%>'>
5
9399
by: Rahul B | last post by:
Hi, I am having the following issues while trying to restrict the current user from creating any objects. Below is the privileges for the user and response when i try to create a table in that user. Can anybody tell what is the difference between DIRECT SYSADM and Indirect SYSADM and why is Indirect SYSADM is assigned to user by default.
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.