You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write an Assembly Language program to search a given byte in the list. If the element is found then store the index/location of that element in the memory. If the element is not found then store FFFFH in the memory.
INPUT Test Case 1: (8000H): 06H, Store the count of total numbers
(8001H): 55H, The number to be searched
(8002H to 8007H): 11H, 22H, 33H, 44H, 55H, 66H
OUTPUT: (8010H): 80 (8011H): 06
INPUT Test Case 2: (8000H): 06H, Store the count of total numbers
(8001H): 77H, The number to be searched
(8002H to 8007H): 11H, 22H, 33H, 44H, 55H, 66H
OUTPUT: (8010H): FF (8011H): FF
Approach :
• simply iterate through all numbers by loop
• compare numbers with given/input number using CMP instruction & every time increment index(counter)