comp 2003: assembly language and digital logic chapter 0: some background notes by neil dickson

9
COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Upload: rodney-houston

Post on 20-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

COMP 2003:Assembly Language and Digital Logic

Chapter 0: Some BackgroundNotes by Neil Dickson

Page 2: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Purposes of the Course

• Learn how modern computers work from a software perspective

• Learn about the basics of computer architecture

Page 3: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Behold, The Computer

CPU RAM

I/O Devices

the focus of this course

a huge can of worms

Page 4: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Memory (RAM)

Data in memory is whatever you use it as.

...

00000000h FFFFFFFFh

0000002Bh

Page 5: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

CPU Execution

1. Reads data from memory representing machine code instruction (fetch)

2. Interprets the machine code (decode)3. Reads data from registers or memory to be

operated on (load)4. Performs the operation specified by the

instruction (execute)5. Writes results to registers or memory (store)

Page 6: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

CPU State (32-bit x86)

eax

ebx

ecxedx

espebpesiedi

eflags

eip

General Registers

Special Registers

4 Cache Levels (primary, L1, L2, L3)

Things relevant for now

Things not relevant until later on

Translation Lookaside Buffers (TLBs)

cr0cr2cr3cr4

Control Registers

st0

st2st3st4

FPU Registers

st1

st5st6st7

xmm0

xmm2xmm3xmm4

SSE Registers

xmm1

xmm5xmm6xmm7

gdtrldtridtr

tr cwswtw

mxcsr

MTRRsMSRs

Miscellaneous Other Stuff

Page 7: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

What is Assembly Language?

• A programmer-readable representation of machine code

Page 8: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Why Use Assembly Language?

• To learn how your software actually works under the hood

• Performance• Operating Systems• Embedded Systems

Page 9: COMP 2003: Assembly Language and Digital Logic Chapter 0: Some Background Notes by Neil Dickson

Things you’ll need

• Inventor IDE, an assembly editor created for this course (http://www.codecortex.com/ide/)

• Assembly Language Video Tutorial, a fast, easy way to learn assembly for doing graphics (http://www.codecortex.com/ide/tutorial/)