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

Using assembly language in C. I need help implementing my_lowercase function in

ID: 3727415 • Letter: U

Question

Using assembly language in C. I need help implementing my_lowercase function in asseblies.

implement my_lowercase function in assemblies int main (void) const char a "Your full name". my_lowercase(a); while (1); my_lowercase) is a subroutine to convert some of the upper-case letters in the string to lower case. You need to load each character, check to see if it is a letter. If so, you have to convert it to lower case. Each character in the string is represented with its ASCII code. For example, A' is represented with a 65 (0x41), 'B, with 66 (0x42), and so on up to ‘Z' which uses 90 (0x5a). The lower case letters start at 'a' (97, or 0x61) and end with 'z' (122, or 0x7a). We can convert an upper case letter to a lower case letter by adding 32. Attach your assembly source code between two red lines and capture necessary debugger screens -asm void my-lowercase(char *str) { cap-loop Dummy code is provided for your debugging practice; Load byte into r1 from memory pointed to by r0 (str pointer); compare it with the character before 'a' ; If byte is lower or same, then skip this byte 2 Revised Summer 2016 Compare it with the 'z' character If it is higher, then skip this byte Else subtract out difference to capitalize it Store the capitalized byte back in memory cap_skip Increment str pointer Was the byte 0? If not, repeat the loop Stop writing program from here; BX Ir; Else return fom subroutine )

Explanation / Answer

.MODEL SMALL .DATA MSG DB 0DH,0AH, ' ENTER THE STRING :-----> : $' MSG2 DB 0DH,0AH, ' YOUR STRING IS :-----> : $' STR1 DB 255 DUP(?) ONE DB ? TWO DB ? .CODE BEGIN: MOV AX,@DATA MOV DS,AX LEA DX,MSG MOV AH,09H INT 21H LEA SI,STR1 MOV AH,01H READ: INT 21H MOV BL,AL CMP AL,0DH JE DISPLAY XOR AL,20H MOV [SI],AL INC SI ;CMP BL,0DH JMP READ DISPLAY: MOV AL,'$' MOV [SI],AL LEA DX,MSG2 MOV AH,09H INT 21H LEA DX,STR1 MOV AH,09H INT 21H ; MOV AH,4CH ; INT 21H .EXIT END BEGIN

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote