Hi, I don't have my code to hand right now but what I've done is break that up into 2 * 8 loops so only 3 rotates are required in each loop and I've got rid of the increment as the carry is carried back to the start of the loop.
So I've got 2 loops like this:
.loop ROL v+1
LDA v2
ROL A
ROL v3
CLC ...
Search found 8 matches
- Fri Aug 28, 2020 9:03 am
- Forum: Programming
- Topic: Another division routine!
- Replies: 5
- Views: 1011
- Mon Aug 24, 2020 11:41 am
- Forum: Programming
- Topic: Another division routine!
- Replies: 5
- Views: 1011
Re: Another division routine!
Hi barrym and Gordon, thanks, I'll look through that.
Gordon, I'll be doing that when it comes to signed division, the negating at the start is so I have a positive and negative divisor value either of which is used for the addition depending on the previous pass through the loop.
Gordon, I'll be doing that when it comes to signed division, the negating at the start is so I have a positive and negative divisor value either of which is used for the addition depending on the previous pass through the loop.
- Sun Aug 23, 2020 10:19 pm
- Forum: Programming
- Topic: Another division routine!
- Replies: 5
- Views: 1011
Re: Another division routine!
There's something weird going on with this, I'll try to sort it out.
- Sun Aug 23, 2020 9:35 pm
- Forum: Programming
- Topic: Another division routine!
- Replies: 5
- Views: 1011
Another division routine!
I'm looking at ways to divide and come up with this, it's unsigned 16/16=16 bits and doesn't give a remainder. Not fully tested so maybe some errors somewhere but it seems to work so far. I tried this after reading a comment about non restoring division changing the sign of the divisor. Is this any ...
- Tue Jul 28, 2020 9:45 pm
- Forum: Programming
- Topic: Most efficient way to toggle a bit (flag) in memory
- Replies: 22
- Views: 9896
Re: Most efficient way to toggle a bit (flag) in memory
This relies on V being clear and Y is clobbered so maybe not so good when it comes to debugging.
I think it's 7.5 or 8.5 depending on zp or not.
I think it's 7.5 or 8.5 depending on zp or not.
Code: Select all
......
.flag BVC next
LSR flag
.......
Code 1 here
.......
RTS
.next ASL flag
.......
Code 2 here
........
RTS
- Tue Jul 19, 2016 11:59 am
- Forum: Programming
- Topic: Idea for 3D on elec /BBC... Am I mad?
- Replies: 6
- Views: 1814
Re: Idea for 3D on elec /BBC... Am I mad?
Very cool thanks. Are there any articles on how they're done?
I wasn't thinking of texturing, only solid or checked pixels. A big difference though would be that walls could be positioned anywhere at angles and any length.
I wasn't thinking of texturing, only solid or checked pixels. A big difference though would be that walls could be positioned anywhere at angles and any length.
- Tue Jul 19, 2016 6:28 am
- Forum: Programming
- Topic: Idea for 3D on elec /BBC... Am I mad?
- Replies: 6
- Views: 1814
Re: Idea for 3D on elec /BBC... Am I mad?
I'll have a look, any links or what to search for? Any that would have run on original electron or BBC hardware?
- Tue Jul 19, 2016 12:57 am
- Forum: Programming
- Topic: Idea for 3D on elec /BBC... Am I mad?
- Replies: 6
- Views: 1814
Idea for 3D on elec /BBC... Am I mad?
Hi all, first off I'll say I realise this is a big ask so I don't know if anyone will be interested, particularly as I don't know how well this could really work or if anyone here would really be interested in attempting such a thing.
My first computer was an electron when I was about 10 and I got ...
My first computer was an electron when I was about 10 and I got ...