computer engineering introlab1 page 1 beginners explanation on how a processor works! the labs will...

6
Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth.

Upload: shavonne-owens

Post on 30-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 1

Beginners explanation

on how a processor works!

The labs will teach you the truth.

Page 2: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 2

Lab 1

Procedure calls. Byte and word array indexing, pointers. Conditional branch instructions. Simple loops. Reading/ writing from/to data memory.

Page 3: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 3

Branch instruction (part of)

Beq rs rt label Bne rs rt label

Together with Slt-instruction and $0

enough for first lab.

Page 4: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 4

Register conventions (fig A9)

Reg. name Nr Usage zero 0 Constant 0 at 1 Reserved for assembler v0 - v1 2-3 Expr. evaluation, function results a0 - a3 4-7 Argument 1-4 t0 - t7 8-15 Temporary (not saved) s0 - s7 16-23 Saved Temporary t8 - t9 24-25 Temporary (not saved) k0 - k1 26-27 Reserved for OS kernel gp 28 Pointer to global area sp 29 Stack pointer fp 30 Frame pointer ra 31 Return address

Page 5: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 5

Lab 1 register usage

Use only

$sx

$tx

$r0 (=$0)

Page 6: Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth

Computer Engineering IntroLab1 page 6

Lab 1 - How to represent characters?

Use the ASCII-code Complete table at WWW