Microprocessor Lab CSL1543 0:0:2

Slides:



Advertisements
Similar presentations
Program.-(9)* Write a program Input two numbers from keyboard and multiply of given values using by variables. Input value No 1 input value No2 Multiply.
Advertisements

Chapter 8 Programable Interface Chips Principles of Microcomputers 2014年12月10日 2014年12月10日 2014年12月10日 2014年12月10日 2014年12月10日 2014年12月10日 1.
Array : To store multiple value in one variable, “but value must be homogenous or similar type” is called array. We can say in other word Arrangement of.
Flow of Control Instruction/Control structure Looping structure Looping structure Branching structure Branching structure For assembly language program.
Program.(08) Write a program Divide 5 by 2 and display answer value and remainder value. 1 Store 5 into AL 2 Store BL into 2 3Divide AL Into BL 4Store.
DOS and BIOS Interrupts DOS and BIOS interrupts are used to perform some very useful functions, such as displaying data to the monitor, reading data from.
A Design Example An Exact Calculator. Exact Calculator Manipulating Large Integer Values Operations: – +, -, *, /, %, And, Or, Xor, Not, Power Functions.
Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
Digital Interfacing.
ICS312 Set 6 Operands. Basic Operand Types (1) Register Operands. An operand that refers to a register. MOV AX, BX ; moves contents of register BX to.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Flow Control Instructions
Kip Irvine: Assembly Language for Intel-Based Computers
8.4 Instruction Execution Times TOBIN PROC FAR SUB AX,AX MOV DX,AX MOV CX,4 NEXTD: PUSH CX SUB BP,BP MOV CX,4 GETNUM: RCL BX,1 RCL BP,1 LOOP GETNUM.
COSC 456 Lesson 8 Cool Codes ADD AL,SIAL AL + SI ADD AL,[SI]AL AL + [SI] INC BXBX BX + 1 INC [BX]Ambiguity error INC BYTE PTR [BX][BX] [BX] + 1 INC WORD.
BIOS and DOS Programming in DOS INT 10 and 21H. Interrupts There are some extremely useful subroutines within BIOS or DOS that are available to the user.
Lecture 14 Basic I/O Interface Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
Strings, Procedures and Macros
Arithmetic Flags and Instructions
LEA instruction The LEA instruction can be used to get the offset address of a variable Example ORG 100h MOV AL, VAR1 ; check value of VAR1 by moving it.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
DAC Interfacing V ref CPU D Q DAC D Q V out Clock Address bus Address
Assembly language programming
Format of Assembly language
Chapter Nov-2010
Presentation on Real Mode Memory Addressing
1st prog! Q: Read a char – from a keyboard & display it at the beginning of the next line! ====== A.
Instruksi Set Prosesor 8088
Microprocessor and Assembly Language
Morgan Kaufmann Publishers Computer Organization and Assembly Language
INSTRUCTION SET.
Microprocessor and Assembly Language
Assembly IA-32.
Assembly Language Programming Part 2
Intel 8088 (8086) Microprocessor Structure
Microprocessor & Interfacing
Microprocessor Lab CSL1543 0:0:2
Calculator in assembly language
CÁC LỆNH HỢP NGỮ.
9/17/2018 Kiến Trúc Máy Tính.
اصول اساسی برنامه نویسی به زبان اسمبلی
Defining Types of data expression Dn [name] expression Dn [name]
Symbolic Instruction and Addressing
Introduction to Assembly Language
שפת סף וארכיטקטורה של מעבד 8086
ارايه دهنده : حسن عسكرزاده
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
اصول اساسی برنامه نویسی به زبان اسمبلی
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Conditional Jumps and Time Delays
Shift & Rotate Instructions)
Program Logic and Control
Microprocessor Lab CSL1543 0:0:2
Program Logic and Control
Symbolic Instruction and Addressing
Flow Control Instructions
Lecture 06 Programming language.
X86 Assembly Review.
UNIT-II Assembly Language Programs Involving Logical
Chapter 6 –Symbolic Instruction and Addressing
Assembly Language for Intel 8086 Jump Condition
CNET 315 Microprocessor & Assembly Language
Chapter 7 –Program Logic and Control
Chapter 8: Instruction Set 8086 CPU Architecture
Chapter 7 –Program Logic and Control
UNIT-II ADDRESSING MODES & Instruction set
Presentation transcript:

Microprocessor Lab CSL1543 0:0:2 Week 6 : Logic Controller Interface

Command byte A Department of CSE, MSRIT

Command byte B Department of CSE, MSRIT

Department of CSE, MSRIT

WRITE A PROGRAM TO READ THE STATUS OF EIGHT INPUT BITS FROM THE LOGIC CONTROLLER INTERFACE AND DISPLAY “FF” IF IT IS EVEN PARITY BITS OTHERWISE DISPLAY “00”. ALSO DISPLAY NUMBER OF 1’S IN THE INPUT. Department of CSE, MSRIT

PROGRAM ASSUME CS: CODE, DS: DATA DATA SEGMENT PA EQU 24A0H ; COULD BE DIFFERENT ELSEWHERE PB EQU 24A1H PC EQU 24A2H CR EQU 24A3H MSG DB "NO. OF 1’S:” ONES DB ?,"$" DATA ENDS Department of CSE, MSRIT

CODE SEGMENT START: MOV AX, DATA MOV DS, AX MOV DX, CR MOV AL, 082H ; PA – OUTPUT & PB – INPUT OUT DX, AL MOV DX, PB IN AL, DX MOV CX, 8 MOV AH, 00 ROT_AGAIN: ROR AL, 1 JNC NEXT INC AH ; [AH] = NO. OF 1’S NEXT: LOOP ROT_AGAIN Department of CSE, MSRIT

MOV BL, AH ; STORE ASCII VALUE OF [AH] ADD AH, 30H MOV ONES, AH LEA DX, MSG MOV AH, 09H INT 21H MOV AL, 0FH ROR BL, 1 ; TO CHECK ODD OR EVEN NO OF ONES JC DISP MOV AL, 0F0H DISP: MOV DX, PA OUT DX, AL MOV AH, 4CH CODE ENDS END START Department of CSE, MSRIT

WRITE A PROGRAM TO PERFORM THE FOLLOWING FUNCTIONS USING THE LOGICAL CONTROLLER INTERFACE. i. BCD UP DOWN COUNTER. ii. RING COUNTER Department of CSE, MSRIT

PROGRAM FOR BCD UP-DOWN COUNTER ASSUME CS: CODE, DS: DATA DATA SEGMENT PA EQU 24A0H PB EQU 24A1H PC EQU 24A2H CR EQU 24A3H DATA ENDS Department of CSE, MSRIT

CODE SEGMENT START: MOV AX, DATA MOV DS, AX MOV DX, CR MOV AL, 80H OUT DX, AL MOV CX, 100D MOV DX, PA MOV AL, 00H NEXT: OUT DX, AL CALL DELAY ADD AL, 01 DAA ; A DECIMAL COUNTER LOOP NEXT MOV AH, 4CH INT 21H Department of CSE, MSRIT

DELAY PROC MOV SI, 03FFFH L2: MOV DI, 0FFFFH L1: DEC DI JNZ L1 DEC SI JNZ L2 RET DELAY ENDP CODE ENDS END START Department of CSE, MSRIT

RING COUNTER ASSUME CS: CODE, DS: DATA DATA SEGMENT PA EQU 24A0H PB EQU 24A1H PC EQU 24A2H CR EQU 24A3H DATA ENDS Department of CSE, MSRIT

CODE SEGMENT START: MOV AX, DATA MOV DS, AX MOV DX, CR MOV AL, 82H OUT DX, AL MOV AL, 01 RPT: MOV DX, PA CALL DELAY ROR AL, 1 PUSH AX ; INT 21H CHANGES [AL] MOV AH, 06H MOV DL, 0FFH INT 21H POP AX JZ RPT ; FUNCTION 06 TRY TO SENSE, IF A KEY IS PRESSED, IF YES, ZF = 0 MOV AH, 4CH Department of CSE, MSRIT

DELAY PROC MOV SI, 02FFFH L2: MOV DI, 0FFFFH L1: DEC DI JNZ L1 DEC SI JNZ L2 RET DELAY ENDP CODE ENDS END START Department of CSE, MSRIT

Department of CSE, MSRIT