Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly language. Upper-case conversion Write a program that converts a string

ID: 3803225 • Letter: A

Question

Assembly language. Upper-case conversion Write a program that converts a string containing up to 256 lowercase characters to uppercase. A lowercase character can be converted to uppercase by subtracting 32 from it's ACII code) Assembly language Simple number sequence Write a program that generates a sequence of numbers in which each number is equal to double the previous number. The range is 1-100h, shown here in hexadecimal. 1 2 4 8 10 20 40 80 100 200 400 800 1000 Use a debugger to dump the area of memory containing the numbers.

Explanation / Answer

; String Conversion LowerCase To UpperCase In 8086
.model small ; Directive
.stack 100h ; For 256 character
.data
text db 'lowertouppercaseconversion' ; Here string for conversion can be entered upto 256 characters
count dw 26 ; Number of characters in string
.code
start: mov ax,@data
mov ds,ax ; Loading data segment with ax
mov es,ax ; Loading extra segment with ax

mov si,0 ; Setting index counter to 1
mov cx,count ; Setting cx to size of string
repeat: mov al,text[si] ; Setting al to string characters one by one
sub al,20h ; Converting to upper case
mov text[si],al ; Moving converted character as Upper Case back to string
inc si ; Increment index counter value
loop repeat

mov ah,4ch ; Service number int 21h ; Exit to DOS

end start