18. Counting Number Of Even And Odd Numbers From A Given Series

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 18. Counting Number Of Even And Odd Numbers From A Given Series as PDF for free.

More details

  • Words: 199
  • Pages: 2
Adam’s Engineering College, Paloncha ECE Department –MPI LAB Experiment No.: 18 Page 1 of 2

Year : III/IV B.Tech II Semester

COUNTING NUMBER OF EVEN AND ODD NUMBERS FROM A GIVEN SERIES

Aim: - To write an assembly language program to count the number of even and odd numbers from a given series. Registers: - AL, BL, CL, and DL. Description: - The number of even and odd numbers from a given series are found, and EVEN is stored in DL, and ODD is stored in BL. Ports:- None. DATA SEGMENT SERIES DB 05 DUP(00) EVEN DB ? ODD DB ? DATA ENDS CODE SEGMENT ASSUME CS: CODE, DS: DATA START:

NEXT2:

MOV CL, 05 XOR BL, BL XOR DL, DL LEA SI, SERIES MOV AL, [SI] SHR AL, O1

Lab in-charge

HOD, ECE

Adam’s Engineering College, Paloncha ECE Department –MPI LAB Experiment No.: 18 Page 2 of 2

Year : III/IV B.Tech II Semester

JNC NEXT1

NEXT1: NEXT3:

INC BL JMP NEXT3 INC DL INC SI DEC CL JNZ NEXT2 MOV EVEN, DL MOV ODD, BL

CODE ENDS END START Result: The numbers of even and odd numbers are counted from the given series.

Lab in-charge

HOD, ECE

Related Documents