hello!
First off I don't know if this is the right spot to put this post, but I'm new here so...
My task is to draw a flowchart for a subroutine to convert a 4-bit hexadecimal value to the corresponding 7-bit ASCII-code.
Specification:
Input parameters: Only one, in register r4. The 4 least significant bits in register r4 specify a number, from 0 through 15. The values of all other bits in the input must be ignored.
Return value: Only one, returned in register r2. The 7 least significant bits in register r2 must be an ASCII code as described below. All other bits in the output must be zero.
Required action: Input values 0 through 9 must be converted to the ASCII codes for the digits '0' through '9', respectively. Input values 10 through 15 must be converted to the ASCII codes for the letters 'A' through 'F', respectively.
Side effects: The values in registers r2 through r15 may be changed. All other registers must have unchanged values when the subroutine returns.
I don't know how to begin...
I would be glad if anyone could help me!![]()
Last edited by Fredrik373; 01-27-2010 at 04:55 AM.
Which part of it is the difficulty?
Can you grab only the bits you care about?
Can you convert them to an integer?
Can you determine the ASCII codes?
The part I needed help with was to just draw the flowchart, but I managed to do that..
But now I am going to write this as assembly code for Nios II. My problem now is that I don't know how to begin writing the code..
You can see my flowchart on attachments.
I am going to convert that flowchart into assemblycode..
Any suggestions how I should start? Im new to assembly.
I have made a new thread that is more easy to understand, so you do not need to reply to this one.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks