•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 392,007 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,157 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser:
Views: 1812 | Replies: 7
![]() |
•
•
Join Date: Sep 2007
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
Okay so say I have an array which is like this:
and I want to print it as
-17
16
153
How do I do this?? If it is stored in a 4 byte of integer then it would be very easy to do, but not it's stored as a 2-byte integer.
In a 4 -byte integer I just quadruple starting from the first array address and then print the array, but how about this one?? Can someone help me??
.data
values:
.half -17
.half 16
.half 153
and I want to print it as
-17
16
153
How do I do this?? If it is stored in a 4 byte of integer then it would be very easy to do, but not it's stored as a 2-byte integer.
In a 4 -byte integer I just quadruple starting from the first array address and then print the array, but how about this one?? Can someone help me??
Last edited by -EquinoX- : Sep 22nd, 2007 at 10:29 am.
What about it?
Use the appropriate instruction to load a half word, and increment your address pointer by 2 rather than 4.
Use the appropriate instruction to load a half word, and increment your address pointer by 2 rather than 4.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do you have access to a library function which does it for you, or are you supposed to roll your own code and just use an OS 'output character' function?
It's just divide by 10 and modulo 10 in a loop.
It's just divide by 10 and modulo 10 in a loop.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
> Say that I have a number 65, how do I get an A from that?
I thought you wanted to turn 17 into "17"
> What do you mean divide by 10 and modulo 10 in a loop?
As in if you have 123, then /10 gives you 12 and %10 gives you 3
Then you do the same thing with 12
And you stop when you get to 0
I thought you wanted to turn 17 into "17"
> What do you mean divide by 10 and modulo 10 in a loop?
As in if you have 123, then /10 gives you 12 and %10 gives you 3
Then you do the same thing with 12
And you stop when you get to 0
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
•
•
Join Date: Sep 2007
Posts: 11
Reputation:
Rep Power: 1
Solved Threads: 0
•
•
•
•
> Say that I have a number 65, how do I get an A from that?
I thought you wanted to turn 17 into "17"
> What do you mean divide by 10 and modulo 10 in a loop?
As in if you have 123, then /10 gives you 12 and %10 gives you 3
Then you do the same thing with 12
And you stop when you get to 0
OK so how do I print the ASCII characters then?? how do I turn 65 to an A?? I still don't get what you mean by divide and modulo, say that I finish that step.. what am I suppose to do? Print the remainder or what??
> how do I turn 65 to an A?
Well if you imagine some character output function, then
outch 65 and outch 'A' will do the same thing where the system uses the ASCII character set.
> Print the remainder or what??
Yes, print the remainder.
Of course, you'll then notice that the number is printed out in reverse, but let's get the first step sorted out OK.
Well if you imagine some character output function, then
outch 65 and outch 'A' will do the same thing where the system uses the ASCII character set.
> Print the remainder or what??
Yes, print the remainder.
Of course, you'll then notice that the number is printed out in reverse, but let's get the first step sorted out OK.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Assembly Marketplace
Similar Threads
- Problems with Epson 600 Stylus Printer (Windows 9x / Me)
- MIPS Help (Assembly)
- MIPS - convert integer to floating point?? (Assembly)
- multiplication in assembly mips (Assembly)
- Parsing a .asn file (Community Introductions)
- The Gregorian Calendar (C++)
- FPU + external C file - how to return double (Assembly)
- C++ BASICS ==> Pointers, Call by Reference/Value, Inheritance, Functions & Arrays (C++)
- Reversing Integer, Magic Squares, and LCM problems (Java)
Other Threads in the Assembly Forum
- Previous Thread: Mouse Manipulation Questions
- Next Thread: JK Flip-flop problem



Linear Mode