Question: Lab# 5 : Logical, Bit Manipulation and String instructions Assignment # 1 : Write an assembly code to find number of ones in each number

Lab#5: Logical, Bit Manipulation and String instructions
Assignment #1: Write an assembly code to find number of ones in each number in the array X and store
the result in the array Y
X DB 12H,0OF5H,0OAHH
Y DB 3 DUP(0)
Solution:
ORG 100H
HLT
X DB 12H,0F5H,0A7H
Y DB 3 DUP(0)
Assignment #2: Write an assembly code to replace the even numbers in the array X with zero (Note: without
using DIV or IDIV instructions):
x DB 10,3,1,2
Solution:
ORG 100H
HLT
X DB 10,3,1,2
Assignment #3: Write an assembly code to count number of a's in the following string (Note: using SCASB
instruction and REPNE prefix):
STR DB 'aabcadxyaaAa'
Solution:
ORG 100H
HLT
STR DB 'aabcadxyaaAa'
L EQU $-STR
Assembly Lab
Assignment #4: Write an assembly code to reverse the string STR1 in STR2
Lab# 5 : Logical, Bit Manipulation and String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!