Assembly Language Structures and Macros.

Slides:



Advertisements
Similar presentations
Link list/file stamps/clusters Odds and ends remaining for test 2.
Advertisements

OutLine of Tutorial 3 Memory Allocation Const string New string(byte array) Read memory in simulator Function invocation How Import library files Modify.
Introduction to Assembly Language
Assembly Language for x86 Processors 6th Edition Chapter 5: Procedures (c) Pearson Education, All rights reserved. You may modify and copy this slide.
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
Assembly Language for Intel-Based Computers, 5th Edition
CS2422 Assembly Language and System Programming Assembly Language Fundamentals Department of Computer Science National Tsing Hua University.
Assembly Language Integer Arithmetic. Flags  MUL Carry and Overflow: 1, if the upper half of the product is not equal to zero.  IMUL One-Operand Format.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Symbolic Constants Equal-Sign Directive Calculating.
Runtime Stack Managed by the CPU, using two registers
Irvine: Assembly Language for Intel-Based Computers (1999) Symbolic Constants Equal-sign Directive EQU Directive TEXTEQU Directive.
Outline Learning Assembly by an Example.  Program Formats  Some Simple Instructions  Assemble and Execute Learning Another Example  Data Definition.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Intrinsic Data Types (1 of 2) BYTE, SBYTE 8-bit unsigned.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 3: Assembly Language Fundamentals (c) Pearson Education, All rights reserved.
Conditional Processing
Assembly programming A little background on using the software.
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
CS2422 Assembly Language & System Programming October 24, 2006.
Coding.
CS2422 Assembly Language & System Programming September 26, 2006.
Assembly Language – Lab 5
Chapter 2 Software Tools and Assembly Language Syntax.
Sahar Mosleh California State University San MarcosPage 1 Applications of Shift and Rotate Instructions.
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 3: Assembly Language Fundamentals Assembling, Linking and Running Programs Example Programs.
Chapter 3 Elements of Assembly Language. 3.1 Assembly Language Statements.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 3: Assembly Language Fundamentals (c) Pearson Education, All rights reserved.
ZONG Wen Department of Computer Science and Engineering The Chinese University of Hong Kong
High-Level Language Interface Computer Organization and Assembly Languages Yung-Yu Chuang 2005/12/15 with slides by Kip Irvine.
Assembly Programming Practical 3. Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop.
Chapter 12: High-Level Language Interface. 2 Why Link ASM and HLL Programs? Use high-level language for overall project development Relieves programmer.
Assembly Language for Intel-Based Computers Chapter 7: Integer Arithmetic (c) Pearson Education, All rights reserved. You may modify and copy.
ASSEMBLY LANGUAGE FOR INTEL-BASED COMPUTERS, PROCEDURES.
L AB 2. P ROGRAM STRUCTURE The assembly language program consist of code, data and stack. Data segment: contains all the variable definition..Data Code.
Chapter 8 Advanced Programming Applications Objectives: Linking separate object files together Creating and using an object code library Predicting the.
CT215: Assembly Language Programming Chapter 10: Macros (c) Pearson Education, All rights reserved. You may modify and copy this slide show for your.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 10: Structures and Macros (c) Pearson Education, All rights reserved. You.
In Class Program Write, assemble and test a program: –Use the DB directive to define the following list of numbers and name it array: 31h, 32h, 33h, 34h.
1 The Stack and Procedures Chapter 5. 2 A Process in Virtual Memory  This is how a process is placed into its virtual addressable space  The code is.
Microprocessors used in Personal Computers. The Memory Map of a Personal Computers Transient Program Area (TPA): Holds the operating system (interrupt.
Assembly Language for x86 Processors 6th Edition Chapter 3: Assembly Language Fundamentals (c) Pearson Education, All rights reserved. You may modify.
Chapter 8 Exercises. Question 1 Prototype for the ArraySum procedure, showing its parameter list: ArraySum PROTO, ptrArray:PTR DWORD, szArray:DWORD Describe.
CS2422 Assembly Language and System Programming 0 Week 7 & 8 Intro. To Assembly Programming.
Lecture 15 Advanced Procedures Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Assembly Language for x86 Processors 6th Edition
Assembly Language Lab 9.
Assembly Lab 3.
Assembly Language programming
Assembly Language Fundamentals
Additional Assembly Programming Concepts
Chapter 9.
Assembly Language Lab (4).
Microprocessor Lab CSL1543 0:0:2
(The Stack and Procedures)
Assembly Language for Intel-Based Computers, 5th Edition
Data-Related Operators and Directives
Assembly Programming Notes for Practical 1 1.
Computer Programming Machine and Assembly.
Assembly Language for Intel-Based Computers
Introduction Installation of MASM Installation of TextPad
Chapter 4 –Requirements for coding in Assembly Language
Shift, Multiply, and Divide
Table 3‑1: Unsigned Data Range Summary in ARM
MS-Windows Programming
(The Stack and Procedures)
Hardware & Software Architecture
MUL operation.
Computer Architecture and System Programming Laboratory
Procedures & Macros Introduction Syntax Difference.
BASIC SYNTAX OF ASSEMBLY LANGUAGE “HELLO WORLD” PROGRAM.
Procedures and Macros.
Presentation transcript:

Assembly Language Structures and Macros

Examples Walk.asm List.asm Wraps.asm putChar.asm Nested.asm

Exercise 1 Create a macro named mMult32 that multiplies two unsigned 32-bit memory operands and produces a 32-bit product. INCLUDE Irvine32.inc mMult32 MACRO op1,op2,product ; ***** YOUR CODES HERE ************* ENDM .data val1 DWORD 1000h val2 DWORD 200h prod DWORD ?

.code main PROC mMult32 val1,val2,prod ; Display results mov eax,prod call WriteHex call Crlf exit main ENDP END main

ch10_04.exe

Due date: 96/1/4 ftp://eec751@ftp.csie.nuk.edu.tw Zip your files as a09xxxxx_951228.zip