#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    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:
    % ./hw3_ex1
    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.
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,576
    Rep Power
    1906
    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?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    i started the homework


    Originally Posted by MrFujin
    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?
    i dont know how to finish it here what i did so far:
    INCLUDE Irvine32.inc
    .data
    Enter a 5-charcter string: hgout
    String#1: tough ; ASCII code decremented by 32
    String#2: HGUOT ; reverse order
    char BYTE?

    .code
    main PROC
    call ReadChar
    mov char, al
    L1: mov eax,32 ; creates ASCII code decrement by 32
    call decrement
    call read_char#1
    jz L1
    next:
    call read_char#2
    mov char, AL
    mov al 5-character
    mov al, TYPE BYTE ; 6 byte
  6. #4
  7. Permanently Banned
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2006
    Location
    In a whale
    Posts
    4,147
    Rep Power
    0
    What's it do? What's it not do? We're not going to help you unless you help yourself.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0
    Originally Posted by ryon420
    What's it do? What's it not do? We're not going to help you unless you help yourself.
    Never mind, thank you anyway. ill find a solution my self the forum is not worth it.

IMN logo majestic logo threadwatch logo seochat tools logo