LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-02-2012, 02:52 PM   #1
Registered: Sep 2011
Location: Las Vegas!
Distribution: Ubuntu n' Flavors, ReactOS, MINIX3, FreeDOS, Arch
Posts: 339

Rep: Reputation: Disabled
C++ & Fortran; Get Current Register Values

I want to make a program in both Fortran (For Syntax Simplicity) and C++ (Know More) that prints the current values of each register (esp, etc.).
I have a hunch that it will difficult in Fortran but C++ should be Mildly simple. I would rather it not be inline assembly so I could edit it more easaly but I'm flexible.
How would I Get the value of a register(s) in C++\Fortran?

Last edited by Zssfssz; 03-02-2012 at 02:54 PM.
Old 03-02-2012, 05:09 PM   #2
LQ Newbie
Registered: Apr 2011
Location: Oregon
Posts: 25

Rep: Reputation: 3
I can give you a little guidance from my old mainframe days. When we wanted "binary" information in a non-assembler environment (COBOL), we would write a little assembler subroutine, and call it from the high level language.

Be aware, however, during a call to a subroutine, certain register values change.



c++, fortran, registers

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cli utility to view hardware register values/ registers slugman Linux - Hardware 1 06-11-2011 10:29 AM
Problem on assigning register for Current pointer beparas Linux - General 1 05-18-2009 01:14 AM
How to know SHMSEG, SHMMIN,SHMMAX and SEMMAP current values sunilvadranapu SUSE / openSUSE 1 09-19-2007 04:18 AM
Accessing register values in C... Elric of Grans Programming 6 05-09-2005 01:30 AM
C Function List && Fortran OutToSea Programming 0 06-18-2003 11:13 AM

All times are GMT -5. The time now is 08:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration