computer architecture microsoft assembler. procedures internal internal external external speeds...

8
Computer Architecture Computer Architecture Microsoft Assembler Microsoft Assembler

Upload: britney-mccarthy

Post on 17-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

Computer ArchitectureComputer Architecture

Microsoft AssemblerMicrosoft Assembler

Page 2: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

ProceduresProcedures

• InternalInternal

• ExternalExternal

• Speeds learningSpeeds learning

• ImportingImporting.code.code

extrn Clrf:proc, Readstring:procextrn Clrf:proc, Readstring:proc

main procmain proc

Page 3: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

Cont.. proceduresCont.. procedures

• CallingCalling

call Readstringcall Readstring

call Readintcall Readint

• InitializationInitialization

• What do you ask ?What do you ask ?

Page 4: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

Cont.. proceduresCont.. procedures

• Which registers?Which registers?

• Reg sizes = var sizes?Reg sizes = var sizes?

• Data saved?Data saved?

Page 5: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

““if”if”

• Compare 2 objectsCompare 2 objects

• 2 outcomes2 outcomes

cmp ax, bxcmp ax, bx

cmp ax, 97cmp ax, 97

Page 6: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

““hop-a-long”hop-a-long”

• GotoGoto• Jump to labelsJump to labels

jmp looplabeljmp looplabel

• Conditional jumpsConditional jumps– a jump that needs a conditiona jump that needs a condition– condition …cmp statementcondition …cmp statement– ““fall through”fall through”

Page 7: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

Conditional StatementsConditional Statements

Explain!Explain!

mov ax, 5mov ax, 5

mov bx, 7mov bx, 7

cmp ax, bxcmp ax, bx

jg lessthanjg lessthan

jmp greaterthanjmp greaterthan

Page 8: Computer Architecture Microsoft Assembler. Procedures Internal Internal External External Speeds learning Speeds learning Importing Importing.code extrn

Practical AssignmentPractical Assignment

• Plan!Plan!

• Use the skeleton program (1Use the skeleton program (1stst prac) prac)

• Cut relevant code from 2Cut relevant code from 2ndnd prac eg. prac eg.