| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Division
I'd like to ask a question. I'd prefer it not become an "IFFL" thread that is so hopelessly off-topic it may as well be deleted. Just a simple question and a simple answer PLEASE :)
To the ones who remain helpful and mathematical whizes...
I need to do division for a routine I'm working on. The problem is I have to divide by various numbers, not just sets of two.
For example
LDA #$10
ASL
ASL
gives you 16/4 = 4
However I will need to divide divide by different values (eg. 5, 7, 22, etc.).
Is there such a way to load the Accumulator with a value (or X,Y) and divide it by ANY number, say from 1-200, and if so, how?
I'm very rusty on this. I can't remember a lot of the mathematical functions.
Thanks for any serious answers :)
|
|
... 11 posts hidden. Click here to view all posts.... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you can either unrol the div loop posted above, or learn a bit of the exp and div function. |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
The division routine works fine, very well in fact.
The problem is with what I need to divide. :( |
| |
Slartibartfast Account closed
Registered: Jul 2002 Posts: 230 |
Quote: The division routine works fine, very well in fact.
The problem is with what I need to divide. :(
Umbilical. |
| |
Monte Carlos
Registered: Jun 2004 Posts: 359 |
Make a drawing, which helps you to find the solution.
Monte
|
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Quote: Make a drawing, which helps you to find the solution.
Monte
Yep I did make a drawing, I always sketch things that I'm having difficulty implementing into code. Then I fall asleep and let the sub-concious take over. It sounds odd but I've woken up many nights with the solution.
I know how to do the routine, I know how to achieve the effect I desire. The problem is that what I want to divide won't allow me to do the effect I desire. It would only allow for half of the screen. It's difficult to explain but it's dependant upon the effect :)
I have come up with a new idearrrrr. |
| |
Slartibartfast Account closed
Registered: Jul 2002 Posts: 230 |
Quote: Yep I did make a drawing, I always sketch things that I'm having difficulty implementing into code. Then I fall asleep and let the sub-concious take over. It sounds odd but I've woken up many nights with the solution.
I know how to do the routine, I know how to achieve the effect I desire. The problem is that what I want to divide won't allow me to do the effect I desire. It would only allow for half of the screen. It's difficult to explain but it's dependant upon the effect :)
I have come up with a new idearrrrr.
Nasibal. |
| |
Monte Carlos
Registered: Jun 2004 Posts: 359 |
I know, it's always difficult not to explain too much.
If you don't want to explain your effect, invent something which leads to the same solution and explain it to us ;)
Etnom
|
| |
Slartibartfast Account closed
Registered: Jul 2002 Posts: 230 |
Turtle! |
| |
Wanderer Account closed
Registered: Apr 2003 Posts: 478 |
Quote: I know, it's always difficult not to explain too much.
If you don't want to explain your effect, invent something which leads to the same solution and explain it to us ;)
Etnom
Tell you what, I will PM you with the original idea and see what you think. Perhaps I just need another set of eyes and a different person's perspective to see if it is workable :)
|
| |
Slartibartfast Account closed
Registered: Jul 2002 Posts: 230 |
Custard? |
Previous - 1 | 2 | 3 - Next |