Write a program to input an address, Computer Engineering

Assignment Help:

  Write a program to input an address i.e. 20 Hex and read the byte (char) contents of that address  

Answer
 
include
void main()
{
char prompt;

Date: 26th August 2012

Version 1.0  
Function : To read an address in memory       
 Modifications:   none*/
unsigned long int address;
unsigned char *add;
unsigned char data;
printf("Please enter in the address  you want to read\n\r");
scanf("%lx",&address);
add = (unsigned char *)address;
data = *add;
printf("The data at the address %08lx is %02x\n\r",address,data);  
printf("Press and key to exit \n\r");
scanf("\n%c",&prompt);
 
}
  
Note: Care should be taken since some operating systems do not allow the user to read any memory address. The PC environment is one of these in that the PC runs under protected memory and hence looking at memory outside this area can yield 'General protection errors '. In order to access the memory in a PC, the operating system must tag the memory area for common use by the program. This is usually achieved by either writing a windows driver for the hardware/address or my poking in an allocated area i.e. allocating static space by an array or using malloc to reserve bytes of area.


Related Discussions:- Write a program to input an address

Implementation of a data entry application, Develop and submit an original ...

Develop and submit an original implementation of a data entry application. Identify and declare variables which will hold all data that needs to be entered to fill in the attached

Origin of RISC, Q. Origin of RISC? In the 1980s a new philosophy develo...

Q. Origin of RISC? In the 1980s a new philosophy developed having optimizing compilers which could be used to compile 'normal' programming languages down to instructions which

What is a privileged instruction, What is a privileged instruction? To ...

What is a privileged instruction? To protect the operating system of a computer from being corrupted by user programs, particular instructions can be executed only whereas the

Explain j2ee, With respect to security, which one is the better choice? ...

With respect to security, which one is the better choice? .Net or J2EE? Explain? As per majority programmers .NET is the best one which have single vendor compare to, the

Spirit duplicating of information, Spirit Duplicating Equipment Requir...

Spirit Duplicating Equipment Required Spirit Duplicator (also known as hectograph) Thermal copier (optional) Materials Masters Hectographic carbon COPY pa

Explain the fundamentals of c programming, Explain the Fundamentals of C Pr...

Explain the Fundamentals of C Programming? The C is a general purpose structured programming language. The C was developed and first implemented by the Dennis Ritchie at Bell L

Define the register addressing mode, Q. Define the Register Addressing mode...

Q. Define the Register Addressing mode? When operands are taken from registers implicitly or explicitly it is known as register addressing. These operands are termed as regis

What is mqseries cluster, Cluster is said to be collection of queue manager...

Cluster is said to be collection of queue manager's logically linked together to balance the load on the remote machine (i.e if it is remote queue managers which processes your mes

Find minimum sampling rate of analog signal to be sampled, The analog signa...

The analog signal needs to be sampled at a minimum sampling rate of: (A) 2fs                                               (B) 1/(2fs) (C)  fs/2

Examples of artificial neural networks, Examples of artificial neural netwo...

Examples of artificial neural networks: Now here as an example consider a ANN that has been trained to learn the following rule categorising the brightness of 2x2 black and wh

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd