Pointer Accesses to Memory and Bitwise Manipulation
|
|
- Bertina Lyons
- 5 years ago
- Views:
Transcription
1 C Programming Pointer Accesses to Memory and Bitwise Manipulation This assignment consists of two parts, the second extending the solution to the first. Q1 [80%] Accessing Data in Memory Here is a hexdump of a memory region containing a scrambled quotation: f 3a e e :.indifferenc f f e.?.be.g.by...fo a e 61 6c r.h.penalty.t.pu c b f 08 blic.!.the.+.to c e c ruled.N.evil.U d 65 6e 2e 05 5a 00 2d 2d c 61.men..Z.--...Pla f d 65 6e f 6f to...men.b.good f 0a 7e f..to.~.affairs.o b is...pay The first two bytes of the memory region contain the offset at which you will begin processing records: 0x0034. This offset of the first record is followed by a sequence of word records, each consisting of a positive integer value, another positive integer value, and a sequence of characters: Length of record Offset of next record Characters in word uint8_t uint16_t chars The first value in each record specifies the total number of bytes in the record. Since words are relatively short, this value will be stored as a uint8_t, which has a range of The record length is followed immediately by a uint16_t value specifying the offset of the next word record in the list. This is followed by a sequence of ASCII codes for the characters that make up the word. (The term "word" is used a bit loosely here.) There is no terminator after the final character of the string, so be careful about that. Note that the length of the record depends upon the number of characters in the word, and so these records vary in length. That's one reason we must store the offset for each record. Since I'm using x86 hardware, integer values are stored in memory in little-endian order; that is, the low-order byte is stored first (at the smallest address) and the high-order byte is stored last (at the largest address). So the bytes of a multibyte integer value appear to be reversed. For example, if we have in int32_t variable holding the base-10 value 85147, the corresponding base-16 representation would be 0x14C9B, and the in-memory representation would look like this: or, represented in pure binary: 9B 4C low high low high The least-significant byte (corresponding to the lowest powers of 2) is stored at the lowest address, and the most-significant byte (corresponding to the highest powers of 2) is stored at the highest address. Version 2.00 This is a purely individual assignment! 1
2 As a programmer, you usually do not need to take the byte-ordering into account since the compiler will generate machine language compatible with your hardware, and that will make use of the bytes in the appropriate manner. But, when you're reading memory displays, you must take the byte-ordering into account. So, looking at the first two bytes of the memory block, we see that the word record we will process first occurs at relative offset 0x0034 from the beginning of the memory block. Let's consider how to interpret the hexdump shown earlier: f 3a e e :.indifferenc f f e.?.be.g.by...fo a e 61 6c r.h.penalty.t.pu c b f 08 blic.!.the.+.to c e c ruled.N.evil.U d 65 6e 2e 05 5a 00 2d 2d c 61.men..Z.--...Pla f d 65 6e f 6f to...men.b.good f 0a 7e f..to.~.affairs.o b is...pay The first word record consists of the bytes: The length of the first record is 0x06 or 6 in base-10, which means that the string is 3 characters long, since the length field occupies 1 byte and the offset of the next record occupies 2 bytes. The ASCII codes are , which represent the characters "The". The offset of the next record is 0x0021. The second word record consists of the bytes: 0a e 61 6c The length is 0x0a (10 in base-10), so the string is 7 characters long (the ASCII codes represent "penalty"), and the next word record is at the offset 0x0068. And so forth... The complete quotation, with word record offsets, is: 0x0037: The 0x0024: penalty 0x006B: good 0x0065: men 0x0086: pay 0x001E: for 0x0005: indifference 0x003D: to 0x002E: public 0x0077: affairs 0x0081: is 0x0072: to 0x0014: be 0x0042: ruled 0x0019: by 0x004A: evil 0x0051: men. 0x0058: -- 0x005D: Plato Version 2.00 This is a purely individual assignment! 2
3 To indicate the end of the sequence of word records, the final word record specifies that its successor is at an offset of 0, which is invalid (since that's the offset of the pointer to the first word record). For Q1, you will implement a C function that parses a tangled linked list of binary word records in memory, as described above. Your function will process the sequence of word records, and populate an array of struct variables with your interpretation of the original data. You will use the following data type to represent a parsed word record: struct _WordRecord { uint16_t offset; offset at which word record was found in memory char word; malloc'd C-string containing the "word" }; typedef struct _WordRecord WordRecord; You will create one of these struct variables whenever you parse a word record, and place that struct variable into an array supplied by the caller of your function. The function you implement must conform to the following interface specification: / Untangle() parses a chain of records stored in the memory region pointed to by pbuffer, and stores WordRecord objects representing the given data into the array supplied by the caller. Pre: pbuffer points to a region of memory formatted as specified wordlist points to an empty array large enough to hold all the WordRecord object you'll need to create Post: wordlist[0:nwords-1] hold WordRecord objects Returns: the number of "words" found in the supplied quotation. Restrictions: you may not use any array bracket notation in your solution / uint8_t Untangle(const uint8_t pbuffer, WordRecord wordlist); As usual, the tar file that is posted for the assignment contains testing/grading code. In particular, the following files are in the q1 directory: driver.c Untangle.h checkanswer.h checkanswer.o Generator.h Generator.o test driver declarations for specified function declarations for answer-checking and grading function 64-bit Linux binary for checking/grading code declarations for test data generator 64-bit Linux binary for test data generator Create Untangle.c and implement your version of it, then compile it with the files above. Read the header comments in driver.c for instructions on using it. What to Submit You will submit your file Untangle.c to the Curator, via the collection point C06Q1. That file must include any helper functions you have written and called from your version of Untangle(); any such functions must be declared (as static) in the file you submit. You must not include any extraneous code (such as an implementation of main() in that file). Your submission will be graded by running the supplied test/grading code on it. Version 2.00 This is a purely individual assignment! 3
4 Q2 [20%] Simple Bitwise Encryption Read the posted notes on bitwise operations in C, and the related sections in your C reference. For this question, you will modify the C function you wrote for Q1 so that it processes a tangled list of mildly encrypted binary records in memory, processing them non-sequentially, and produces a simple text report. The function must conform to the following interface specification (which is the same as for Q1): / Untangle() parses a chain of records stored in the memory region pointed to by pbuffer, and stores WordRecord objects representing the given data into the array supplied by the caller. Pre: pbuffer points to a region of memory formatted as specified wordlist points to an empty array large enough to hold all the WordRecord object you'll need to create Post: wordlist[0:nwords-1] hold WordRecord objects Returns: the number of "words" found in the supplied quotation. Restrictions: you may not use any array bracket notation in your solution / uint8_t Untangle(const uint8_t pbuffer, WordRecord wordlist); The memory region pointed to by pbuffer will be formatted in exactly the same way as for Q1, except that the bytes that represent the offset of the next record and the characters in the word will have been "masked": Length of record Masked offset of next record Masked characters in word uint8_t uint16_t chars Each of the ASCII codes has been XORed with the number of bytes in the word. Each byte of the offset field has been XORed with the unmasked first byte in the word. You must "unmask" the masked bytes in order to properly display the quotation. Part of the assignment is for you to determine what operation(s) you can use to perform this unmasking. I will not answer any questions about how to do that, except to say that you should consider the properties of the various bitwise operations available in C. This is a good opportunity for you to discover the value of the Boolean algebra rules covered in Discrete Mathematics. Aside from the issue of unmasking the encrypted bytes, the logic of this question is identical to Q1, so we will not repeat the detailed description given there. However, we will give you an example illustrating what must be done: a 77 2d d 2f 2f 0c aijw-. -.AA b 60 7a 7d 66 7d 65 6c 05 4f c 0a 08 H{`z}f}el.Oacl f f f b 66 0b 5b tsohr`os..twkf.[ d 6c 7d 6b 69 7c 6d 6c 05 3e 49 4b eml}ki ml.>ikv d 69 6d 6a mimj`.(b`g.4aefh f b d d 0c a..a`.+tvm.1tvm c 67 7d 6c 7b 7d f 6d elg}l{}h`g..mie f f 6d b 71 0a f vo.vomd.aikq..wp e 73 6f c a 6a 6c 79 7d 60 nsohrs.cahjjly}` e gn Version 2.00 This is a purely individual assignment! 4
5 The first word record begins at offset 0x0039, and contains the bytes: 05 3e 49 4b 76 The length of the word is 0x02. XORing that with each byte of the string yields: which represents the character string "It". And, XORing the first byte of the word with the bytes of the offset yields: which is the offset of the next record. In this case, the encrypted quotation decodes to: 0x003C: It 0x007A: is 0x002B: the 0x006E: mark 0x0075: of 0x001C: an 0x0031: educated 0x0041: mind 0x005D: to 0x0048: be 0x004D: able 0x0058: to 0x0062: entertain 0x0054: a 0x0021: thought 0x007F: without 0x0089: accepting 0x0005: it. 0x000B: -- 0x0010: Aristotle The q2 directory of the posted tar contains the following files: driver.c Untangle.h checkanswer.h checkanswer.o Generator.h Generator.o test driver declarations for specified function declarations for answer-checking and grading function 64-bit Linux binary for checking/grading code declarations for test data generator 64-bit Linux binary for test data generator The only differences between these files and those for Q1 are in the data generator (which must encrypt the word records as they are created), and in the checking/grading code, which must decrypt those same word records). Create Untangle.c and implement your version of it, then compile it with the files above. Read the header comments in driver.c for instructions on using it. What to Submit You will submit your file Untangle.c to the Curator, via the collection point C06Q2. That file must include any helper functions you have written and called from your version of Untangle(); any such functions must be declared (as static) in the file you submit. You must not include any extraneous code (such as an implementation of main() in that file). Your submission will be graded by running the supplied test/grading code on it. Version 2.00 This is a purely individual assignment! 5
6 Pledge: Each of your program submissions must be pledged to conform to the Honor Code requirements for this course. Specifically, you must include the following pledge statement in the submitted file: On my honor: - I have not discussed the C language code in my program with anyone other than my instructor or the teaching assistants assigned to this course. - I have not used C language code obtained from another student, or any other unauthorized source, either modified or unmodified. - If any C language code or documentation used in my program was obtained from an allowed source, such as a text book or course notes, that has been clearly noted with a proper citation in the comments of my program. <Student Name> Failure to include this pledge in a submission may result in a score of zero being assigned. Version 2.00 This is a purely individual assignment! 6
Pointer Accesses to Memory and Bitwise Manipulation
C Programming Pointer Accesses to Memory and Bitwise Manipulation This assignment consists of two parts, the second extending the solution to the first. Q1 [80%] Accessing Data in Memory Here is a hexdump
More informationPointer Accesses to Memory and Bitwise Manipulation
C Programming Pointer Accesses to Memory and Bitwise Manipulation This assignment consists of implementing a function that can be executed in two modes, controlled by a switch specified by a parameter
More informationHere is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:
Pointer Manipulations Pointer Casts and Data Accesses Viewing Memory The contents of a block of memory may be viewed as a collection of hex nybbles indicating the contents of the byte in the memory region;
More informationAccessing Data in Memory
Accessing Data in Memory You will implement a simple C function that parses a tangled list of binary records in memory, processing them nonsequentially, and produces a simple text report. The function
More informationHere is a C function that will print a selected block of bytes from such a memory block, using an array-based view of the necessary logic:
Pointer Manipulations Pointer Casts and Data Accesses Viewing Memory The contents of a block of memory may be viewed as a collection of hex nybbles indicating the contents of the byte in the memory region;
More informationPointer Casts and Data Accesses
C Programming Pointer Casts and Data Accesses For this assignment, you will implement a C function similar to printf(). While implementing the function you will encounter pointers, strings, and bit-wise
More informationCreating a String Data Type in C
C Programming Creating a String Data Type in C For this assignment, you will use the struct mechanism in C to implement a data type that models a character string: struct _String { char data; dynamically-allocated
More informationBoth parts center on the concept of a "mesa", and make use of the following data type:
C Programming Simple Array Processing This assignment consists of two parts. The first part focuses on array read accesses and computational logic. The second part requires solving the same problem using
More informationThe assignment requires solving a matrix access problem using only pointers to access the array elements, and introduces the use of struct data types.
C Programming Simple Array Processing The assignment requires solving a matrix access problem using only pointers to access the array elements, and introduces the use of struct data types. Both parts center
More informationgcc o driver std=c99 -Wall driver.c bigmesa.c
C Programming Simple Array Processing This assignment consists of two parts. The first part focuses on array read accesses and computational logic. The second part focuses on array read/write access and
More informationgcc o driver std=c99 -Wall driver.c everynth.c
C Programming The Basics This assignment consists of two parts. The first part focuses on implementing logical decisions and integer computations in C, using a C function, and also introduces some examples
More informationstruct _Rational { int64_t Top; // numerator int64_t Bottom; // denominator }; typedef struct _Rational Rational;
Creating a Data Type in C Rational Numbers For this assignment, you will use the struct mechanism in C to implement a data type that represents rational numbers. A set can be modeled using the C struct:
More informationCS 1044 Program 6 Summer I dimension ??????
Managing a simple array: Validating Array Indices Most interesting programs deal with considerable amounts of data, and must store much, or all, of that data on one time. The simplest effective means for
More informationCS 2604 Minor Project 1 DRAFT Fall 2000
RPN Calculator For this project, you will design and implement a simple integer calculator, which interprets reverse Polish notation (RPN) expressions. There is no graphical interface. Calculator input
More informationFor this assignment, you will implement a collection of C functions to support a classic data encoding scheme.
C Programming SEC-DED Data Encoding For this assignment, you will implement a collection of C functions to support a classic data encoding scheme. Data transmission and data storage both raise the risk
More informationDo not start the test until instructed to do so!
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationYou will provide an implementation for a test driver and for a C function that satisfies the conditions stated in the header comment:
Decision-making in C (Possibly) Intersecting Rectangles Background A rectangle in the xy-plane, whose sides are parallel to the coordinate axes can be fully specified by giving the coordinates of one corner
More informationCS 2604 Minor Project 1 Summer 2000
RPN Calculator For this project, you will design and implement a simple integer calculator, which interprets reverse Polish notation (RPN) expressions. There is no graphical interface. Calculator input
More informationA Capacity: 10 Usage: 4 Data:
Creating a Data Type in C Integer Set For this assignment, you will use the struct mechanism in C to implement a data type that represents sets of integers. A set can be modeled using the C struct: struct
More informationCS 3114 Data Structures and Algorithms DRAFT Project 2: BST Generic
Binary Search Tree This assignment involves implementing a standard binary search tree as a Java generic. The primary purpose of the assignment is to ensure that you have experience with some of the issues
More informationGiven that much information about two such rectangles, it is possible to determine whether they intersect.
Decision-making in C (Possibly) Intersecting Rectangles Background A rectangle in the xy-plane, whose sides are parallel to the coordinate axes can be fully specified by giving the coordinates of one corner
More informationA rectangle in the xy-plane, whose sides are parallel to the coordinate axes can be fully specified by giving the coordinates of two opposite corners:
Decision-making in C (Possibly) Intersecting Rectangles Background A rectangle in the xy-plane, whose sides are parallel to the coordinate axes can be fully specified by giving the coordinates of two opposite
More information// Initially NULL, points to the dynamically allocated array of bytes. uint8_t *data;
Creating a Data Type in C Bytes For this assignment, you will use the struct mechanism in C to implement a data type that represents an array of bytes. This data structure could be used kind of like a
More informationCS 2505 Computer Organization I Test 2. Do not start the test until instructed to do so! printed
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page fact sheet. Your fact sheet may contain definitions and examples,
More informationCS 2505 Computer Organization I Test 2. Do not start the test until instructed to do so! printed
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationFor storage efficiency, longitude and latitude values are often represented in DMS format. For McBryde Hall:
Parsing Input and Formatted Output in C Dealing with Geographic Coordinates You will provide an implementation for a complete C program that reads geographic coordinates from an input file, does some simple
More informationSimple C Dynamic Data Structure
C Programming Simple C Dynamic Data Structure For this assignment, you will implement a program that manipulates a simple queue of integer values. Your program will include the following features: IntegerDT
More informationDo not start the test until instructed to do so!
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationFundamental Concepts: array of structures, string objects, searching and sorting. Static Inventory Maintenance Program
Fundamental Concepts: array of structures, string objects, searching and sorting The point of this assignment is to validate your understanding of the basic concepts presented in CS 1044. If you have much
More informationCS 2704 Project 1 Spring 2001
Robot Tank Simulation We've all seen various remote-controlled toys, from miniature racecars to artificial pets. For this project you will implement a simulated robotic tank. The tank will respond to simple
More informationProgramming Standards: You must conform to good programming/documentation standards. Some specifics:
CS3114 (Spring 2011) PROGRAMMING ASSIGNMENT #3 Due Thursday, April 7 @ 11:00 PM for 100 points Early bonus date: Wednesday, April 6 @ 11:00 PM for a 10 point bonus Initial Schedule due Thursday, March
More informationDecision Logic: if, if else, switch, Boolean conditions and variables
CS 1044 roject 4 Summer I 2007 Decision Logic: if, if else, switch, Boolean conditions and variables This programming assignment uses many of the ideas presented in sections 3 through 5 of the course notes,
More informationPR quadtree. public class prquadtree< T extends Compare2D<? super T> > {
PR quadtree This assignment involves implementing a point-region quadtree (specifically the PR quadtree as described in section 3.2 of Samet s paper) as a Java generic. Because this assignment will be
More informationThe Program Specification:
Reading to Input Failure, Decisions, Functions This programming assignment uses many of the ideas presented in sections 3 through 8 of the course notes, so you are advised to read those notes carefully
More informationCS 2704 Project 3 Spring 2000
Maze Crawler For this project, you will be designing and then implementing a prototype for a simple game. The moves in the game will be specified by a list of commands given in a text input file. There
More informationUW CSE 351, Winter 2013 Final Exam
Full Name: Student ID #: UW CSE 351, Winter 2013 Final Exam March 20, 2013 2:30pm - 4:20pm Instructions: Write your full name and UW student ID number on the front of the exam. When the exam begins, make
More informationCS 2604 Minor Project 3 Movie Recommender System Fall Braveheart Braveheart. The Patriot
Description If you have ever visited an e-commerce website such as Amazon.com, you have probably seen a message of the form people who bought this book, also bought these books along with a list of books
More informationint32_t Buffer[BUFFSZ] = {-1, -1, -1, 1, -1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, -1, -1, -1, -1, -1}; int32_t* A = &Buffer[5];
This assignment refers to concepts discussed in the course notes on gdb and the book The Art of Debugging by Matloff & Salzman. The questions are definitely "hands-on" and will require some reading beyond
More informationCS 1044 Project 5 Fall 2009
User-defined Functions and Arrays This programming assignment uses many of the ideas presented in topics 3 through 18 of the course notes, so you are advised to read those carefully. Read and follow the
More informationCSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators
CSE 351: The Hardware/Software Interface Section 2 Integer representations, two s complement, and bitwise operators Integer representations In addition to decimal notation, it s important to be able to
More informationMemory, Data, & Addressing II
Memory, Data, & Addressing II CSE 351 Autumn 2018 Instructor: Justin Hsia Teaching Assistants: Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson
More informationCS2304 Spring 2014 Project 3
Goal The Bureau of Labor Statistics maintains data sets on many different things, from work place injuries to consumer spending habits, but what you most frequently hear about is employment. Conveniently,
More informationEach line will contain a string ("even" or "odd"), followed by one or more spaces, followed by a nonnegative integer.
Decision-making in C Squeezing Digits out of an Integer Assignment For part of this assignment, you will use very basic C techniques to implement a C function to remove from a given nonnegative integer
More informationSurvey. Motivation 29.5 / 40 class is required
Survey Motivation 29.5 / 40 class is required Concerns 6 / 40 not good at examination That s why we have 3 examinations 6 / 40 this class sounds difficult 8 / 40 understand the instructor Want class to
More informationCS 1044 Program 2 Spring 2002
Simple Algebraic Calculations One of the first things you will learn about C++ is how to perform numerical computations. In this project, you are given an incomplete program (see the end of this specification),
More informationComputer 2 App1. App3 API Library. App3. API Library. Local Clipboard
System Programming (MEEC/MEAer) Project Assignment 2016/2017 In this project the students will implement a simple distributed clipboard. Applications can copy and past to/from the distributed clipboard
More informationMemory, Data, & Addressing I
Memory, Data, & Addressing I CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/953/
More informationStructures, Unions Alignment, Padding, Bit Fields Access, Initialization Compound Literals Opaque Structures Summary. Structures
Structures Proseminar C Grundlagen und Konzepte Michael Kuhn Research Group Scientific Computing Department of Informatics Faculty of Mathematics, Informatics und Natural Sciences University of Hamburg
More informationCS 2704 Project 2: Elevator Simulation Fall 1999
Elevator Simulation Consider an elevator system, similar to the one on McBryde Hall. At any given time, there may be zero or more elevators in operation. Each operating elevator will be on a particular
More informationFile Navigation and Text Parsing in Java
File Navigation and Text Parsing in Java This assignment involves implementing a smallish Java program that performs some basic file parsing and navigation tasks, and parsing of character strings. The
More information1. A student is testing an implementation of a C function; when compiled with gcc, the following x86-32 assembly code is produced:
This assignment refers to concepts discussed in the course notes on gdb and the book The Art of Debugging by Matloff & Salzman. The questions are definitely "hands-on" and will require some reading beyond
More informationMemory, Data, & Addressing II CSE 351 Spring
Memory, Data, & Addressing II CSE 351 Spring 2018 http://xkcd.com/138/ Review Questions 1) If the word size of a machine is 64-bits, which of the following is usually true? (pick all that apply) a) 64
More informationFile Navigation and Text Parsing in Java
File Navigation and Text Parsing in Java This assignment involves implementing a smallish Java program that performs some basic file parsing and navigation tasks, and parsing of character strings. The
More informationThe Ensoniq EPS/EPS16+/ASR-10 Bank Format
The Ensoniq EPS/EPS16+/ASR-10 Bank Format, document version 0.7 1/6 The Ensoniq EPS/EPS16+/ASR-10 Bank Format documented by Thoralt Franz The Ensoniq EPS/EPS16+/ASR-10 Bank Format, document version 0.7
More informationMotivation was to facilitate development of systems software, especially OS development.
A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.
More informationCSE351: Memory, Data, & Addressing I
CSE351: Memory, Data, & Addressing I CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis http://xkcd.com/138/
More informationEECE.2160: ECE Application Programming
Spring 2018 Programming Assignment #10: Instruction Decoding and File I/O Due Wednesday, 5/9/18, 11:59:59 PM (Extra credit ( 4 pts on final average), no late submissions or resubmissions) 1. Introduction
More informationUW CSE 351, Summer 2013 Final Exam
Name Instructions: UW CSE 351, Summer 2013 Final Exam 9:40am - 10:40am, Friday, 23 August 2013 Make sure that your exam is not missing any of the 11 pages, then write your full name and UW student ID on
More informationCS 1044 Project 2 Spring 2003
C++ Mathematical Calculations: Falling Bodies Suppose an object is dropped from a point at a known distance above the ground and allowed to fall without any further interference; for example, a skydiver
More informationCS , Fall 2002 Exam 1
Andrew login ID: Full Name: CS 15-213, Fall 2002 Exam 1 October 8, 2002 Instructions: Make sure that your exam is not missing any sheets, then write your full name and Andrew login ID on the front. Write
More informationCS 2505 Computer Organization I
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other computing devices may
More informationDo not start the test until instructed to do so!
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationCompilers Project 3: Semantic Analyzer
Compilers Project 3: Semantic Analyzer CSE 40243 Due April 11, 2006 Updated March 14, 2006 Overview Your compiler is halfway done. It now can both recognize individual elements of the language (scan) and
More informationCS 2505 Computer Organization I
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other computing devices may
More informationC Language Programming
Experiment 2 C Language Programming During the infancy years of microprocessor based systems, programs were developed using assemblers and fused into the EPROMs. There used to be no mechanism to find what
More informationbytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks).
Understanding FAT 12 You need to address many details to solve this problem. The exercise is broken down into parts to reduce the overall complexity of the problem: Part A: Construct the command to list
More informationCourse Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++
Introduction to Programming in C++ Course Text Programming in C++, Zyante, Fall 2013 edition. Course book provided along with the course. Course Description This course introduces programming in C++ and
More informationBits, Bytes and Integers
Bits, Bytes and Integers Computer Systems Organization (Spring 2016) CSCI-UA 201, Section 2 Instructor: Joanna Klukowska Slides adapted from Randal E. Bryant and David R. O Hallaron (CMU) Mohamed Zahran
More informationCS 241 Data Organization Binary
CS 241 Data Organization Binary Brooke Chenoweth University of New Mexico Fall 2017 Combinations and Permutations In English we use the word combination loosely, without thinking if the order of things
More informationCS 1044 Project 1 Fall 2011
Simple Arithmetic Calculations, Using Standard Functions One of the first things you will learn about C++ is how to perform numerical computations. In this project, you are given an incomplete program
More informationA short session with gdb verifies a few facts; the student has made notes of some observations:
This assignment refers to concepts discussed in the course notes on gdb and the book The Art of Debugging by Matloff & Salzman. The questions are definitely "hands-on" and will require some reading beyond
More informationComputer Programming C++ (wg) CCOs
Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++
More informationCSE351 Spring 2010 Final Exam (9 June 2010)
CSE351 Spring 2010 Final Exam (9 June 2010) Please read through the entire examination first! We designed this exam so that it can be completed in 100 minutes and, hopefully, this estimate will prove to
More informationComputer Organization & Systems Exam I Example Questions
Computer Organization & Systems Exam I Example Questions 1. Pointer Question. Write a function char *circle(char *str) that receives a character pointer (which points to an array that is in standard C
More informationSAINT2. System Analysis Interface Tool 2. Emulation User Guide. Version 2.5. May 27, Copyright Delphi Automotive Systems Corporation 2009, 2010
SAINT2 System Analysis Interface Tool 2 Emulation User Guide Version 2.5 May 27, 2010 Copyright Delphi Automotive Systems Corporation 2009, 2010 Maintained by: SAINT2 Team Delphi www.saint2support.com
More informationHardware: Logical View
Hardware: Logical View CPU Memory Bus Disks Net USB Etc. 1 Hardware: Physical View USB I/O controller Storage connections CPU Memory 2 Hardware: 351 View (version 0) instructions? Memory CPU data CPU executes
More informationCSE 303 Lecture 18. Bitwise operations. reading: Programming in C Ch. 12. slides created by Marty Stepp
CSE 33 Lecture 8 Bitwise operations reading: Programming in C Ch. 2 slides created by Marty Stepp http://www.cs.washington.edu/33/ A puzzle... A king wishes to throw a grand party tomorrow in his castle.
More informationCS 2604 Minor Project 3 DRAFT Summer 2000
Simple Hash Table For this project you will implement a simple hash table using closed addressing and a probe function. The hash table will be used here to store structured records, and it should be implemented
More informationECE 206, Fall 2001: Lab 3
ECE 206, : Lab 3 Data Movement Instructions Learning Objectives This lab will give you practice with a number of LC-2 programming constructs. In particular you will cover the following topics: - Load/store
More informationSolutions - Homework 2 (Due date: October 4 5:30 pm) Presentation and clarity are very important! Show your procedure!
Solutions - Homework 2 (Due date: October 4 th @ 5:30 pm) Presentation and clarity are very important! Show your procedure! PROBLEM 1 (28 PTS) a) What is the minimum number of bits required to represent:
More informationSISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:
SISTEMI EMBEDDED The C Pre-processor Fixed-size integer types Bit Manipulation Federico Baronti Last version: 20160302 The C PreProcessor CPP (1) CPP is a program called by the compiler that processes
More informationFundamental of Programming (C)
Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering
More informationThe following notes illustrate debugging a linked list implementation with gdb.
Payload Type The following notes illustrate debugging a linked list implementation with. The example makes use of the following payload type: struct _WordRecord { char* Word; // zero-terminated C-string
More informationMotivation was to facilitate development of systems software, especially OS development.
A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.
More informationApplication Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification
Application Note 3/2003 PC Master Software Communication Protocol Specification By Pavel Kania and Michal Hanak S 3 L Applications Engineerings MCSL Roznov pod Radhostem Introduction The purpose of this
More informationLanguage Reference Manual simplicity
Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna
More informationProtocol of data exchange with modem via USB interface Version
Protocol of data exchange with modem via USB interface Version 2017.12.19 - Modem connects to USB-host as USB device of CDC class (virtual COM port in Windows, ttyusb or ttyacm in Linux) - Because real
More informationCS 2505 Computer Organization I Test 2. Do not start the test until instructed to do so! printed
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationCS 2505 Computer Organization I Test 2. Do not start the test until instructed to do so! printed
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet. No calculators or other electronic devices
More informationCS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #2 Due Tuesday, October 11:00 PM for 100 points Due Monday, October 11:00 PM for 10 point bonus
CS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #2 Due Tuesday, October 15 @ 11:00 PM for 100 points Due Monday, October 14 @ 11:00 PM for 10 point bonus Updated: 10/10/2013 Assignment: This project continues
More informationCSE351 Spring 2010 Final Exam (9 June 2010)
CSE351 Spring 2010 Final Exam (9 June 2010) Please read through the entire examination first! We designed this exam so that it can be completed in 100 minutes and, hopefully, this estimate will prove to
More informationEmbedded Systems - FS 2018
Institut für Technische Informatik und Kommunikationsnetze Prof. L. Thiele Embedded Systems - FS 2018 Lab 0 Date : 28.2.2018 Prelab Filling the gaps Goals of this Lab You are expected to be already familiar
More information1. A student is testing an implementation of a C function; when compiled with gcc, the following x86-64 assembly code is produced:
This assignment refers to concepts discussed in sections 2.1.1 2.1.3, 2.1.8, 2.2.1 2.2.6, 3.2, 3.4, and 3.7.1of csapp; see that material for discussions of x86 assembly language and its relationship to
More informationSubmit your answers to these questions to the Curator under Quizzes as HW08 by the posted due date and time. No late submissions will be accepted.
Instructions: For all questions, assume that any necessary header files have been included. Submit your answers to these questions to the Curator under Quizzes as HW08 by the posted due date and time.
More informationCPSC 213. Introduction to Computer Systems. Numbers and Memory. Unit 1a
CPSC 213 Introduction to Computer Systems Unit 1a Numbers and Memory 1 The Big Picture Build machine model of execution for Java and C programs by examining language features and deciding how they are
More informationWhere we are going (today)
Where we are going (today) Q: How do we arrange bits in the memory of the computer? (why do we care? we want the computer to store many individual numbers) A: bytes and words 10110000 00001110 01000010
More informationCS 2504 Intro Computer Organization Test 1
Instructions: Print your name in the space provided below. This examination is closed book and closed notes, aside from the permitted one-page formula sheet and the MIPS reference card. No calculators
More informationEmbedded Systems - FS 2018
Institut für Technische Informatik und Kommunikationsnetze Prof. L. Thiele Embedded Systems - FS 2018 Sample solution to Lab 0 Date : 28.2.2018 Prelab Filling the gaps Goals of this Lab You are expected
More informationCSCI 2212: Intermediate Programming / C Chapter 15
... /34 CSCI 222: Intermediate Programming / C Chapter 5 Alice E. Fischer October 9 and 2, 25 ... 2/34 Outline Integer Representations Binary Integers Integer Types Bit Operations Applying Bit Operations
More informationSISTEMI EMBEDDED. The C Pre-processor Fixed-size integer types Bit Manipulation. Federico Baronti Last version:
SISTEMI EMBEDDED The C Pre-processor Fixed-size integer types Bit Manipulation Federico Baronti Last version: 20170307 The C PreProcessor CPP (1) CPP is a program called by the compiler that processes
More information