Chapter 3 Programming The 8086 In Assembly Language PDF

Summary

This document provides an overview of assembly language programming, focusing on the 8086 processor. It covers various aspects including addressing modes and the instruction set. The document also describes different levels of programming languages.

Full Transcript

Chapter 3 Programming The 8086 In Assembly Language Outline ❖ The Microcomputer (programmers View) ❖ Basics of programming ❖ 8086 Addressing Modes ❖ 8086 Instruction Set Overview Programmer’s View Control & status Addre...

Chapter 3 Programming The 8086 In Assembly Language Outline ❖ The Microcomputer (programmers View) ❖ Basics of programming ❖ 8086 Addressing Modes ❖ 8086 Instruction Set Overview Programmer’s View Control & status Address Memory Microprocessor - RAM SRAM DRAM Bus - ROM Data PROM Interface EPROM Address/data logic EEPROM Serial Parallel Keypad Display HDD Port port … I/O Devices 2 B as ics There are three language levels that can be used to write a program for a microcomputer. 1. Machine Language This are the binary codes for the instructions you want the microcomputer to execute. It is hard or impossible for a programmer to write code in machine language, b/c it requires memorizing all the instructions in binary form and sooner the program will get out of control! 4 B as ics … c n td 2. Assembly Language Assembly language uses two, three, or four letter mnemonics to represent each instruction type. The letters in an assembly language mnemonic are usually initials or a short form of the English word(s) for the operation performed by the instruction. e.g., the mnemonic for subtract is SUB, XOR for Exclusive OR , etc. Assembly language program has to be translated to machine language so that it can be loaded into memory and run – This is done by the assembler 5 B as ics … c n td 3. High Level Languages Theselanguages use program statements which are even more English-like than those of assembly language. e.g. BASIC, C, C++, Java,... Each high-level statement may represent many machine code instructions. An interpreter (compiler) program is used to translate higher-level language statements to machine codes, which can be loaded into memory and executed. 6 B as ics … c n td To run a program, a microcomputer must have the program stored in binary form in successive memory locations. This binary data is an encoded form of the instruction mnemonics in the user’s code. The assembler is responsible to convert the mnemonics into binary form. A decoder in the CPU interprets the binary instruction and passes control to the execution process. 7 A ddres s ing M odes The addressing modes describe the types of operands and the way they are accessed for executing an instruction. The addressing mode depends upon the operands and suggests how the effective address may be computed for locating the operand, if it lies in memory. 8 Addressing M o d e s … c ntd According to the flow of instruction execution, the instructions may be categorized as: I. Sequential control flow instructions and II.Control transfer instructions. Sequential control flow instructions are the instructions, which after execution, transfer control to the next instruction appearing immediately after it in the sequence of the program. 9 Addressing M o d e s … c n t d For example: Arithmetic, logical, data transfer and processor control instructions are sequential control flow instructions. The control transfer instructions, on the other hand, transfer control to some predefined address or the address somehow specified in the instruction, For example: INT, CALL, RET and JUMP instructions fall under this category. 10 Addressing M o d e s … c ntd The following eight addressing modes are for sequential control transfer instructions: 1. Immediate immediate data is a part of instruction, and appears in the form of successive byte or bytes. e.g. MOV AX, 0005H MOV DS, 2030H ? Here, 0005H is the immediate data. The immediate data may be 8-bit or 16-bit in size. 11 Addressing M o d e s … c ntd 2. Direct In the direct addressing mode, a 16-bit memory address (offset) is directly specified in the instruction as a part of it. e.g. MOV AX, [5000H] Here, data resides in a memory location in the data segment, whose effective address may be computed using 5000H as the offset address and content of DS as segment address. (The effective address, here, is (DS

Use Quizgecko on...
Browser
Browser