Chapter 8 Exercises. Question 1 Prototype for the ArraySum procedure, showing its parameter list: ArraySum PROTO, ptrArray:PTR DWORD, szArray:DWORD Describe.

Slides:



Advertisements
Similar presentations
Assembly Language Programming Chapter 8
Advertisements

Chapter 6 Data Structures
Assembly Language for x86 Processors 6th Edition Chapter 5: Procedures (c) Pearson Education, All rights reserved. You may modify and copy this slide.
Assembly Programming Notes for Practical2 Munaf Sheikh
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 8:Advanced Procedures (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers Chapter 8: Advanced Procedures Kip R. Irvine.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 8:Advanced Procedures (c) Pearson Education, All rights reserved. You may modify.
CS2422 Assembly Language and System Programming Structure and Macros Department of Computer Science National Tsing Hua University.
Assembly Language for Intel-Based Computers, 5th Edition
1 Chapter 7: Runtime Environments. int * larger (int a, int b) { if (a > b) return &a; //wrong else return &b; //wrong } int * larger (int *a, int *b)
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
Outline Learning Assembly by an Example.  Program Formats  Some Simple Instructions  Assemble and Execute Learning Another Example  Data Definition.
1 Lab Session-3 CSIT221 Spring 2003 b Group Worksheet 3 Exercise (Demo Required) b No new lab demo will be assigned to allow you to focus on HW#1.
CS2422 Assembly Language & System Programming October 26, 2006.
Chapter 12: High-Level Language Interface. Chapter Overview Introduction Inline Assembly Code C calls assembly procedures Assembly calls C procedures.
CS2422 Assembly Language & System Programming October 31, 2006.
CS2422 Assembly Language & System Programming October 24, 2006.
INVOKE Directive The INVOKE directive is a powerful replacement for Intel’s CALL instruction that lets you pass multiple arguments Syntax: INVOKE procedureName.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Defining and Using Procedures Creating Procedures.
CS2422 Assembly Language and System Programming High-Level Language Interface Department of Computer Science National Tsing Hua University.
CS2422 Assembly Language & System Programming November 7, 2006.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may.
CS2422 Assembly Language & System Programming September 26, 2006.
Advanced Procedures COE 205 Computer Organization and Assembly Language Computer Engineering Department King Fahd University of Petroleum and Minerals.
Assembly Language – Lab 5
Sahar Mosleh California State University San MarcosPage 1 Applications of Shift and Rotate Instructions.
Assembly Language for x86 Processors 6th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may modify and copy.
Chapter 3 Elements of Assembly Language. 3.1 Assembly Language Statements.
Today’s topics Parameter passing on the system stack Parameter passing on the system stack Register indirect and base-indexed addressing modes Register.
Assembly Language for Intel-Based Computers, 6 th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may.
Multiplication and Division Instructions & the 0Ah function.
CSC 221 Computer Organization and Assembly Language Lecture 27: 2-Dimensional Arrays + Structures.
Today's topics Multi-dimensional arrays Multi-dimensional arrays String processing String processing Macros Macros.
CSC 221 Computer Organization and Assembly Language Lecture 12: Addressing Modes in Assembly.
Procedure Computer Organization and Assembly Languages Yung-Yu Chuang 2007/12/24 with slides by Kip Irvine.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may.
Sahar Mosleh California State University San MarcosPage 1 Nested Procedure calls and Flowcharts.
Assembly Language for Intel-Based Computers Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may modify and copy.
Assembly Language for x86 Processors 7th Edition Chapter 13: High-Level Language Interface (c) Pearson Education, All rights reserved. You may modify.
Stack and Procedures Dr Adnan Gutub aagutub ‘at’ uqu.edu.sa
CSC 221 Computer Organization and Assembly Language
Assembly Language for x86 Processors 7th Edition
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 8: Advanced Procedures (c) Pearson Education, All rights reserved. You may.
Addressing Modes Chapter 6 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
Computer Organization and Assembly Languages Yung-Yu Chuang 2006/11/13
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 7.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 5: Procedures Lecture 19: Procedures Procedure’s parameters (c) Pearson Education, 2002.
Chapter 8:Advanced Procedures. 2 Chapter Overview Local Variables Stack Parameters Stack Frames Recursion Creating Multimodule Programs.
Chapter 7 Integer Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
CSC 221 Computer Organization and Assembly Language Lecture 16: Procedures.
Irvine, Kip R. Assembly Language for x86 Processors 7/e, What's Next Linking to an External Library The Book's Link Library Stack Operations Defining.
Chapter 8 String Operations. 8.1 Using String Instructions.
Assembly Language for Intel-Based Computers, 4 th Edition Week 12: Advanced Procedures Modified by Dr. Osama Younes.
Lecture 15 Advanced Procedures Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Assembly Language for x86 Processors 7th Edition
Assembly Language for Intel-Based Computers, 5th Edition
Chapter 9.
Assembly Language for x86 Processors 6th Edition
Assembly Language for x86 Processors 6th Edition
Data-Related Operators and Directives
Stack Frames and Advanced Procedures
Structs.
Assembly Language for Intel-Based Computers, 4th Edition
Computer Organization and Assembly Languages Yung-Yu Chuang 2008/12/22
Assembly Language for Intel-Based Computers, 5th Edition
Assembly Language for Intel-Based Computers, 5th Edition
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/12/4
Miscellaneous Topics.
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/11/24
Assembly Language for Intel-Based Computers, 4th Edition
Presentation transcript:

Chapter 8 Exercises

Question 1 Prototype for the ArraySum procedure, showing its parameter list: ArraySum PROTO, ptrArray:PTR DWORD, szArray:DWORD Describe in words about the parameters and their data types.

Question 2 A procedure accepts two parameters: an address of an array and a signed integer. Assume that the data type of the elements of the array is DWORD. Write the prototype of the procedure in an assembly code. Use PROTO.

Question 3 What does the following procedure fragment do? CopyString PROC, count:DWORD LOCAL temp[20]:BYTE mov edi,OFFSET count; invalid operand mov esi,OFFSET temp; invalid operand

Question 3 What does the following procedure fragment do? CopyString PROC, count:DWORD LOCAL temp[20]:BYTE mov edi,OFFSET count; invalid operand mov esi,OFFSET temp; invalid operand lea edi,count; ok lea esi,temp; ok

Question 4 CopyString PROC, count:DWORD LOCAL temp[20]:BYTE Give one example to call the procedure CopyString.

Question 5 PromptForIntegers PROTO, ptrPrompt:PTR BYTE, ptrArray:PTR DWORD, arraySize:DWORD Give one example to call the procedure PromptForIntegers. Use INVOKE.