An 8-Bit Scientific Calculator Based Intel 8086 Virtual Machine Emulator

Similar documents
Code segment Stack segment

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

8086 INTERNAL ARCHITECTURE

Intel 8086 MICROPROCESSOR ARCHITECTURE

Intel 8086 MICROPROCESSOR. By Y V S Murthy

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Hardware Design and Software Simulation for Four Classical Cryptosystems

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

icroprocessor istory of Microprocessor ntel 8086:

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

Introduction to Microprocessor

ADVANCE MICROPROCESSOR & INTERFACING

UNIT 2 PROCESSORS ORGANIZATION CONT.

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

9/25/ Software & Hardware Architecture

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

EC-333 Microprocessor and Interfacing Techniques

CC411: Introduction To Microprocessors

Internal architecture of 8086

Introduction to IA-32. Jo, Heeseung

INTRODUCTION TO IA-32. Jo, Heeseung

Intel 8086: Instruction Set

Moodle WILLINGDON COLLEGE SANGLI (B. SC.-II) Digital Electronics

Basic Execution Environment

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

Chapter 2 COMPUTER SYSTEM HARDWARE

Faculty of Engineering Computer Engineering Department Islamic University of Gaza Assembly Language Lab # 2 Assembly Language Fundamentals

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)


Complex Instruction Set Computer (CISC)

The x86 Architecture

UNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors

INTRODUCTION TO MICROPROCESSORS

Arithmetic Instructions

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

Addressing Modes on the x86

Signed number Arithmetic. Negative number is represented as

Marking Scheme. Examination Paper. Module: Microprocessors (630313)

Assembler Programming. Lecture 2

PESIT Bangalore South Campus

1. Introduction to Assembly Language

Hardware and Software Architecture. Chapter 2

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

16-Bit Intel Processor Architecture

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H.

ELE 3230 Microprocessors and Computer Systems

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

US06CCSC04: Introduction to Microprocessors and Assembly Language UNIT 1: Assembly Language Terms & Directives

CS401 Assembly Language Solved MCQS From Midterm Papers

The Microprocessor and its Architecture

Module 3 Instruction Set Architecture (ISA)

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

8086 Microprocessors & Peripherals

UNIT-I. 1.Draw and explain the Architecture of a 8085 Microprocessor?

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

Computer Architecture 1 ح 303

EEM336 Microprocessors I. The Microprocessor and Its Architecture

WINTER 12 EXAMINATION Subject Code : Model Answer Page No : / N. a) Describe the function of SID and SOD pins of 8085 microprocessor

EC 333 Microprocessor and Interfacing Techniques (3+1)

Summer 2003 Lecture 4 06/14/03

CS 16: Assembly Language Programming for the IBM PC and Compatibles

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Northern India Engineering College, Delhi (GGSIP University) PAPER I

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

Basic Assembly SYSC-3006

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017

Mr. Sapan Naik 1. Babu Madhav Institute of Information Technology, UTU

Unit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India.

Machine-level Representation of Programs. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter Four Instructions Set

Architecture of 8086 Microprocessor

Ex: Write a piece of code that transfers a block of 256 bytes stored at locations starting at 34000H to locations starting at 36000H. Ans.

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1

MICROPROCESSOR MICROPROCESSOR ARCHITECTURE. Prof. P. C. Patil UOP S.E.COMP (SEM-II)

INDEX. 1 Study of intel 8085 micropeocessor kit. 2 Program to find addition of two 8 bit no. 3 Program to find subtraction of two 8 bit no.

if 2 16bit operands multiplied the result will be

CMSC Lecture 03. UMBC, CMSC313, Richard Chang

Assembly Language Programming of 8085

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMMUNICATION ENGINEERING REG 2008 TWO MARKS QUESTION AND ANSWERS

Logic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A

SHEET-2 ANSWERS. [1] Rewrite Program 2-3 to transfer one word at a time instead of one byte.

Chapter Three Addressing Mode MOV AX, BX

Description of the Simulator

Section 001. Read this before starting!

8086 Programming. Multiplication Instructions. Multiplication can be performed on signed and unsigned numbers.

8088/8086 Programming Integer Instructions and Computations

Topic 2 :16 Bit Microprocessor: 8086 (24 Marks)

Microprocessor (COM 9323)

Real instruction set architectures. Part 2: a representative sample

Philadelphia University Student Name: Student Number:

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2

Lesson 1. Fundamentals of assembly language

1-Operand instruction types 1 INC/ DEC/ NOT/NEG R/M. 2 PUSH/ POP R16/M16/SR/F 2 x ( ) = 74 opcodes 3 MUL/ IMUL/ DIV/ DIV R/M

Transcription:

Available online at www.sciencedirect.com ScienceDirect Procedia Computer Science 21 (2013 ) 506 511 The 4th International Conference on Emerging Ubiquitous Systems and Pervasive Networks (EUSPN-2013) Abstract An 8-Bit Scientific Calculator Based Intel 8086 Virtual Machine Emulator Qasem Abu Al-Haija*, Saleh Al-Abdulatif and Mohaned Al-Ghofaily King Faisal University, Department of Electrical Engineering, Al-Ahsa 31982, P.O. Box 380 Microprocessors and their applications course is considered as a significant core course for electrical engineering students due to its potential impact into several real life applications such as complex calculations, interfacing, control and automation technology. In this paper, we propose an eight bit scientific calculator based Intel 8086 assembly language programming. The calculator were designed over the virtual machine for Intel 8086 microprocessor using EMU8086 emulator software. Several arithmetic and logic operations as well as trigonometric functions were implemented in this paper. Also, a plot function and integration of function tools are to be implemented and added as a separate modules for this design. This work was very beneficial in enhancing the student' skills in mathematics, engineering and computer programming which can be employed in designing a useful applications for users as well as the ability to apply numerical techniques and programming algorithms to design a small microprocessor-based system. 2013 The Authors. Published by Elsevier B.V. Open access under CC BY-NC-ND license. 2011 Published by Elsevier Ltd. Selection and/or peer-review under responsibility of [name organizer] Selection and peer-review under responsibility of Elhadi M. Shakshuki Keywords: Intel 8086; EMU8086; Virtual Machine; Assembly Language; Scientific Calculator. 1. Introduction In the late of 1978, Intel introduced the 8086 microprocessor as an enhanced product version of previous 8085 microprocessor. The product implementation depended on semiconductor process innovation, improved architecture, better circuit design, and more sophisticated software, yet upward compatibility not envisioned by the first designers was maintained [5]. Intel 8086 Microprocessor was designed to provide an order of magnitude increase in processing throughput over the older 808x. The processor was to be assembly-language-level-compatible with the 8080 so that existing 8080 software could be reassembled and correctly executed on the 8086 [1]. The 8086 processor architecture is described in terms of its memory structure, register structure, instruction * Corresponding author, Lecturer, ECE Department, KFU. Tel.: +966-3-5895400; fax: +966-3-5871068. E-mail address: qalhaija@kfu.edu.sa. 1877-0509 2013 The Authors. Published by Elsevier B.V. Open access under CC BY-NC-ND license. Selection and peer-review under responsibility of Elhadi M. Shakshuki doi:10.1016/j.procs.2013.09.070

Qasem Abu Al-Haija et al. / Procedia Computer Science 21 ( 2013 ) 506 511 507 set, and external interface. Intel 8086 is a 16-bit microprocessor with 16-bit Data bus/alu, 20-bit address bus and Maximum clock frequency is 5 MHz [4]. Intel 8086 support up to 1MB of main memory divided into 16 segments with 64KB size each. Intel 8086 contains 14 registers (16-bit) grouped in three main files of registers (Four 16-bit general registers, two 16-bit pointer and two 16-bit index registers, and four 16-bit segment registers) in addition to the status register and instruction pointer. The registers are shown in table 1. Also, Nine flags record the processor state and control its operation: The status register (flag register) [1, 4] is a 16-bit register, 9 out of these 16 bits are active and indicate the current state of the processor. These bits include: Carry flag (CF), Parity flag (PF), Auxiliary flag (AF), Zero flag (ZF), Sign flag (SF), Trap flag (TF), Interrupt flag (IF), Direction flag (DF) and Overflow flag (OF). Table 1. Intel 8086 Registers AH AL AX (primary accumulator) General Purpose BH BL BX (base, accumulator) Registers CH CL CX (counter, accumulator) DH DL DX (accumulator, other functions) SI Source Index Index and base DI Destination Index registers BP Base Pointer SP Stack Pointer Status register 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 (bit position) - - - - O D I T S Z - A - P - C Flags CS Code Segment Segment register DS Data Segment ES Extra Segment SS Stack Segment Instruction pointer IP Instruction Pointer 8086 has approximately 117 different instructions [1, 3, 4] with about 300 op-codes with three instruction formats: no-operand, single-operand and two-operand instructions as well as the string instructions that involve array operations. Intel 8086 instructions classified into 8 groups: Data transfer instructions, Arithmetic instructions, Bit Manipulation instructions, String instructions, Unconditional Transfer instructions, Conditional Branch instructions, Interrupt instructions, and Processor Control instructions. Intel 8086 provides various 12 different addressing modes to access instruction operands. The operand may be contained in: register, immediate, memory or I/O ports. The addressing Modes are classified into 5 groups: Register and immediate modes (two modes), Memory addressing modes (six modes), Port addressing mode (two modes), Relative addressing mode (one mode) and Implied addressing mode (one mode). The full details about Intel 8086 can be retrieved from [1,3, 4]. In this paper, we are going to utilize the capabilities of 8086, instructions, registers and memory to perform the several operations in the design of an 8-bit scientific calculator. 2. Design Specifications and Modeling In this paper, we are going to design a program that simulates the operation of an 8-bit calculator system according to the following specifications and assumptions. Figure 1 shows the four basic modules of the calculator system.

508 Qasem Abu Al-Haija et al. / Procedia Computer Science 21 ( 2013 ) 506 511 The calculator should perform the following unsigned arithmetic operations: addition (+), subtraction (-), Multiplication (*), division (/), and Power (X^Y). The calculator should perform the following Bitwise Logical operations: ANDing (&), ORing ( ), XORing ( ), complementing. The calculator should perform the following Trigonometric functions: Sin (x), Cos (x), Tan (x). The calculator takes two 8 bit -operands only. The user can select one of these operations from a list of items (numbered from 1-11). The program should run in the video mode ( the black screen DOS Screen). The operands have a maximum size of 3-digits 0-999). All operands are entered in decimal form. The calculator will Extra two tools are in-process : Function Integration and Function Plot tools. Figure 1: Calculator System Specifications. The paper aims to design the program, implement and test it using the EMU-8086 Emulator available in the lab. The following steps should be considered while designing this paper: Design a Flow Chart Diagram for the calculator system. Design the program in Assembly language. The program should be Assembled, Emulated and Run successfully on Emu_8086 emulator. The program should call a subroutine for each operation. The paper to be designed required the students to have full understanding for the following programming skills: Working and understanding Emu_8086 emulator software. Running/debugging ALPs and tracing/analysing 8086 registers, memory, ALU and stack. Understanding Bit and Arithmetic manipulation using 8086 Intel MP. Using and verifying addressing modes for 8086 Intel Microprocessor. Memory & Stack access operations for 8086 Intel Microprocessor. Understanding String Operations using 8086 Intel MP. Conditional and Unconditional Branches. Working with subroutines, Loops and Interrupts. Ability to design and debug a small microprocessor-based system. Understanding the numerical methods and techniques for function integrals and trigonometric functions. The problem addressed in this paper were divided into several modules, some of these modules are shown in flowchart, figure 2. Each module will be designed as a separate subroutine where the complete calculator system will has separate subroutine for each single operation (arithmetic, logic and others) and subroutine for inputting the data as well as for outputting the data.

Qasem Abu Al-Haija et al. / Procedia Computer Science 21 ( 2013 ) 506 511 509 Figure 2: System Flowchart for the first eight operations The aforementioned flowchart along with the system specifications are considered as the core of the system design for this paper. 3. Simulation Environment and Sample of Results The proposed work is to design an 8-bit scientific calculator which includes: Arithmetic Operations, Logical operations, Trigonometric functions and some other advanced tools such function plot for low order polynomials and function integrals. The proposed solution is programmed and implemented in Assembly language programming for 8086 microprocessor using EMU8086 emulator. Emu8086 [2, 4] is a Microprocessor Emulator with integrated 8086 Assembler and Free Tutorial. Emulator runs programs on a Virtual Machine, it emulates real hardware, such as screen, memory and input/output devices. EMU8086 is considered the right software tool to help in fully understand microprocessors and assembly language. The source code is assembled and executed on emulator step by step. It offers a GUI to control registers, flags and memory while the program is running. Emu8086 pack combines an advanced source editor with automatic syntax-highlight, assembler, dis-assembler, software emulator (Virtual PC) with debugger, and step by step tutorials. Emu8086 is complete 'all in one' solution for coding in Assembly Language. Emulator runs programs on a Virtual PC, this completely blocks the emulated programs from accessing real hardware, such as hard-drives and memory, since the assembly code runs on a virtual machine, this makes debugging much easier. This work is still under construction, we have done the from the arithmetic and logical parts while other options of the design will be developed and finished in the near future. Simulation run samples are shown in the figure 3 and 4 below.

510 Qasem Abu Al-Haija et al. / Procedia Computer Science 21 ( 2013 ) 506 511 Figure 3: Main Interface and Menu Figure 4: Example of Multiplication Operation 4. CONCLUSTIONS AND RECOMMENDATIONS A small microprocessor based system were discussed and designed using the Assembly language programming and EMU8086 virtual machine emulator. The paper will enhance the student ability in applying knowledge of mathematics, engineering and computer programming which can be employed in designing a useful applications for users as well as the ability to apply numerical techniques and arithmetic algorithms to design a small microprocessor-based system. The work in this paper can be improved by several ways such as: implementing more the integration of the functions and add the function plot tool which are under-consideration and extending the capabilities of the calculator to allow a 16-bit calculations as well as add more arithmetic operations such as root square roots, logarithmic functions, other logic functions (XNOR, NOR, NAND), Factorial (X!), Inverse (1/X), Modulus, power of 10 (10 X ), and exponential (e X ). Acknowledgements Authors appreciate the publication support of College of Engineering at King Faisal University KFU-AL-AHSA.

Qasem Abu Al-Haija et al. / Procedia Computer Science 21 ( 2013 ) 506 511 511 References [1] M. Rafiquzzaman, "Fundemetals of Digital Logic and Microcomputer Design (5th Ed.)". John Wiley & Sons, Inc, 2005. [2] EMU 8086 software Website, Retrieved from http://ceng.gazi.edu.tr/~akcayol/files/emu8086.pdf/ [3] S.Morse, B. Ravenel, S. Mazor and W.Pohlman, " Intel Microprocessors: 8008 to 8086", IEEE Computer, Vol 13, No. 10, pages 42-60, October 1980. [4] Q. Abu Al-Haija, "Lecture notes and experiments sheets for Microprocessors and Numerical Methods for Engineers", Electrical Engineering Department, College of Engineering, King Faisal University, 2012.