computer architecture microsoft assembler. procedures internal internal external external speeds...
TRANSCRIPT
Computer ArchitectureComputer Architecture
Microsoft AssemblerMicrosoft Assembler
ProceduresProcedures
• InternalInternal
• ExternalExternal
• Speeds learningSpeeds learning
• ImportingImporting.code.code
extrn Clrf:proc, Readstring:procextrn Clrf:proc, Readstring:proc
main procmain proc
Cont.. proceduresCont.. procedures
• CallingCalling
call Readstringcall Readstring
call Readintcall Readint
• InitializationInitialization
• What do you ask ?What do you ask ?
Cont.. proceduresCont.. procedures
• Which registers?Which registers?
• Reg sizes = var sizes?Reg sizes = var sizes?
• Data saved?Data saved?
““if”if”
• Compare 2 objectsCompare 2 objects
• 2 outcomes2 outcomes
cmp ax, bxcmp ax, bx
cmp ax, 97cmp ax, 97
““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”
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
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.