The document contains several assembly language programs for the 8085 microprocessor. The programs include:
1) A program to generate Fibonacci numbers that uses counters and registers to add and store successive numbers.
2) A program to generate a 0.4 second delay using an operating frequency of 2.5MHz and calculating the required number of T-states.
3) A program to find the factorial of a number between 0-8 using registers, a subroutine, and stack pointer to recursively multiply numbers.
assembly programs of 8085 microprocessor, there are many programs related to the computer architecture that will helpful for the programming in the assembly language. like addition of two 8bit number , subtraction, multiplication, division and table for 8085, array,etc ....
Also written all the procedure to write the programs in practical notebook for the practical exams in the colleges or universities.
This document contains a manual for microprocessor lab programs. It lists 30 programs with descriptions and algorithms for tasks like data transfer, sorting, arithmetic operations, conversions, and interfacing. The manual provides a template for writing assembly language programs (ALPs) to perform these tasks on the 8085 microprocessor, including initializing registers, looping structures, logic checks, and displaying results. It also includes sample result sheets showing address-data fields and I/O for several programs.
Programming with 8085-Microprocessor and interfacingAmitabh Shukla
Here are the key steps to separate the digits of a hexadecimal number and store them in two locations:
1. Load the packed BCD number into the accumulator register using LDA instruction
2. Mask the lower nibble using ANI instruction with F0H to isolate the lower digit
3. Rotate the accumulator right through carry three times using RRC instruction to shift the higher digit into the lower position
4. Store the lower and higher digits into two separate memory locations
This separates the digits of the hexadecimal number by isolating and adjusting the position of each digit, allowing them to be stored independently.
The document contains a lab manual for microprocessor and microcontroller programs using the 8085 instruction set. It includes programs for addition, subtraction, multiplication, and division of 8-bit numbers. It also includes programs to find the largest and smallest number in an array, and programs to sort an array in ascending and descending order. Further programs demonstrate conversion between BCD and hexadecimal numbers. Algorithms and assembly code are provided for each program along with input/output observations and results.
This document describes various arithmetic and logical instructions that can be performed on the 8086 microprocessor. It provides the opcode, operand, and description for instructions such as addition, subtraction, increment, decrement, AND, OR, XOR, rotate, compare, and complement. Examples are given for each instruction type. The document is intended to provide guidance on these fundamental instruction types under the supervision of a listed professor and includes names of students.
Register Organisation of 8086 MicroprocessorNikhil Kumar
The document summarizes the register organization of the 8086 microprocessor. It discusses that the 8086 has 16-bit registers that can be used as either 8-bit or 16-bit. The registers are categorized into general purpose, segment, index, status and control flag, and pointer registers. The general purpose registers include AX, BX, CX, and DX that can be used for data manipulation. The segment registers point to different memory segments. The index registers include SI and DI that are used for addressing data. The flag register contains status flags for results and control flags for CPU operation.
This document provides an overview of assembly language programming for the 8085 microprocessor. It discusses the 8085 programming model including registers, flags, and addressing modes. The document also covers the instruction set categories such as data transfer, arithmetic, logical and branching instructions. Examples are given to demonstrate how to write an assembly language program for the 8085 including analyzing a problem, developing an algorithm, flowchart, and coding the solution. Input/output and memory addressing modes are also explained.
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
The document provides information about the 8085 microprocessor. It describes the 8085 as an 8-bit microprocessor capable of addressing 64KB of memory. It then details the various functional blocks of the 8085 including general purpose registers, accumulator, program counter, stack pointer, ALU, flags register, timing and control unit, and instruction register and decoder. Finally, it provides examples of assembly language programs for 8-bit addition, subtraction, and 16-bit addition and subtraction on the 8085 microprocessor.
assembly programs of 8085 microprocessor, there are many programs related to the computer architecture that will helpful for the programming in the assembly language. like addition of two 8bit number , subtraction, multiplication, division and table for 8085, array,etc ....
Also written all the procedure to write the programs in practical notebook for the practical exams in the colleges or universities.
This document contains a manual for microprocessor lab programs. It lists 30 programs with descriptions and algorithms for tasks like data transfer, sorting, arithmetic operations, conversions, and interfacing. The manual provides a template for writing assembly language programs (ALPs) to perform these tasks on the 8085 microprocessor, including initializing registers, looping structures, logic checks, and displaying results. It also includes sample result sheets showing address-data fields and I/O for several programs.
Programming with 8085-Microprocessor and interfacingAmitabh Shukla
Here are the key steps to separate the digits of a hexadecimal number and store them in two locations:
1. Load the packed BCD number into the accumulator register using LDA instruction
2. Mask the lower nibble using ANI instruction with F0H to isolate the lower digit
3. Rotate the accumulator right through carry three times using RRC instruction to shift the higher digit into the lower position
4. Store the lower and higher digits into two separate memory locations
This separates the digits of the hexadecimal number by isolating and adjusting the position of each digit, allowing them to be stored independently.
The document contains a lab manual for microprocessor and microcontroller programs using the 8085 instruction set. It includes programs for addition, subtraction, multiplication, and division of 8-bit numbers. It also includes programs to find the largest and smallest number in an array, and programs to sort an array in ascending and descending order. Further programs demonstrate conversion between BCD and hexadecimal numbers. Algorithms and assembly code are provided for each program along with input/output observations and results.
This document describes various arithmetic and logical instructions that can be performed on the 8086 microprocessor. It provides the opcode, operand, and description for instructions such as addition, subtraction, increment, decrement, AND, OR, XOR, rotate, compare, and complement. Examples are given for each instruction type. The document is intended to provide guidance on these fundamental instruction types under the supervision of a listed professor and includes names of students.
Register Organisation of 8086 MicroprocessorNikhil Kumar
The document summarizes the register organization of the 8086 microprocessor. It discusses that the 8086 has 16-bit registers that can be used as either 8-bit or 16-bit. The registers are categorized into general purpose, segment, index, status and control flag, and pointer registers. The general purpose registers include AX, BX, CX, and DX that can be used for data manipulation. The segment registers point to different memory segments. The index registers include SI and DI that are used for addressing data. The flag register contains status flags for results and control flags for CPU operation.
This document provides an overview of assembly language programming for the 8085 microprocessor. It discusses the 8085 programming model including registers, flags, and addressing modes. The document also covers the instruction set categories such as data transfer, arithmetic, logical and branching instructions. Examples are given to demonstrate how to write an assembly language program for the 8085 including analyzing a problem, developing an algorithm, flowchart, and coding the solution. Input/output and memory addressing modes are also explained.
Introduction to 8085 & it's description(includes basic lab experiments)Basil John
The document provides information about the 8085 microprocessor. It describes the 8085 as an 8-bit microprocessor capable of addressing 64KB of memory. It then details the various functional blocks of the 8085 including general purpose registers, accumulator, program counter, stack pointer, ALU, flags register, timing and control unit, and instruction register and decoder. Finally, it provides examples of assembly language programs for 8-bit addition, subtraction, and 16-bit addition and subtraction on the 8085 microprocessor.
The document describes five experiments performed using an 8085 microprocessor kit to understand various arithmetic operations. Experiment 1 adds two 8-bit numbers and stores the 8-bit sum. Experiment 2 adds two 8-bit numbers and stores the 16-bit sum. Experiment 3 adds two 16-bit numbers and stores the 16-bit sum. Experiment 4 performs decimal addition of two 8-bit numbers and stores the 8-bit sum. Experiment 5 finds the one's complement of an 8-bit number.
The document discusses Microprocessor and its Applications. It contains 28 questions related to microprocessors, their basic units, addressing modes, interrupts, assembly language instructions, and more. Specifically, it discusses the 8085 and 8051 microcontrollers, explaining concepts like multiplexing, flags, machine cycles, timing diagrams, and memory mapping.
The document discusses assembly language programming concepts including shift, rotate, flag control, compare, and jump instructions. It provides examples and problems to explain the usage and effects of various instructions. Key points include:
- Shift instructions move bits within a register or memory location based on a count. Common instructions are SHR, SAR, SHL, ROL, ROR.
- Flag control instructions modify status flags. Common ones are LAHF, SAHF, CLC, STC.
- Compare instruction CMP performs subtraction without affecting operands and updates flags.
- Jump instructions conditionally transfer control based on status flag values like JO, JB, JE, JL.
Pro
This document discusses arithmetic operations and conversions using the 8085 microprocessor. It includes algorithms and programs for 8-bit addition, subtraction, multiplication, and division. It also covers sorting algorithms to find the ascending and descending order of numbers, and algorithms to find the minimum and maximum numbers in a data set. Additionally, it explains programs that demonstrate the rotate instructions RLC, RRC, RAL, and RAR. Finally, it provides examples of conversions between ASCII, hexadecimal, and BCD codes.
The 80486 microprocessor features an integrated math coprocessor that is 3 times faster than the 80386/387 combination. It has an 8KB internal code and data cache and uses a 168-pin PGA package. New signals support burst mode memory access and bus sharing. The 80486 includes parity checking/generation and additional page table entry bits control internal caching.
8259 Programmable Interrupt Controller by vijayVijay Kumar
The 8259A Programmable Interrupt Controller (PIC) is used to simplify the interrupt interface of 8088/8086 microprocessor systems. It can accept up to 8 interrupt requests and expand to 64 requests by cascading additional PICs. The PIC is programmable through initialization command words to configure operating modes and interrupt vector assignments. It also has operation command words to control interrupt masking, priorities, and acknowledgement.
This presentation discusses logic and shift/rotate instructions in assembly language. It defines logic instructions like AND, OR, XOR and NOT and shows their truth tables. It explains how to use masks with these instructions to modify selective bits. It also covers shift/rotate instructions like SHL, SHR, ROL and ROR and how they manipulate bits by shifting them left or right in different ways. Examples are given to demonstrate how to use these instructions to clear, set or toggle bits using masks, as well as how shift/rotate instructions modify registers and flags.
The document discusses memory organization and hierarchy. It describes how main memory directly communicates with the CPU while auxiliary memory provides backup storage. It also outlines different memory mapping techniques like direct mapping and set-associative mapping used for cache memory. Virtual memory allows programs to be larger than physical memory by swapping blocks between main and auxiliary storage.
This document provides information on 8088 microprocessor instruction set. It discusses:
1) The basic components of a program including instructions and machine code.
2) Examples of instruction formats and operations for data transfer, arithmetic, logical, and shift instructions.
3) Details on multiplication and division instructions including examples of multiplying and dividing operations.
4) Key benefits of assembly language such as taking up less memory and executing faster than high-level languages.
The 80386 microprocessor had two main versions - the 80386DX with a 32-bit address and data bus, and the 80386SX with a 24-bit address bus and 16-bit data bus. The 80386SX was developed later for applications that did not require the full 32-bit capabilities of the 80386DX. The 80386 supported protected mode which enabled virtual memory, paging, and memory protection in addition to the capabilities of the 80286. It had enhanced registers, addressing modes, and memory management compared to earlier Intel processors.
Logical instruction of 8085
Instruction Set of 8085
Classification of Instruction Set
Logical Instructions
AND, OR, XOR
Logical Instructions
Summary Logical Group
The document is a lab report that discusses data transfer instructions in assembly language using the Emu8086 emulator. It includes two tasks - the first sends values to registers, pushes them to the stack, exchanges parts of registers, and pops the values back; the second performs similar operations with more registers. The results are analyzed and shown in tables. The document demonstrates using data instructions in an emulator to transfer values between registers and memory.
The document provides an overview of assembly language programming for the 8085 microprocessor. It discusses the 8085 programming model including registers, flags, and addressing modes. It also describes the instruction set categories and provides examples of common instruction types like data transfer, arithmetic, logical, and branching instructions. Sample assembly language programs are shown to add two numbers and handle results larger than 8 bits.
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
The document discusses various arithmetic operations that can be performed by the 8085 microprocessor such as addition, subtraction, incrementing and decrementing. It provides details on the mnemonics used to perform each operation and how operands are added or subtracted from the accumulator register. Instructions like ADD, SUB, INR and DCR are used to perform basic arithmetic on registers or memory locations, while ADI, SUI allow operating with immediate data. ADC, SBB consider the carry flag, and DAD performs 16-bit addition of register pairs.
The Amazing Ways Retail Giant Zalando Is Using Artificial IntelligenceBernard Marr
Zalando is a leading online fashion retailer in Europe that uses artificial intelligence and machine learning in several ways. It has developed an Algorithmic Fashion Companion that provides outfit recommendations to customers based on their purchase history and interests. Zalando also uses machine learning to better understand customers and provide personalized recommendations. It has refined deep learning algorithms for visual search to allow customers to find fashion items by image. While some human jobs have been impacted by AI, Zalando remains a leader in using artificial intelligence to enhance the customer experience and business operations.
The document discusses timer modules and pulse width modulation (PWM) on Atmega microcontrollers. It describes the different timer modules, including an 8-bit and 16-bit timer/counter with options like prescaling and compare/capture modes. It explains timer overflow, compare match, and input capture events. It then provides details on timer/counter 0, including its registers and modes like CTC PWM and fast PWM for generating PWM signals on an output pin.
The document provides information about the Motorola 68020 microprocessor. It discusses the history and development of the 68020, which was Motorola's first 32-bit implementation of the M68000 family. Key details about the 68020's architecture, instruction set, registers, performance improvements over earlier chips, and technical specifications are summarized. Literature on the 68020 is also reviewed briefly.
The document describes the instruction set of the 8086 microprocessor. It discusses 6 types of instructions supported: 1) data transfer instructions, 2) arithmetic instructions, 3) logical instructions, 4) string manipulation instructions, 5) process control instructions, and 6) control transfer instructions. Details are provided on the various instructions under each type, including their mnemonics and functions.
This document discusses the basics of microprocessors and the 8085 microprocessor. It begins with definitions of a microprocessor and its basic units. It then discusses multiplexing and how the 8085 demultiplexes address and data lines. It explains the functions of the IO/M, READY, HOLD and HLDA signals in the 8085. It defines flags and lists the flags in the 8085. It also defines terms like mnemonics, machine cycles, instruction cycles, fetch and execute cycles. It lists the machine cycles of the 8085 and explains the need for timing diagrams. It defines terms like T-state, opcode and operand. It discusses addressing modes in the 8085. It compares memory mapped I/
The document describes several programs written for microcontrollers to perform various tasks:
1) A program to convert packed BCD to ASCII and store the results in registers.
2) A program to display the text "SGBAU ME 1st" on an LCD screen using a microcontroller.
3) A program to multiplex the numbers 1, 2, 2, 4 on a four digit seven segment display using a microcontroller.
4) A program in GNUSim 8085 that performs all basic arithmetic operations like addition, subtraction, multiplication, and division on 8-bit numbers by loading values from memory locations and storing results back to memory locations.
5) A program to exchange
This document contains descriptions of various assembly language programs that can be written for the 8085 microprocessor. It provides examples of programs to add two numbers, multiply numbers with and without carry, divide 8-bit numbers, sort numbers in ascending and descending order, and find the largest and smallest number. The document is intended to teach programming in assembly language for the 8085 microprocessor.
The document describes five experiments performed using an 8085 microprocessor kit to understand various arithmetic operations. Experiment 1 adds two 8-bit numbers and stores the 8-bit sum. Experiment 2 adds two 8-bit numbers and stores the 16-bit sum. Experiment 3 adds two 16-bit numbers and stores the 16-bit sum. Experiment 4 performs decimal addition of two 8-bit numbers and stores the 8-bit sum. Experiment 5 finds the one's complement of an 8-bit number.
The document discusses Microprocessor and its Applications. It contains 28 questions related to microprocessors, their basic units, addressing modes, interrupts, assembly language instructions, and more. Specifically, it discusses the 8085 and 8051 microcontrollers, explaining concepts like multiplexing, flags, machine cycles, timing diagrams, and memory mapping.
The document discusses assembly language programming concepts including shift, rotate, flag control, compare, and jump instructions. It provides examples and problems to explain the usage and effects of various instructions. Key points include:
- Shift instructions move bits within a register or memory location based on a count. Common instructions are SHR, SAR, SHL, ROL, ROR.
- Flag control instructions modify status flags. Common ones are LAHF, SAHF, CLC, STC.
- Compare instruction CMP performs subtraction without affecting operands and updates flags.
- Jump instructions conditionally transfer control based on status flag values like JO, JB, JE, JL.
Pro
This document discusses arithmetic operations and conversions using the 8085 microprocessor. It includes algorithms and programs for 8-bit addition, subtraction, multiplication, and division. It also covers sorting algorithms to find the ascending and descending order of numbers, and algorithms to find the minimum and maximum numbers in a data set. Additionally, it explains programs that demonstrate the rotate instructions RLC, RRC, RAL, and RAR. Finally, it provides examples of conversions between ASCII, hexadecimal, and BCD codes.
The 80486 microprocessor features an integrated math coprocessor that is 3 times faster than the 80386/387 combination. It has an 8KB internal code and data cache and uses a 168-pin PGA package. New signals support burst mode memory access and bus sharing. The 80486 includes parity checking/generation and additional page table entry bits control internal caching.
8259 Programmable Interrupt Controller by vijayVijay Kumar
The 8259A Programmable Interrupt Controller (PIC) is used to simplify the interrupt interface of 8088/8086 microprocessor systems. It can accept up to 8 interrupt requests and expand to 64 requests by cascading additional PICs. The PIC is programmable through initialization command words to configure operating modes and interrupt vector assignments. It also has operation command words to control interrupt masking, priorities, and acknowledgement.
This presentation discusses logic and shift/rotate instructions in assembly language. It defines logic instructions like AND, OR, XOR and NOT and shows their truth tables. It explains how to use masks with these instructions to modify selective bits. It also covers shift/rotate instructions like SHL, SHR, ROL and ROR and how they manipulate bits by shifting them left or right in different ways. Examples are given to demonstrate how to use these instructions to clear, set or toggle bits using masks, as well as how shift/rotate instructions modify registers and flags.
The document discusses memory organization and hierarchy. It describes how main memory directly communicates with the CPU while auxiliary memory provides backup storage. It also outlines different memory mapping techniques like direct mapping and set-associative mapping used for cache memory. Virtual memory allows programs to be larger than physical memory by swapping blocks between main and auxiliary storage.
This document provides information on 8088 microprocessor instruction set. It discusses:
1) The basic components of a program including instructions and machine code.
2) Examples of instruction formats and operations for data transfer, arithmetic, logical, and shift instructions.
3) Details on multiplication and division instructions including examples of multiplying and dividing operations.
4) Key benefits of assembly language such as taking up less memory and executing faster than high-level languages.
The 80386 microprocessor had two main versions - the 80386DX with a 32-bit address and data bus, and the 80386SX with a 24-bit address bus and 16-bit data bus. The 80386SX was developed later for applications that did not require the full 32-bit capabilities of the 80386DX. The 80386 supported protected mode which enabled virtual memory, paging, and memory protection in addition to the capabilities of the 80286. It had enhanced registers, addressing modes, and memory management compared to earlier Intel processors.
Logical instruction of 8085
Instruction Set of 8085
Classification of Instruction Set
Logical Instructions
AND, OR, XOR
Logical Instructions
Summary Logical Group
The document is a lab report that discusses data transfer instructions in assembly language using the Emu8086 emulator. It includes two tasks - the first sends values to registers, pushes them to the stack, exchanges parts of registers, and pops the values back; the second performs similar operations with more registers. The results are analyzed and shown in tables. The document demonstrates using data instructions in an emulator to transfer values between registers and memory.
The document provides an overview of assembly language programming for the 8085 microprocessor. It discusses the 8085 programming model including registers, flags, and addressing modes. It also describes the instruction set categories and provides examples of common instruction types like data transfer, arithmetic, logical, and branching instructions. Sample assembly language programs are shown to add two numbers and handle results larger than 8 bits.
ARITHMETIC OPERATIONS IN 8085 MICROPROCESSORRamaPrabha24
The document discusses various arithmetic operations that can be performed by the 8085 microprocessor such as addition, subtraction, incrementing and decrementing. It provides details on the mnemonics used to perform each operation and how operands are added or subtracted from the accumulator register. Instructions like ADD, SUB, INR and DCR are used to perform basic arithmetic on registers or memory locations, while ADI, SUI allow operating with immediate data. ADC, SBB consider the carry flag, and DAD performs 16-bit addition of register pairs.
The Amazing Ways Retail Giant Zalando Is Using Artificial IntelligenceBernard Marr
Zalando is a leading online fashion retailer in Europe that uses artificial intelligence and machine learning in several ways. It has developed an Algorithmic Fashion Companion that provides outfit recommendations to customers based on their purchase history and interests. Zalando also uses machine learning to better understand customers and provide personalized recommendations. It has refined deep learning algorithms for visual search to allow customers to find fashion items by image. While some human jobs have been impacted by AI, Zalando remains a leader in using artificial intelligence to enhance the customer experience and business operations.
The document discusses timer modules and pulse width modulation (PWM) on Atmega microcontrollers. It describes the different timer modules, including an 8-bit and 16-bit timer/counter with options like prescaling and compare/capture modes. It explains timer overflow, compare match, and input capture events. It then provides details on timer/counter 0, including its registers and modes like CTC PWM and fast PWM for generating PWM signals on an output pin.
The document provides information about the Motorola 68020 microprocessor. It discusses the history and development of the 68020, which was Motorola's first 32-bit implementation of the M68000 family. Key details about the 68020's architecture, instruction set, registers, performance improvements over earlier chips, and technical specifications are summarized. Literature on the 68020 is also reviewed briefly.
The document describes the instruction set of the 8086 microprocessor. It discusses 6 types of instructions supported: 1) data transfer instructions, 2) arithmetic instructions, 3) logical instructions, 4) string manipulation instructions, 5) process control instructions, and 6) control transfer instructions. Details are provided on the various instructions under each type, including their mnemonics and functions.
This document discusses the basics of microprocessors and the 8085 microprocessor. It begins with definitions of a microprocessor and its basic units. It then discusses multiplexing and how the 8085 demultiplexes address and data lines. It explains the functions of the IO/M, READY, HOLD and HLDA signals in the 8085. It defines flags and lists the flags in the 8085. It also defines terms like mnemonics, machine cycles, instruction cycles, fetch and execute cycles. It lists the machine cycles of the 8085 and explains the need for timing diagrams. It defines terms like T-state, opcode and operand. It discusses addressing modes in the 8085. It compares memory mapped I/
The document describes several programs written for microcontrollers to perform various tasks:
1) A program to convert packed BCD to ASCII and store the results in registers.
2) A program to display the text "SGBAU ME 1st" on an LCD screen using a microcontroller.
3) A program to multiplex the numbers 1, 2, 2, 4 on a four digit seven segment display using a microcontroller.
4) A program in GNUSim 8085 that performs all basic arithmetic operations like addition, subtraction, multiplication, and division on 8-bit numbers by loading values from memory locations and storing results back to memory locations.
5) A program to exchange
This document contains descriptions of various assembly language programs that can be written for the 8085 microprocessor. It provides examples of programs to add two numbers, multiply numbers with and without carry, divide 8-bit numbers, sort numbers in ascending and descending order, and find the largest and smallest number. The document is intended to teach programming in assembly language for the 8085 microprocessor.
Microprocessor and Microcontroller Lab Manual!PRABHAHARAN429
The document describes experiments to be performed on an 8-bit microprocessor and microcontroller. It includes aims, block diagrams, flowcharts and assembly language programs for arithmetic operations, sorting an array, and interfacing experiments. Experiments cover topics like addition, subtraction, multiplication, division, ascending/descending order, maximum/minimum values, and interfacing components like ADCs, DACs, stepper motors. Similar experiments are outlined for an 8-bit microcontroller.
This document provides information about programming models and assembly language programming for the 8085 microprocessor. It discusses the various addressing modes, instruction set, data transfer instructions, arithmetic instructions, logical instructions, branching instructions, and stack and subroutine concepts for the 8085. Several examples of assembly language programs for tasks like addition, subtraction, multiplication, and data transfer are also included.
Chapter 1
Syllabus
Catalog Description: Computer structure, machine representation of data,
addressing and indexing, computation and control instructions, assembly
language and assemblers; procedures (subroutines) and data segments,
linkages and subroutine calling conventions, loaders; practical use of an
assembly language for computer implementation of illustrative examples.
Course Goals
0 Knowledge of the basic structure of microcomputers - registers, mem-
ory, addressing I/O devices, etc.
1 Knowledge of most non-privileged hardware instructions for the Ar-
chitecture being studied.
2 Ability to write small programs in assembly language
3 Knowledge of computer representations of data, and how to do simple
arithmetic in binary & hexadecimal, including conversions
4 Being able to implementing a moderately complicated algorithm in
assembler, with emphasis on efficiency.
5 Knowledge of procedure calling conventions and interfacing with high-
level languages.
Optional Text: Kip Irvine, Assembly Language for the IBM PC, Prentice
Hall, 4th or 5th edition
1
Additional References: Intel and DOS API documentation as presented
in Intel publications and online at www.x86.org; lecture notes (to be sup-
plied as we go).
Prerequisites by Topic. Working knowledge of some programming lan-
guage (102/103: C/C++); Minimal programming experience
Major Topics Covered in the Course:
1 Low-level and high-level languages; why learn assembler?
2 How does one study a new computer: the CPU, memory, addressing
modes, operation modes.
3 History of the Intel family of microprocessors.
4-5 Registers; simple arithmetic instructions; byte order; Arithmetic and
logical operations.
6 Implementing longer integer type support; carry and overflow.
7 Shifts, multiplication and division.
8 Memory layout.
9 Direct video memory access; discussion of the first project.
10 Assembler syntax; how to use the tools.
11-13 Conditional & unconditional jumps; loops; emulating high-level lan-
guage constructions; Stack; call and return; procedures
14-15 String instructions: effcient memory-to-memory operations.
16 Interrupts overview: interrupt table; how do interrupts work; classif-
cation.
17 Summary of the most important interrupts.
18-20 DOS interrupt; File I/O functions; file-copy program; discussion of
the second project
21 Interrupt handlers; keyboard drivers; timer-driven processes; viruses
and virus-protection software.
2
22 Debug interrupts; how do debuggers and profilers work.
23-24 (Optional).interfacing with high level languages; Protected mode fun-
damentals
Grading The grading is based on two projects, midterm project is 49%
and the final is 51%. Please note that the projects are individual, submitting
projects that are similar to submissions of others and/or are essentially
downloads from the Web would result in a fail.
Office Hours My hours this term for CSc 210 will be 3:45 ¶Ł 4:45 on
Mondays.
Zoom links:
11am https://ccny.zoom.us/j/8 ...
Keynote (Mike Muller) - Is There Anything New in Heterogeneous Computing - by...AMD Developer Central
Keynote presentation, Is There Anything New in Heterogeneous Computing, by Mike Muller, Chief Technology Officer, ARM, at the AMD Developer Summit (APU13), Nov. 11-13, 2013.
Accelerated .NET Memory Dump Analysis training public slidesDmitry Vostokov
This document provides an overview and training materials for analyzing .NET memory dumps. The training goals are to review fundamentals, learn how to analyze process dumps, learn necessary WinDbg commands in context, and cover CLR 4 on x86 and x64. The training covers fundamentals of memory spaces, user/managed space, types/assemblies/modules, process threads, and provides examples of stack traces and commands. It also outlines practice exercises analyzing different memory dumps to diagnose issues like exceptions, deadlocks, leaks and corruption.
The document contains programs to perform various operations on 8-bit numbers like addition, subtraction, multiplication, division using 8085 microprocessor. It also contains programs to find the largest/smallest number in an array, and to arrange an array of numbers in ascending order. The programs demonstrate various instructions of 8085 like load, move, add, subtract, compare, jump etc to perform the given tasks.
This document provides an overview of microcontroller architecture and assembly language programming. It discusses the following key points in 3 sentences:
The document introduces PIC microcontrollers and assembly language, noting that assembly language uses mnemonic instructions that must be translated to machine code by an assembler. It explains the assembling and linking process used to convert assembly code to machine code that can be burned into the PIC's program memory. Various PIC assembly language instructions are also described, including MOVLW, MOVWF, logic instructions, and bit manipulation instructions to set and clear bits on I/O ports.
COMP 2213X2 Assignment #2 Parts A and BDue February 3 in cla.docxdonnajames55
COMP 2213X2 Assignment #2 Parts A and B
Due February 3 in class
PLEASE HAND IN PARTS A AND B SEPARATELY!!!!
For “written” questions, please type your answers, use your very best English, and carefully
consider the material from the chapters. I am usually only looking for a few sentences for each
question, not an essay that goes on for pages. So choose your words carefully and thoughtfully.
PART A
[1] Does a computer need data registers (like D0–D7 in an M68K)? Defend your answer!
[2] Textbook question 5.35. If your student number is even, do parts (a), (c), (e) and (g). Otherwise do
parts (b), (d), (f) and (h). Note that (b) should read “[[[4]]]”, (c) should read “[[[0]]]” and
(h) should start with “[0]”.
[3] Explain why the following assembly language and RTL constructs are incorrect.
a. MOVE D3,#4
b. MOVE [D3],D2
c. MOVE (D3),D2
d. [D3] A0 + 3
e. [D3] #3
f. 3 [D3]
[4] Create a simple M68K program called ADDER. Your program should add together the numbers:
6, 4, 12, 16, 17, and 50. The program should leave the answer in register D0 when it terminates.
The program is to be assembled with the M68K cross-assembler and then run on the M68K simu-
lator. You can either install the cross-assembler and simulator given with the textbook (windows)
or you can use the Linux one available on the course web site. Doing a trace (to hand in) with the
windows version is much more painful than the Linux version, so make your choice carefully (and
you have to figure out the windows one without my help).
To use the Linux assembler (“68kasm”) and simulator (“bsvc”), follow the instructions in my
mail message of January 26, if you have not already done so.
IMPORTANT NOTE: if you are using the Linux simulator, the instructions for creating a program
are slightly different than those in the book. You should have the following at the start of each
program:
ORG $0
DC.L $8000 This is the stack pointer value after a "reset"
DC.L START This is the first instruction to execute
You can then follow that with something like
1
ORG $1000
START MOVE ...
You should still have a STOP instruction and END assembler directive, as described in the book,
but also use a BREAK instruction right before your STOP instruction.
Create your program (ADDER.s) in your (for example) comp2213/bsvc-master directory using
your favourite text editor and assemble it with the command 68kasm -l ADDER.s. If you had no
assembly errors you should now have a file called ADDER.h68 (which is your executable program)
and ADDER.lis (your program listing). Then start up the simulator by typing bsvc. Select
File/Open Setup, drill down to samples/m68000, select serial.setup and click Open; a
new window should pop up on your screen. Now choose File/Load Program, come back up to
your bsvc-master directory, and open your ADDER.h68 program. Now click the GUI’s Reset
button and then the Run button. (Alternatively, instead of Run click Single Step and watch the
result of each instruction..
1. The document discusses basic programming of the 8085 microprocessor. It covers the different types of programming languages including machine language, assembly language, and high-level languages.
2. The 8085 instruction set is classified into different groups like data transfer, arithmetic, logical, branch, and machine control instructions. Common instructions like MOV, ADD, SUB, and CALL are described.
3. The document provides examples of 8085 programs and instructions to load data, perform arithmetic operations, manage the stack, handle I/O, and control program flow. It also discusses assembler format and use of registers like the accumulator, flag register, and stack pointer.
The document describes a lab experiment on addition of two 8-bit numbers using an 8085 microprocessor. It includes:
1) An algorithm that initializes the carry to zero, loads the two 8-bit numbers into registers, adds the numbers and checks for carry, increments the carry if needed, and stores the result.
2) The assembly language program with labels, mnemonics, hex codes and comments to implement the algorithm.
3) Inputs, outputs and results with and without carry from adding sample 8-bit numbers.
This document describes WHYP, a version of Forth designed for embedded systems. WHYP can be used on Motorola 68HC11 and 68332 microcontrollers. It allows interactive development on a PC connected to the target system. WHYP words are executed as subroutines on the target. The document provides an example of using WHYP to design a digital compass that reads analog hall-effect sensors and displays the reading on 7-segment displays.
The Microprocessor System. A semester course review. Summarize important points for whole subject. Using the 8051 architecture as the practical and projects development.
This document contains programs to perform various operations like addition, subtraction, multiplication, division, and finding maximum/minimum values using an 8085 microprocessor. It also contains programs to arrange an array of data in ascending and descending order using bubble sort. The programs demonstrate how to use 8085 instructions to perform these operations by loading values from memory locations, performing arithmetic/logical operations, and storing results back to memory.
This document discusses various code conversion techniques used in microprocessors, including binary to BCD, BCD to binary, hexadecimal to BCD, and conversions to ASCII and seven-segment displays. It provides examples of assembly language code to perform these conversions and explains the basic steps or logic involved, such as using positional weighting, repeated addition or subtraction, and lookup tables.
This document contains several 8085 assembly language programs with the following topics:
1. Programs 1-5 demonstrate arithmetic, logical, and branch instructions through programs that add numbers, find complements, multiply and add arrays.
2. Programs 6-7 set and reset the program status word register.
3. Program 8 exchanges blocks of memory between two locations.
4. The document provides the memory location of each instruction and flowcharts for several programs. It also includes exam questions about multiplication, division, addition with carry, and counting bits in an 8-bit number.
The document discusses microcontrollers and the PIC16F877 microcontroller in particular. It provides the following key points:
- A microcontroller is a single-chip computer containing a processor, memory, and input/output peripherals. Microcontrollers can store and run user-written programs.
- The main parts of a microcontroller include a CPU, RAM, ROM, I/O lines, timers, and analog-to-digital and digital-to-analog converters.
- The PIC16F877 is chosen for its low cost, reliability, ease of use, and ability to perform a wide range of tasks using C language software.
This document discusses the assembly language programming of the 8085 microprocessor. It covers the basic topics of the 8085 instruction set including data transfer, arithmetic, logical and branching instructions. It also describes the addressing modes, programming model and instruction formats of the 8085 assembly language. Examples of assembly language instructions are provided to illustrate how to perform common operations like loading registers, arithmetic, and conditional jumps.
Chp6 assembly language programming for pic copymkazree
The document discusses assembly language programming for PIC microcontrollers. It covers number representation in assembler, basic elements of PIC assembly like labels, instructions, operands, and directives. It also discusses assembling and linking a PIC program, subroutines, macros, and local directives. An example program is provided to count from 0 to FF and send the count value to port B using subroutines for displaying and delay.
Similar to Genius it ians™ 8085 programming (part 2) (20)
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Literature Review Basics and Understanding Reference Management.pptxDr Ramhari Poudyal
Three-day training on academic research focuses on analytical tools at United Technical College, supported by the University Grant Commission, Nepal. 24-26 May 2024
Low power architecture of logic gates using adiabatic techniquesnooriasukmaningtyas
The growing significance of portable systems to limit power consumption in ultra-large-scale-integration chips of very high density, has recently led to rapid and inventive progresses in low-power design. The most effective technique is adiabatic logic circuit design in energy-efficient hardware. This paper presents two adiabatic approaches for the design of low power circuits, modified positive feedback adiabatic logic (modified PFAL) and the other is direct current diode based positive feedback adiabatic logic (DC-DB PFAL). Logic gates are the preliminary components in any digital circuit design. By improving the performance of basic gates, one can improvise the whole system performance. In this paper proposed circuit design of the low power architecture of OR/NOR, AND/NAND, and XOR/XNOR gates are presented using the said approaches and their results are analyzed for powerdissipation, delay, power-delay-product and rise time and compared with the other adiabatic techniques along with the conventional complementary metal oxide semiconductor (CMOS) designs reported in the literature. It has been found that the designs with DC-DB PFAL technique outperform with the percentage improvement of 65% for NOR gate and 7% for NAND gate and 34% for XNOR gate over the modified PFAL techniques at 10 MHz respectively.
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
1. Saturday, September 26, 2009
8085 programming (part 2)
Program to generate fibonacci number39.
Statement:Write an assembly language program to generate
fibonacci number.
Source Program:
MVI D, COUNT : Initialize counter
MVI B, 00 : Initialize variable to store
previous number
MVI C, 01 : Initialize variable to store
current number
MOV A, B :[Add two numbers]
BACK: ADD C :[Add two numbers]
MOV B, C : Current number is now
previous number
MOV C, A : Save result as a new current
number
DCR D : Decrement count
JNZ BACK : if count 0 go to BACK
HLT : Stop.
Search
My Blogs
My Personal Blog
Mak IT possible
IT@UCET
Followers
with Google Friend Connect
Members (12)
Blog Archive
► 2010 (7)
▼ 2009 (22)
► November (2)
▼ September (19)
8085 programming (part4)
8085 programming (part3)
8085 programming (part 2)
8085 programming (part1)
Important microprocessors at a
glance
Xeon
0 More Next Blog» manojshahu07@gmail.com Dashboard Sign Out
genius IT ians™
This blog is meant for helping B Tech students especially CSE and IT
students. Its not created and manipulated by a professional; But by a
student like you. So there is chance of faults and defects. Please do
co-operate. Looking forward for your comments and suggestions... Let me
begin... Other blogs of mine: http://www.dhanoopbhaskar.in &
http://www.theinsanetechie.in
8085 (4) assembly language (4) DBMS (7)
microprocessors (19) PL/SQL (7) SQL (7)
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
1 of 38 17-06-2016 17:59
2. Generate a delay of 0.4 seconds40.
Statement:Write a program to generate a delay of 0.4 sec if the
crystal frequency is 5 MHz.
Calculation: In 8085, the operating frequency is half of
the crystal frequency,
ie.Operating frequency = 5/2 = 2.5 MHz
Time for one T -state =
Number of T-states required =
= 1 x 106
Source Program:
LXI B, count : 16 - bit count
BACK: DCX B : Decrement count
MOV A, C
ORA B : Logically OR Band C
JNZ BACK : If result is not zero repeat
Arrange in DESCENDING Order41.
Statement: Arrange an array of 8 bit unsigned no in descending
order
Source Program:
START:MVI B, 00 ; Flag = 0
LXI H, 4150 ; Count = length of
array
MOV C, M
DCR C ; No. of pair = count
-1
INX H ; Point to start of array
LOOP:MOV A, M ; Get kth element
Itanium
Hyper Transport
Hyper Threading
Intel Core 2
Power PC
MOTOROLA
APPLE
INTEL
IBM
HP
DEC
CYRIX
AMD
► July (1)
Total Pageviews
Facebook
Dhanoop Bhaskar
Create your badge
About Me
Dhanoop Bhaskar
Simple and cool
View my complete profile
3 0 3 8 1
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
2 of 38 17-06-2016 17:59
3. INX H
CMP M ; Compare to (K+1)
th element
JNC LOOP 1 ; No interchange if kth
>= (k+1) th
MOV D, M ; Interchange if out of
order
MOV M, A ;
DCR H
MOV M, D
INX H
MVI B, 01H ; Flag=1
LOOP 1:DCR C ; count down
JNZ LOOP ;
DCR B ; is flag = 1?
JZ START ; do another sort, if yes
HLT ; If flag = 0, step
execution
Data transfer from one memory block to
other memory block.
42.
Statement: Transfer ten bytes of data from one memory to another
memory block. Source memory block starts from memory loca%on
2200H where as des%na%on memory block starts from memory
loca%on 2300H.
Source Program:
LXI H, 4150 : Initialize memory pointer
MVI B, 08 : count for 8-bit
MVI A, 54
LOOP : RRC
JC LOOP1
Server not found
Firefox can't find the server at
widgetserver.amazon.com.
Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check
your computer's network connection.
Server not found
Firefox can't find the server at
widgetserver.amazon.com.
Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check
your computer's network connection.
Server not found
Firefox can't find the server at
widgetserver.amazon.com.
Check the address for typing errors such as
ww.example.com instead of
www.example.com
If you are unable to load any pages, check
your computer's network connection.
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
3 of 38 17-06-2016 17:59
4. MVI M, 00 : store zero it no carry
JMP COMMON
LOOP2: MVI M, 01 : store one if there is a
carry
COMMON: INX H
DCR B : check for carry
JNZ LOOP
HLT : Terminate the program
Find the factorial of a number43.
Statement: Program to calculate the factorial of a number between
0 to 8
Source program
LXI SP, 27FFH ; Initialize stack pointer
LDA 2200H ; Get the number
CPI 02H ; Check if number is greater
than 1
JC LAST
MVI D, 00H ; Load number as a result
MOV E, A
DCR A
MOV C,A ; Load counter one less than
number
CALL FACTO ; Call subroutine FACTO
XCHG ; Get the result in HL
SHLD 2201H ; Store result in the
memory
JMP END
LAST: LXI H, 000lH ; Store result = 01
END: SHLD 2201H
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
4 of 38 17-06-2016 17:59
5. HLT
Subroutine Program:
FACTO:LXI H, 0000H
MOV B, C ; Load counter
BACK: DAD D
DCR B
JNZ BACK ; Multiply by successive
addition
XCHG ; Store result in DE
DCR C ; Decrement counter
CNZ FACTO ; Call subroutine FACTO
RET ; Return to main program
Find the Square Root of a given number44.
Statement:Write a program to find the Square Root of an 8 bit binary
number. The binary number is stored in memory location 4200H and
store the square root in 4201H.
Source Program:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
5 of 38 17-06-2016 17:59
6. LDA 4200H : Get the given data(Y)
in A register
MOV B,A : Save the data in B
register
MVI C,02H : Call the divisor(02H)
in C register
CALL DIV : Call division subroutine
to get initial value(X) in D-reg
REP: MOV E,D : Save the initial value in
E-reg
MOV A,B : Get the dividend(Y) in
A-reg
MOV C,D : Get the divisor(X) in
C-reg
CALL DIV : Call division subroutine
to get initial value(Y/X) in D-reg
MOV A, D : Move Y/X in A-reg
ADD E : Get the((Y/X) + X) in
A-reg
MVI C, 02H : Get the divisor(02H)
in C-reg
CALL DIV : Call division subroutine
to get ((Y/X) + X)/2 in D-reg.This is XNEW
MOV A, E : Get Xin A-reg
CMP D : Compare X and
XNEW
JNZ REP : If XNEW is not equal to
X, then repeat
STA 4201H : Save the square root
in memory
HLT : Terminate program
execution
Subroutine:
DIV: MVI D, 00H : Clear D-reg for
Quotient
NEXT:SUB C : Subtact the divisor
from dividend
INR D : Increment the
quotient
CMP C : Repeat subtraction
until the
JNC NEXT : divisor is less than
dividend
RET : Return to main
program
Flowchart for Source Program:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
6 of 38 17-06-2016 17:59
7. Flowchart for subroutine:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
7 of 38 17-06-2016 17:59
8. Split a HEX data into two nibbles and store it45.
Statement:Write a simple program to Split a HEX data into two
nibbles and store it in memory
Source Program:
LXI H, 4200H : Set pointer data for
array
MOV B,M : Get the data in B-reg
MOV A,B : Copy the data to A-reg
ANI OFH : Mask the upper nibble
INX H : Increment address as
4201
MOV M,A : Store the lower nibble
in memory
MOV A,B : Get the data in A-reg
ANI FOH : Bring the upper nibble
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
8 of 38 17-06-2016 17:59
9. to lower nibble position
RRC
RRC
RRC
RRC
INX H
MOV M,A : Store the upper nibble
in memory
HLT : Terminate program
execution
Add two 4-digit BCD numbers46.
Statement: Add two 4 digit BCD numbers in HL and DE register pairs
and store result in memory loca%ons, 2300H and 2301H. Ignore
carry a2er 16 bit.
Sample Problem:
(HL) =3629
(DE) =4738
Step 1 : 29 + 38 = 61 and auxiliary carry
flag = 1
:.add 06
61 + 06 = 67
Step 2 : 36 + 47 + 0 (carry of LSB) = 7D
Lower nibble of addition is greater than 9, so add 6.
7D + 06 = 83
Result = 8367
Source program
MOV A, L : Get lower 2 digits of no. 1
ADD E : Add two lower digits
DAA : Adjust result to valid BCD
STA 2300H : Store partial result
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
9 of 38 17-06-2016 17:59
10. MOV A, H : Get most significant 2 digits
of number
ADC D : Add two most significant
digits
DAA : Adjust result to valid BCD
STA 2301H : Store partial result
HLT : Terminate program
execution.
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
10 of 38 17-06-2016 17:59
11. genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
11 of 38 17-06-2016 17:59
12. Subtraction of two BCD numbers47.
Statement: Subtract the BCD number stored in E register from the
number stored in the D register.
Source Program:
MVI A,99H
SUB E : Find the 99's complement of
subtrahend
INR A : Find 100's complement of
subtrahend
ADD D : Add minuend to 100's
complement of subtrahend
DAA : Adjust for BCD
HLT : Terminate program execution
Multiply two 2-digit BCD numbers48.
Statement: Write an assembly language program to mul%ply 2 BCD
numbers
Source Program:
MVI C, Multiplier : Load BCD multiplier
MVI B, 00 : Initialize counter
LXI H, 0000H : Result = 0000
MVI E, multiplicand : Load multiplicand
MVI D, 00H : Extend to 16-bits
BACK: DAD D : Result Result +
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
12 of 38 17-06-2016 17:59
13. Multiplicand
MOV A, L : Get the lower byte of
the result
ADI, 00H
DAA : Adjust the lower byte
of result to BCD.
MOV L, A : Store the lower byte of
result
MOV A, H : Get the higher byte of
the result
ACI, 00H
DAA : Adjust the higher byte
of the result to BCD
MOV H, A : Store the higher byte
of result.
MOV A, B : [Increment
ADI 01H : counter
DAA : adjust it to BCD and
MOV B,A : store it]
CMP C : Compare if count =
multiplier
JNZ BACK : if not equal repeat
HLT : Stop
Generate and display binary up counter49.
Statement:Write a program for displaying binary up counter.
Counter should count numbers from 00 to FFH and it should
increment a2er every 0.5 sec.
Assume opera%ng frequency of 8085 equal to 2MHz. Display
rou%ne is available.
Source Program:
LXI SP, 27FFH : Initialize stack pointer
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
13 of 38 17-06-2016 17:59
14. MVI C, OOH : Initialize counter
BACK: CALL Display : Call display subroutine
CALL Delay : Call delay subroutine
INR C : Increment counter
MOV A, C
CPI OOH : Check counter is > FFH
JNZ BACK : If not, repeat
HLT : Stop
Delay Subroutine:
Delay: LXI B, count : Initialize count
BACK: DCX D : Decrement count
MOV A, E
ORA D : Logically OR D and E
JNZ BACK : If result is not 0 repeat
RET : Return to main program
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
14 of 38 17-06-2016 17:59
15. Flowchart for Source Program:
Flowchart for Delay routine:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
15 of 38 17-06-2016 17:59
16. Generate and display BCD up counter with frequency 1Hz50.
Statement:Write a program for displaying BCD up counter. Counter
should count numbers from 00 to 99H and it should increment after
every 1 sec. Assume operating frequency of 8085 equal to 3MHz.
Display routine is available.
Source Program:
LXI SP, 27FFH : Initialize stack pointer
MVI C, OOH : Initialize counter
BACK: CALL Display : Call display subroutine
CALL Delay : Call delay subroutine
MOV A, C
ADI A, 0 1 : Increment counter
DAA : Adjust it for decimal
MOV C,A : Store count
CPI ,00 : Check count is > 99
JNZ BACK : If not, repeat
HLT : Stop
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
16 of 38 17-06-2016 17:59
17. Delay Subroutine:
Delay:MVI B, Multiplier-count : Initialize multiplier
count
BACK 1:LXI D, Initialize Count
BACK: DCX D : Decrement count
MOV A, E
ORA D : Logically OR D and E
JNZ BACK : If result is not a,
repeat
DCR B : Decrement multiplier
count
JNZ BACK 1 : If not zero, repeat
RET : Return to main
program.
Operating Frequency : 3MHz
Flowchart for Source Program:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
17 of 38 17-06-2016 17:59
18.
Flowchart for Delay routine:
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
18 of 38 17-06-2016 17:59
19. Generate and display BCD down counter51.
Statement:Write a program for displaying BCD down counter.
Counter should count numbers from 99 to 00 and it should increment
after every 1 sec. Assume operating frequency of 8085 equal to
3MHz. Display routine is available.
Source Program 1:
LXI SP, 27FFH : Initialize stack pointer
MVI C, 99H : Initialize counter = 99
BACK:CALL Display : Call display subroutine
CALL Delay : Call delay subroutine
ADI 99H : See Addition below
DAA : Adjust for decimal
CPI 99H : Compare with last count
JNZ BACK :If no, repeat
HLT
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
19 of 38 17-06-2016 17:59
20. Source Program2:
LXI SP, 27FFH : Initialize stack pointer
MVI C, 99H : Initialize counter = 99
BACK: CALL Display : Call display subroutine
CALL Delay : Call delay subroutine
MOV A, C : Get count
ANI 0FH : Check for lower nibble
JNZ SKIP : If it is not 0FH go to skip
MOV A,C : Else get the count
SBI ,06 : Subtract 06
MOV C,A : Store the count
DCR C : Decrement count
CPI 99H : Check it for last count
JNZ BACK : If not, repeat
HLT : Stop
Generate and display the contents of decimal counter52.
Statement:Write assembly language program to with proper
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
20 of 38 17-06-2016 17:59
21. comments for the following: To display decimal decrementing
counter (99 to 00) at port 05 H with delay of half seconds between
.each count. Write as well the delay routine giving delay of half
seconds. Operating frequency of microprocessor is 3.072 MHz.
Neglect delay for the main program.
Source Program:
MVI C, 99H : Initialize counter
BACK: MOV A, C
ANI OF : Mask higher nibble
CPI OF
JNZ SKIP
MOV A, C
SUI 06 : Subtract 6 to adjust decimal
count
MOV D, A
SKIP: MOV A, C
OUT 05 : send count on output port
CALL Delay : Wait for 0.5 seconds
DCR C : decrement count
MOV A, C
CPI FF
JNZ BACK : If not zero, repeat
HLT : Stop execution
Delay subroutine:
Delay: LXI D, Count
Back: DCX D : 6 T-states
MOV A, D : 4 T-states
ORA E : 4 T-states
JNZ Back : 10 T-states
RET
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
21 of 38 17-06-2016 17:59
22. Debug the delay routine53.
Statement:The delay routine given below is in infinite loop, identify
the error and correct the program.
Delay routine with error:
DELAY : LXI H, N
L1 : DCX H
JNZ L1
Sol.: 1) The fault in the above program is at instruction
JNZ L1. This condition always evaluates to be true
hence loops keep on executing and hence infinite loop.
2) Reason for infinite looping: - The instruction DCX H
decrease the HL pair count one by one but it does not
affect the zero flag. So when count reaches to OOOOH
in HL pair zero flag is not affected and JNZ L1 evaluates
to be true and loop continues. Now HL again
decrements below OOOOH and HL becomes FFFFH and
thus execution continues.
3) The modification in the program is as follows:
DELAY : LXI H, N :Load 16 bit count
L1 : DCX H : Decrement count
MOV A, L
ORA H : logically OR Hand L
JNZ L1 : If result is not 0 repeat
PROGRAMS IN CODE CONVERSION
2-Digit BCD to binary conversion.54.
Statement: Convert a 2-digit BCD number stored at memory
address 2200H into its binary equivalent number and store the
result in a memory loca%on 2300H.
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
22 of 38 17-06-2016 17:59
23. Sample Problem
(2200H) = 67H
(2300H) = 6 x OAH + 7 = 3CH + 7 = 43H
Source Program:
LDA 2200H : Get the BCD number
MOV B, A : Save it
ANI OFH : Mask most significant four
bits
MOV C, A : Save unpacked BCDI in C
register
MOV A, B : Get BCD again
ANI FOH : Mask least significant four
bits
RRC : Convert most significant
four bits into unpacked BCD2
RRC
RRC
RRC
MOV B, A : Save unpacked BCD2 in B
register
XRA A : Clear accumulator (sum =
0)
MVI D, 0AH : Set D as a multiplier of 10
Sum: ADD D : Add 10 until (B) = 0
DCR B : Decrement BCD2 by one
JNZ SUM : Is multiplication complete? i
if not, go back and add again
ADD C : Add BCD1
STA 2300H : Store the result
HLT : Terminate program execution
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
23 of 38 17-06-2016 17:59
24. genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
24 of 38 17-06-2016 17:59
25. Binary to BCD conversion55.
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
25 of 38 17-06-2016 17:59
26. Statement: Write a main program and a conversion subrou%ne to
convert the binary number stored at 6000H into its equivalent BCD
number. Store the result from memory loca%on 6100H.
Sample Problem: (6000) H = 8AH
1.8AH ? 64H (Decimal 100) :.
Divide by 64H (Decimal 100)
8AH/64H ? Quotient = 1, Remainder = 26H
26H < 64H (Decimal 100)
:. Go to step 2 and Digit 2 = 1
2.26H ? OAH (Decimal 10) :.
Divide by OAH (Decimal 10)
26H/OAH ? Quotient = 3, Remainder = O8H
OSH < OAH (Decimal 10)
:. Go to step 3 and Digit 1 = 3
3. Digit 0 = O8H
Source Program:
LXI SP, 27FFH : Initialize stack
pointer
LDA 6000H : Get the binary
number in accumulator
CALL SUBROUTINE : Call subroutine
HLT : Terminate
program execution
Subroutine to convert binary number into its equivalent
BCD number:
PUSH B : Save BC register pair contents
PUSH D : Save DE register pair contents
MVI B, 64H : Load divisor decimal 100 in
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
26 of 38 17-06-2016 17:59
27. B register
MVI C, 0AH : Load divisor decimal 10 in
C register
MVI D, 00H : Initialize Digit 1
MVI E, 00H : Initialize Digit 2
STEP1: CMP B : Check if number < Decimal
100
JC STEP 2 : if yes go to step 2
SUB B : Subtract decimal 100
INR E : update quotient
JMP STEP 1 : go to step 1
STEP2: CMP C : Check if number < Decimal
10
JC STEP 3 : if yes go to step 3
SUB C : Subtract decimal 10
INR D : Update quotient
JMP STEP 2 : Continue division by 10
STEP3: STA 6100H : Store Digit 0
MOV A, D : Get Digit 1
STA 6101H : Store Digit 1
MOV A, E : Get Digit 2
STA 6102H : Store Digit 2
POP D : Restore DE register pair
POP B : Restore BC register pair
RET : Return to main program
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
27 of 38 17-06-2016 17:59
28. genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
28 of 38 17-06-2016 17:59
29. Find the 7-segment codes for given numbers56.
Statement: Find the 7-segment codes for given 5 numbers
from memory location 6000H and store the result from
memory location 7000H.
Sample Problem: (6000) H = 8AH
Source Program
LXI H, 6200H : Initialize lookup table pointer
LXI D, 6000H : Initialize source memory pointer
LXI B, 7000H : Initialize destination memory
pointer
BACK: LDAX D : Get the number
MOV L, A : A point to the 7-segment code
MOV A, M : Get the 7-segment code
STAX B : Store the result at destination
memory location
INX D : Increment source memory pointer
INX B : Increment destination memory
pointer
MOV A, C
CPI O5H : Check for last number
JNZ BACK : If not repeat
HLT : End of program
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
29 of 38 17-06-2016 17:59
30.
57. Find the ASCII character
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
30 of 38 17-06-2016 17:59
31. Statement: Write an assembly language program to convert the
contents of the five memory loca%ons star%ng from 2000H into an
ASCII character. Place the result in another five memory loca%ons
star%ng from 2200H.
Sample Problem
(2000H) = 1
(2001H) = 2
(2002H) = 9
(2003H) = A
(2004H) = B
Result:(2200H) = 31
(2201H) = 32
(2202H) = 39
(2203H) = 41
(2204H) = 42
Source program:
LXI SP, 27FFH : Initialize stack pointer
LXI H, 2000H : Source memory pointer
LXI D, 2200H : Destination memory pointer
MVI C, O5H : Initialize the counter
BACK: MOV A, M : Get the number
CALL ASCII : Call subroutine ASCII
STAX D : Store result
INX H : Increment source memory
pointer
INX D : Increment destination
memory pointer
DCR C : Decrement count by 1
CJNZ : if not zero, repeat
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
31 of 38 17-06-2016 17:59
32. HLT : Stop program execution
subroutine ASCII
ASCII: CPI, OAH : Check if number is OAR
JNC NEXT : If yes go to next otherwise
continue
ADI 30H
JMP LAST
NEXT: ADI 37H
LAST: RET : Return to main program
Subroutine:
Subroutine 'ASCII' converts a hexadecimal digit to
ASCII.The digit is passed using accumulator and the
result is stored in accumulator.Stack starts From
27FEH to 27FDH.
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
32 of 38 17-06-2016 17:59
33. genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
33 of 38 17-06-2016 17:59
34.
ASCII to Decimal Conversion58.
Statement: convert the ASCII number in memory to its equivalent
decimal number
Source Program:
LXI H, 4150 : Point to data
MOV A, M : Get operand
SUI 30 : convert to decimal
CPI 0A : Check whether it is valid
decimal number
JC LOOP : yes, store result
MVI A, FF : No, make result=FF
LOOP: INX H
MOV M, A
HLT : (A) = (4151)
Note: The ASCII Code (American Standard Code for
Information Interchange) is commonly used for
communication. It is a seven bit code. In this code
number 0 through 9 are represented as 30 through 39
respectively and letters A through Z are represented as
41H through 5AH. Therefore, by subtracting 30H we
can convert an ASCII number into its decimal
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
34 of 38 17-06-2016 17:59
35. equivalent.
HEX to Decimal conversion59.
Statement: Convert the HEX number in memory to its equivalent
decimal number
Source Program:
LXI H, 4150 ; Point to data
LXI B, 0000 ; Initialize hundreds= 0,
Tens=0
MOV A, M ; Get hex data to A
LOOP: SUI 64
JC LOOP 1
INR B ; hundreds= hundreds+1
JMP LOOP
LOOP 1: ADI 64 ; if subtracted extra, add it
clear carry flag
LOOP 2: SUI 0A
JC LOOP 3
INR C ; Tens=tens+1
JMP LOOP 2
LOOP 3: ADI 0A ; If subtracted extra, add it
again
INX H ; A = Units
MOV M, B ; store hundreds
MOV B, A ; Combine Tens in C &
MOV A, C ; Units in A to form a
RLC ; Single 8-bit number
RLC
RLC
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
35 of 38 17-06-2016 17:59
36. RLC
ADD B
INX H
MOV M, A ; Store tens & Units
HLT
Note: In this experiment the number is converted to its
equivalent decimal number using the following logic.
First count the number of hundreds, the number of
tens & units present in that hex number. Then add up
to get the equivalent decimal number.
Converting A9 we get:
A9 /64=45 Hundreds = 01
Since 64(100 decimal) cannot be subtracted from 45
no. of hundreds = 01. Now count tens
45/0A=3B Tens = 01
Now from 09, 0A cannot be subtracted. Hence tens =
06 the decimal equivalent of A9 is 169.
HEX to binary conversion60.
Statement: Convert an 8 bit hex no to its binary form & store in
memory.
Source Program:
LXI H, 4150 : Initialize memory pointer
MVI B, 08 : count for 8-bit
MVI A, 54
LOOP : RRC
JC LOOP1
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
36 of 38 17-06-2016 17:59
37. Newer Post Older Post
MVI M, 00 : store zero it no carry
JMP COMMON
LOOP2: MVI M, 01 : store one if there is a
carry
COMMON: INX H
DCR B : check for carry
JNZ LOOP
HLT : Terminate the program
Posted by Dhanoop Bhaskar at 5:30 AM
Labels: 8085, assembly language, microprocessors
Reactions:
1 comment:
Post a Comment
Links to this post
Create a Link
Home
Subscribe to: Post Comments (Atom)
Nurfatin Izzati Yamaludin said...
hai can u help me ...
i'm doing my mini project..
and my problem is to make 2 7-sengment count down...
can u help me by doing the progrm..
May 11, 2015 at 12:07 AM
1 Comment Sort by
Vaishali Patne · University of Pune
need a program to interchange digits of a number without using
rotate
Like · Reply · Aug 5, 2015 12:32am
Facebook Comments Plugin
Oldest
Add a comment...
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
37 of 38 17-06-2016 17:59
38. Server not found
Firefox can't find the server at widgetserver.amazon.com.
Server not found
Firefox can't find the server at
widgetserver.amazon.com.
Check the address for typing errors such as
ww.example.com instead of www.example.com
If you are unable to load any pages, check your
computer's network connection.
If your computer or network is protected by a
firewall or proxy, make sure that Firefox is permitted
to access the Web.
Try Again
genius IT ians™: 8085 programming (part 2) http://geniusitians.blogspot.in/2009/09/8085-programming-part-2.html
38 of 38 17-06-2016 17:59