Atmiņas adresēšana Viendimensijas masīvi C++ valodā: VectC

Slides:



Advertisements
Similar presentations
Defining and processing tables
Advertisements

Lecture By SHERY KHAN Assembly Language Lecture By SHERY KHAN
Array : To store multiple value in one variable, “but value must be homogenous or similar type” is called array. We can say in other word Arrangement of.
Writing and reading files. Creating a file on a disk Get a file handle from system Use INT 21H function 3C to create a directory entry for the file Use.
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
第 4 章习题参考答案: 2 、取 SIZE 属性 A1——2 字节( 4 ) A2——3 字节( 6 ) A3——20 字节( 40 ) A4——4 字节( 60 ) 4 、 L=6 5 、 PLENTH=22, 可用于确定循环次数。 7 、( AX ) =1 ( BX ) =20 ( CX ) =1.
Irvine, Kip R. Assembly Language For Intel-Based Computers TYPE and SIZE Operators TYPE –returns the size, in bytes of a single element of a data label.
Lect 3: Instruction Set and Addressing Modes. 386 Instruction Set (3.4) –Basic Instruction Set : 8086/8088 instruction set –Extended Instruction Set :
Addressing modes – 1 The way in which an operand is specified is called the Address Mode.
Introduction to X86 assembly by Istvan Haller
1 Lecture 4: Data Transfer, Addressing, and Arithmetic Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine.
Target Processor Directives , When using.386, the program can only run on 386 and above processors.
Assembly Language for Intel-Based Computers
Irvine, Kip R. Assembly Language For Intel-Based Computers.data string db "This is a string." COUNT = ($–string) ; calculate string length.code mov cx,COUNT.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#8) By Dr. Syed Noman.
Lect 4: Instruction Set and Addressing Modes. 386 Instruction Set (3.4)  Basic Instruction Set : 8086/8088 instruction set  Extended Instruction Set.
Factorial of a number data segment x1 db 4 fact dw ? data ends
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.
String-Introduction String is a series of bytes or a series of words in sequential memory locations. Index registers - SI (Data segment) - DI (Extra segment)
Arithmetic Flags and Instructions
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#9) By Dr. Syed Noman.
ICS312 Lecture13 String Instructions.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
Review of Assembly language. Recalling main concepts.
Multi-module programming. Requirements of an assembly language module when it is linked with another module PUBLIC directive - it exports to other modules.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Assembly Programming Practical2. Initialising Variables (Recap) Initialising variables are done in the.data section Initialising variables are done in.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
1 Using the Assembler Chapter – 4(A). 2 Exchanging Two Variables title Exchange Two Variables (Exchange.asm).model small.stack 100h.data value1 db 0Ah.
Factoring Day 1 I can factor a quadratic expression. x 2 + 3x + 2 Rewrite as (x + 1)(x + 2)
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Instruction set Architecture
Introduction to assembly programmıng language
Presentation on Real Mode Memory Addressing
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Lecture 4 Control Flow Structures (LOOPS)
Assembly IA-32.
Assembly Lang. – Intel 8086 Addressing modes – 1
Morgan Kaufmann Publishers Computer Organization and Assembly Language
اصول اساسی برنامه نویسی به زبان اسمبلی
Microprocessor and Assembly Language
Arithmetic Instructions
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
Computer Architecture and Assembly Language
Chapter 4: Instructions
שפת סף וארכיטקטורה של מעבד 8086
3.6 Data transfer Instructions
فصل پنجم انشعاب و حلقه.
ارايه دهنده : حسن عسكرزاده
8086 Registers Module M14.2 Sections 9.2, 10.1.
اصول اساسی برنامه نویسی به زبان اسمبلی
Microprocessor Lab CSL1543 0:0:2
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Computer Architecture and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
X86 Assembly Review.
5.5 – Completing the Square
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
CS-401 Computer Architecture and Assembly Language Programming
Chapter 8: Instruction Set 8086 CPU Architecture
Introduction to Assembly
Computer Architecture and Assembly Language
(Array and Addressing Modes)
Presentation transcript:

Atmiņas adresēšana Viendimensijas masīvi C++ valodā: 1 2 3 VectC const int N = 3; char VectC[N] = {1, 2, 3}; short VectS[N] = {1, 2, 3}; long VectL[N] = {1, 2, 3}; 1 2 3 VectC 3 baiti Iekšēja realizācija: VectS 6 baiti VectL 12 baiti

Viendimensijas masīvi Assembler valodā N Equ 3 VectB DB 1, 2, 3 VectW DW 1, 2, 3 VectD DD 1, 2, 3 1 2 3 x x+1 x+2 VectB 3 baiti Iekšēja realizācija x+4 VectW 6 baiti x+8 VectD 12 baiti

Pārskaitļa (nepārskaitļa) pārbaude Cikls Loop Mov Cx, N ; skaitītājs S: ... Loop S ; 1. Cx := Cx-1 ; 2. Cx=0 ? Pārskaitļa (nepārskaitļa) pārbaude Mov Ax, 5 Test Ax, 00000001B ;Test Ax, 1 Jz _Even ? 1 and =1 =0

Elementu izvietošana akumulatorā: baiti un vārdi. Indeksa adresēšana Mov Cx, N Xor Bx, Bx S: Mov Al, VectB[Bx] Inc Bx Loop S Mov Ax, VectW[Bx] Add Bx, 2 Indeksa adresēšana Elementu izvietošana akumulatorā: dubultvārdi. ... Mov EAx, VectD[Bx] Add Bx, 4

Elementu izvietošana akumulatorā: baiti un vārdi. Bāzes adresēšana Mov Cx, N Lea Bx, VectB S: Mov Al, [Bx] Inc Bx Loop S Bāzes adresēšana Lea Bx, VectW Mov Ax, [Bx] Add Bx, 2 Elementu izvietošana akumulatorā: dubultvārdi. ... Mov EAx, [Bx] Add Bx, 4

Iespējamie indeksa reģistri: Bx, Si, Di, Bp Indeksa adresēšana ar mērogošanu Mov Cx, N Xor EDx, EDx S: Mov Al, VectB[EDx*1] Inc EDx Loop S Elementu izvietošana akumulatorā: baiti un vārdi. Mov Ax, VectW[EDx*2] ... Mov EAx, VectD[EDx*4] Inc EDx Elementu izvietošana akumulatorā: dubultvārdi.

Bāzes-indeksa adresēšana Mov Cx, N Xor Bx, Bx Xor Si, Si S: Mov Al, VectB[Bx][Si] Inc Bx Loop S Elementu izvietošana akumulatorā: baiti un vārdi. Mov Ax, VectW[Bx][Si] Inc Si VectB[Bx][Si] = VectB[Si][Bx] VectW[Bx][Si] = VectW[Si][Bx]