55.5k views
3 votes
Write a 8086 assembly program to convert all lower case characters to upper stored in a any array mydata.

User Robthewolf
by
8.3k points

1 Answer

6 votes

Final answer:

The student's question pertains to writing an 8086 assembly program to convert lowercase characters to uppercase in an array. The solution involves iterating through the array, checking each character's ASCII value, and converting lowercase letters to uppercase by subtracting 32 from their ASCII values.

Step-by-step explanation:

The subject of this question is a program for the Intel 8086 microprocessor, which is related to the field of Computers and Technology. Specifically, the task is to write a program in 8086 assembly language that modifies an array by converting all lowercase characters to uppercase. This is a typical high school-level exercise in a computer science or programming class.

The program can use a loop to iterate through each element of the array, checking if the character is a lowercase letter (ASCII value between 97 and 122). If it is, we can convert it to uppercase by subtracting 32 from its ASCII value.

Here is a basic structure for the program:

mov bx, 0; BX register points to the start of the array
start:
; Load the next byte from the array into AL
mov al, [mydata + bx]
; Check the if end the of array (assuming null-terminated string)
cmp al, 0
je done
; Convert lowercase to uppercase
cmp al, 'a'
jl not_lowercase
cmp al, 'z'
jg not_lowercase
sub al, 32
mov [mydata + bx], al
not_lowercase:
; Move to the next character
inc bx
jmp start
done:
; End data define semy data define 'mydata' as a byte array with the initial set of characters, and ensure that it is null-terminated if you want to use the above method to determine the end of the array.
User Dino Sunny
by
7.7k points