1/2002JNM1 Positional Notation (Hex Digits). 1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory.

Slides:



Advertisements
Similar presentations
Registers of the 8086/ /2002 JNM.
Advertisements

DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
There are two types of addressing schemes:
Introduction to 8086 Microprocessor
Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Memory Address Segment-offset address Base location (segment) + logical location (offset) Example: For 32-bits segment-offset address, 08F1:0100 represents.
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.
Department of Computer Science and Software Engineering
1/2002JNM1 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C.
Video systems (continue). Practice Modify the program to get a string from a keyboard to display the input string on the middle of the screen with reverse.
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 :
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
Stack Memory H H FFFFF H FFFFE H SS 0105 SP 0008 TOS BOS BOS = FFFF = 1104F H H 1104F H.
8086 Assembly Language Programming I
The 8086 Assembly Programming Data Allocation & Addressing Modes
Princess Sumaya University
Target Processor Directives , When using.386, the program can only run on 386 and above processors.
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.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
An Introduction to 8086 Microprocessor.
CDP ECE Spring 2000 ECE 291 Spring 2000 Lecture 7: More on Addressing Modes, Structures, and Stack Constantine D. Polychronopoulos Professor, ECE.
1/2002JNM1 Basic Elements of Assembly Language Integer Constants –If no radix is given, the integer is assumed to be decimal. Int 21h  Int 21 –A hexadecimal.
Types of Registers (8086 Microprocessor Based)
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Faculty of Engineering, Electrical Department,
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 4 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
Click to add Title Comunicación y Gerencia Click To add Subtitle Click to add Text Fundamentals of Assembly Language.
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.
Microprocessors used in Personal Computers. The Memory Map of a Personal Computers Transient Program Area (TPA): Holds the operating system (interrupt.
Review of Assembly language. Recalling main concepts.
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
New/Old Assembler Directives Data Definition Statement syntax –[name] directive initializer [,initializer]… At least one initializer is required in a.
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
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.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Assembly language programming
Instruction set Architecture
Format of Assembly language
Introduction to 8086 Microprocessor
ADDRESSING MODES.
Microprocessor Systems Design I
Microprocessor and Assembly Language
Assembly IA-32.
ADDRESSING MODES.
Intel 8088 (8086) Microprocessor Structure
Assembly Lang. – Intel 8086 Addressing modes – 1
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
Introduction to Assembly Language
BIC 10503: COMPUTER ARCHITECTURE
Data Addressing Modes • MOV AX,BX; This instruction transfers the word contents of the source-register(BX) into the destination register(AX). • The source.
שפת סף וארכיטקטורה של מעבד 8086
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
(Array and Addressing Modes)
Symbolic Instruction and Addressing
(Array and Addressing Modes)
CNET 315 Microprocessor & Assembly Language
Unit-I 80386DX Architecture
Assembler Directives end label end of program, label is entry point
Chapter 6 –Symbolic Instruction and Addressing
(Array and Addressing Modes)
Presentation transcript:

1/2002JNM1 Positional Notation (Hex Digits)

1/2002JNM2 Problem The 8086 has a 20-bit address bus. Therefore, it can access 1,048,576 bytes of memory. How many bits and how many HEX digits are required to access 1M memory? 2 N = 1M (where N is in bits) N = 20 bits =  20/4 = 5 HEX digits

1/2002JNM3 Memory Map for an 80x86 computer running MS-DOS

1/2002JNM4 The memory space of the 8086 consists of 1,048,576 bytes or 524, bit words. 1 MB Memory Space of 8086

1/2002JNM5 Within the 1 MB of memory, the 8086 defines 4 64KB memory blocks. Segmented Memory 7FFFF The segment registers point to location 0 of each segment. (The base address) DS: E000 CS: B300 SS: 7000 ES: 5D27

1/2002JNM6 Assembly Language Statements Instructions - Executable Statements Directives – provide information to assembler about how to generate executable code Format - [name] [mnemonic] [operands] [;comment]

1/2002JNM7 Names Max 247 characters (MASM) No distinction between uppercase, lowercase letters. First character can be a letter, ‘_’, ‘$’ Cannot use an assembler reserved word. Identify labels, variables, symbols, keywords

1/2002JNM8 OP Codes and Operands Op-code destination operand, source operand HLT; zero operands INC AX; one operand MOV AX, 100; two operands SHLD DX, AX, 4; three operands

1/2002JNM9 AL 00 Immediate Addressing Mode Mov AL, 3CH AL 3C

1/2002JNM10 Register Addressing Mode Mov AL, BL AL 00 BL4D AL4D BL4D

1/2002JNM11 Direct Addressing Mode Mov CL, [0020H] Mov CX, [0020H] Memory (data) Little Endian Format – The “little” end of the number is stored first. CL 78 CX 5678 Mov ECX, [0020H] ECX

1/2002JNM12 Register Indirect Addressing Mode Mov CL, [SI] In the 8086, only BX, BP, SI and DI may be used as memory pointers. Later processors don’t have this restriction. Mov SI, 0022H CL 34 SI 0022

1/2002JNM13 BX 0020 Base + Displacement Mov AL, [BX +2] Useful when accessing individual elements in an array. Note that the array begins with element 0, element 2 corresponds to the third location in the array. The displacement corresponds to byte offset from the base, not element number in the array. Mov BX, 0020H AL 34

1/2002JNM14 BX 0020 Base + Index + Displacement (Useful when accessing individual elements in an record) Mov BX, 0020H ;BX points to record starting address SI 000C Mov SI, 000CH ;SI points to record three (4 elements ;per record x 3 records = 000C) Mov AL, [BX+SI+1] ;AL now has the data in element 1 of ;record #3 (assumes elements are 1 byte)

1/2002JNM15 Base + Displacement –Mov AL, [BX + 4] Base + Index + Displacement –Mov AL, [BX+SI+3] Base + Index*Scale + Displacement –Mov AL,[BX+SI*4+3] Immediate –Mov AL, 4CH Register –Mov AL, BL Direct –Mov AL, [20H] Register Indirect –Mov AL, [SI] Instruction Addressing Modes

1/2002JNM16 Segment Register Defaults

1/2002JNM17 Standard Assembler Directives

1/2002JNM18 Data Allocation Directives Char1 db ‘A’hex db 41h Signed1 db -128dec db 65 Signed2 db +127bin db b Unsigned db 255hex2 db 0A3h

1/2002JNM19 Lists and Strings List1 db 10, ‘A’, 41h, 0Ah, b, 101q Listptr db List1 Cstring db “This is a string”,0 Clength = ($ - Cstring); sets Clength to length of Cstring db 20 dup(0); 20 bytes, all equal to zero db 4 dup(“ABC”); 12 bytes, “ABCABCABCABC”

1/2002JNM20 Ptr Operator Ptr Operator - For some instructions, the size of the operand is not clear (INC [20H]). INC Byte Ptr [0020]INC Word Ptr [0020]

1/2002JNM21 Direct Addressing Direct-Offset Addressing Offset operator – returns the 16-bit address of the variable. Good for strings and arrays..data Bytelist db 35h, 63h, 79h Wordlist dw 1234h, 5678h.code … Moval, Bytelist; al = 35 Moval, Bytelist+1; al = 63 Movbx, Wordlist; bx = 1234 Movbx, Wordlist+2; bx = 5678

1/2002JNM22 Direct-Offset Addressing with Strings.data aString db “ASTRING”.code … Moval, aString; al = 41 Moval, aString+1; al = 53 Moval, aString+2; al = 54 Moval, aString+3; al = 52

1/2002JNM Flags - Bit Positions and Names

1/2002JNM24

1/2002JNM25 Interrupt Functions (Listed in Appendix G of Irvine Book) INT 10h – (Video Bios) INT 16h – (Keyboard) INT 33h – (Mouse) INT 20 – terminate COM program (use INT 21,4C instead) INT 21h – DOS Functions (AH holds function number) 1 – Keyboard input (char; store in AL ) 2 – Display char (DL holds char) 3 – print char (DL holds char) 9 – print string (DX points to string) 4Ch – terminate process