October 3rd, 2010, 12:47 AM
Please help to write this assembly program
Hello gys, this is my weakness programming i feel an igonorant when it comes to programming my filed requires from me to take this course and i dont know anything,. sombody can help me with following program please!!:
Write an assembly program called hw3_ex1 , stored in file hw3_ex1.asm , that prompts the user to type a 5-character string. The program reads the first 5 characters of that string and prints two strings. The first string contains the 5 characters entered by the user, but in reverse order. The second string contains the 5 characters entered by the user, but whose ASCII code has been decremented by 32. Match the example shown below, where user input is shown in bold face:
Enter a 5-character string: hguot
String #1: tough
String #2: HGUOT
You may assume that the user will always type exactly 5 characters followed by a carriage return (no need to deal with errors, etc.).
Reading a character from the keyboard is done via the read_char macro (see page 17 of the textbook for a description). So you'll have to call this macro 5 times to get the 5 characters.
Remember that when you print a string it should be null-terminated. So, to store a 5-character string that you will print you need to store it in 6 bytes, with the last byte equal to 0.
October 3rd, 2010, 07:44 AM
We are not going to do you homework.
If you want our help, you have to ask more specific what you need help with.
Have you looked at the macro that have been given to you?
October 3rd, 2010, 12:50 PM
i started the homework
i dont know how to finish it here what i did so far:
Originally Posted by MrFujin
Enter a 5-charcter string: hgout
String#1: tough ; ASCII code decremented by 32
String#2: HGUOT ; reverse order
mov char, al
L1: mov eax,32 ; creates ASCII code decrement by 32
mov char, AL
mov al 5-character
mov al, TYPE BYTE ; 6 byte
October 3rd, 2010, 01:12 PM
What's it do? What's it not do? We're not going to help you unless you help yourself.
October 3rd, 2010, 05:48 PM
Never mind, thank you anyway. ill find a solution my self the forum is not worth it.
Originally Posted by ryon420