Loading in 5 sec....

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation PowerPoint Presentation

CSCI 2510 Tutorial 1 Basic Assembly and Data Representation

- 176 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about ' CSCI 2510 Tutorial 1 Basic Assembly and Data Representation ' - aquila

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### CSCI 2510 Tutorial 1Basic Assembly and Data Representation

### Main topic:

### Write a machine program with given instruction

### Write a machine program with given instruction

### Write a machine program with given instruction

### Operation on two’s complement

### Operation on two’s complement

### Big endian and little endian

ZONG Wen

Department of Computer Science and Engineering

The Chinese University of Hong [email protected]

1. Write an assembly program with given instruction

2. Two’s complement operation

3. Ordering of bytes in data

Basic component of a computer

There are only 6 machine instructions on a single-accumulator processor, namely:

Load [Memory] {to ACC} e.g. Load [2872]

Store [Memory] {from ACC} e.g. Store [1536]

Add Constant {to ACC} e.g. Add -95

Add [Memory] {to ACC} e.g. Add [2132]

Multiply Constant {to ACC} e.g. Multiply 23

Multiply [Memory] {to ACC} e.g. Multiply [298]

Variable x and y are stored in address 1000 and 1004, try to implement x2 + y2, store the result in 1008.

Load [1000]; load data to register

Multiply [1000]; perform memory + register operation

Store [1008]; store temporary result to memory

Load[1004];

Multiply[1004];

Add[1008];

Store[1008]; store result

Example: (–6) + 8 * 3 – 1

Step 1 11111010 + (00001000 * 00000011) – 00000001

Step 2 (11111010 + 00011000) – 00000001

Step 3 00010010 – 00000001

Step 4 00010001

Step 5 17 (decimal answer without overflow)

Example: (–6) + 8 * 3 – 1

Step 1 11111010 + (00001000 * 00000011) – 00000001

Step 2 (11111010 + 00011000) – 00000001

Step 3 00010010 – 00000001

Step 4 00010001

Step 5 17 (decimal answer without overflow)

In big endian, you store the most significant byte in the smallest address

In little endian, you store the least significant byte in the smallest address

Download Presentation

Connecting to Server..