[comp.lang.c] MSC 5.1 Question

<ACPS2924@Ryerson.Ca> (01/27/91)

Is it possible in MSC 5.1 to gain access to the registers directly.
Turbo C has the _AX,_BX... pseudo-variables for them
is this possible in MSC and if so HOW???


Peter
ACPS2924@ryerson.ca

resnicks@netcom.UUCP (Steve Resnick) (01/30/91)

In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
>Is it possible in MSC 5.1 to gain access to the registers directly.
>Turbo C has the _AX,_BX... pseudo-variables for them
>is this possible in MSC and if so HOW???

Nope. I believe MSC 6.0 supports this, but I am not sure....


Cheers!
Steve


-- 
-------------------------------------------------------------------------------
resnicks@netcom.com, apple!camphq!105!steve.resnick, IFNA:	1:143/105.0, 
USNail: 530 Lawrence Expressway, Suite 374 
        Sunnyvale, Ca 94086
- In real life: Steve Resnick. Flames, grammar and spelling errors >/dev/null
0x2b |~ 0x2b, THAT is the question.
-------------------------------------------------------------------------------

nengle@copper.ucs.indiana.edu (nathan engle) (01/30/91)

In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
>Is it possible in MSC 5.1 to gain access to the registers directly.
>Turbo C has the _AX,_BX... pseudo-variables for them
>is this possible in MSC and if so HOW???
>
>
>Peter
>ACPS2924@ryerson.ca

  Not directly from 5.1. Whenever I needed to get at my registers in 5.1
I would drop into assembler. There's a neat little microcontroller from
NEC called the V25 which is code compatible with the V20, and which WILL
allow you to access register contents directly. The '25 actually has 8
sets of registers which can be addressed either normally as registers or
they can also be mapped as memory locations (so you would find the
contents of a register by reading a memory location - SLOW but it
works).

  Direct access to the registers is much simpler in MSC6.0 using the
inline assembler. I don't think that there are C constructs for
referring to the registers, but I had never seen that as a problem. 
Direct access to registers just means more reserved words and more rope 
to hang yourself with (as if C programmers needed any more). What
exactly are you trying to accomplish?

Nathan Engle             Software Evangelist
Indiana University       Dept of Psychology
nengle@copper.ucs.indiana.edu

prk@planet.bt.co.uk (Peter Knight) (01/30/91)

ACPS2924@Ryerson.Ca writes:

>Is it possible in MSC 5.1 to gain access to the registers directly.
>Turbo C has the _AX,_BX... pseudo-variables for them
>is this possible in MSC and if so HOW???

NO !

Peter Knight

BT Research
#include <std.disclaimer>

jvb7u@fermi.clas.Virginia.EDU (Jon Brinkmann) (01/31/91)

In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
#Is it possible in MSC 5.1 to gain access to the registers directly.
#Turbo C has the _AX,_BX... pseudo-variables for them
#is this possible in MSC and if so HOW???

The variables _AX, _BX, etc are not defined in MicroSoft C 5.1.  If  there
are variables or functions which get and put register values, they aren't
documented.

Jon
--
Jon Brinkmann					Astronomy Department
Internet:	jvb7u@Virginia.EDU		University of Virginia
UUCP:		...!uunet!virginia!jvb7u	P.O. Box 3818
SPAN/HEPnet:	6654::jvb7u			Charlottesville, VA 22903-0818

moore@dtg.nsc.com (Joseph Moore) (01/31/91)

>In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
>Is it possible in MSC 5.1 to gain access to the registers directly.
>Turbo C has the _AX,_BX... pseudo-variables for them
>is this possible in MSC and if so HOW???
>
Yes, it's possible, but as far as I know only for interrupt calls,
using the dos.h library structures REGS and SREGS.
See the documentation in the run-time library reference under int86 
and int86x (pp 365-369), or send me email for more info.

Joe Moore

jvp@genrad.UUCP (Jim V. Potter) (01/31/91)

In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
>Is it possible in MSC 5.1 to gain access to the registers directly.
>Turbo C has the _AX,_BX... pseudo-variables for them
>is this possible in MSC and if so HOW???

I suggest that you look at the union REGS defined in dos.h to see how to
define registers that are passed to functions.  The functions bdos(), int86(),
int86x(), intdos(), and intdosx() are some functions that use the REGS union;
see the Runtime Library manual for examples of calling these functions.

bobf@intermec.UUCP (Bob Folline) (02/06/91)

>In article <91026.223149ACPS2924@Ryerson.Ca> ACPS2924@Ryerson.Ca writes:
>>Is it possible in MSC 5.1 to gain access to the registers directly.

>Nope. I believe MSC 6.0 supports this, but I am not sure....

Yes 6.0 will allow register access through either pointer or inline assembly.
The manual gives a fair explanation of direct addressing.