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

Classes, write a program to copt values of object without using copy constr...

write a program to copt values of object without using copy constructor or = operator

Difference between next and continue clause, The difference among the next ...

The difference among the next and continue verb is that in the continue verb it is used for a situation where there is no EOF condition that is the records are to be accessed again

Determine about the information centres, Determine about the Information ce...

Determine about the Information centres Airports, supermarkets and any application where information needs to be relayed to customers, gain advantage from having automatic inf

Push and pop, Suupose a stack-oriented processor that haves the stack opera...

Suupose a stack-oriented processor that haves the stack operations PUSH and POP.  Arithmetic operations automatically involve the top one or two stack elements. Starting with an

Explain about the logical devices, Explain about the Logical Devices ...

Explain about the Logical Devices Locator, to indicate a position and/or orientation Pick, to select a displayed entity To input a single value in the space of re

Object oriented systems analysis and design, Analysis and design form the b...

Analysis and design form the basis on any significant software artifact. Analysis is critical in terms of making sure that the final artifact actually meets user requirements (ie b

How to create a bugzilla account? , 1. Enter your "E-mail address...

1. Enter your "E-mail address" and "Real Name" (or whatever name you need to call yourself) in the spaces given, then select the "Create Account" button. 2. Within moments, you

Explain the for loop, Explain The for loop The for loop is frequently ...

Explain The for loop The for loop is frequently used, usually where the loop will be traversed a fixed number of times. It is very flexible, and novice programmers should take

State the term- combinational circuit, In a pure combinational circuit is ...

In a pure combinational circuit is it necessary to mention all the inputs in sensitivity disk? if yes, why? Yes in a pure combinational circuit is it essential to mention all

Explain the low level language - computer programming, Explain the Low Leve...

Explain the Low Level Language - Computer Programming? An assembly language or a machine language is known as Low-level language which are closer to the hardware than are high-

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