### Author Topic: Assembly Programmers - Help Axe Optimize!  (Read 32347 times)

0 Members and 1 Guest are viewing this topic.

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #15 on: March 14, 2010, 05:11:40 pm »
Thanks!  I'll try that

What about division?  Clearly I'll need more than just overhead since there's no overflow to loop around.  Is there a more efficient way to do than what I was originally planning with multiplication?
___Axe_Parser___
Today the calculator, tomorrow the world!

#### xlibman

• Now active at https://codewalr.us
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55806
• Rating: +3148/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #16 on: March 14, 2010, 08:11:17 pm »
btw are you planning to provide the source code to some of the hardcore asm coders on this board eventually, in case some people might find some optimizations to make the compiled code smaller? That could maybe help too.
In case you are wondering where I went, I am still active in the TI community, but I left Omni back in 2015 for various  reasons. I might come back one day, depending of certain circumstances, but my new online home (despite me being Omnimaga founder in 2001) is now CodeWalrus ( https://codewalr.us ). Sorry for the inconveniences.

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #17 on: March 15, 2010, 01:44:10 pm »
Kind of.  I'm going to release all of my templated assembly code that the executable programs use, but I don't think I will release the source of the parser itself.  Right now, I'm not too worried about the optimizations.  Its the actual code of the Parser I am trying to finished first so I can release a beta, but I keep getting distracted by wantting to add more commands since they're relatively easier and more fun
___Axe_Parser___
Today the calculator, tomorrow the world!

#### Iambian

• Coder Of Tomorrow
• Posts: 735
• Rating: +213/-3
• Cherry Flavoured Nommer of Fishies
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #18 on: March 15, 2010, 02:02:31 pm »
I've got no clue whether or not you've seen this, but I think it might be of some help. http://map.grauw.nl/sources/external/z80bits.html

Will post later if something else catches my eye.
A Cherry-Flavored Iambian draws near... what do you do? ...

#### xlibman

• Now active at https://codewalr.us
• CoT Emeritus
• LV15 Omnimagician (Next: --)
• Posts: 55806
• Rating: +3148/-232
• CodeWalrus founder & retired Omnimaga founder
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #19 on: March 15, 2010, 05:46:22 pm »
Kind of.  I'm going to release all of my templated assembly code that the executable programs use, but I don't think I will release the source of the parser itself.  Right now, I'm not too worried about the optimizations.  Its the actual code of the Parser I am trying to finished first so I can release a beta, but I keep getting distracted by wantting to add more commands since they're relatively easier and more fun
Never release the source to public before releasing the software, btw. If for example, you decide to post Axe 0.2 both on Omnimaga and Ticalc at the same time, wait until it makes it to ticalc archives before releasing the source. Better protection against code thieves.
In case you are wondering where I went, I am still active in the TI community, but I left Omni back in 2015 for various  reasons. I might come back one day, depending of certain circumstances, but my new online home (despite me being Omnimaga founder in 2001) is now CodeWalrus ( https://codewalr.us ). Sorry for the inconveniences.

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #20 on: March 15, 2010, 08:57:53 pm »
I've got no clue whether or not you've seen this, but I think it might be of some help. http://map.grauw.nl/sources/external/z80bits.html
Yeah, that's what I've been using, but it doesn't have many signed routines, just unsigned.
___Axe_Parser___
Today the calculator, tomorrow the world!

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #21 on: March 15, 2010, 10:09:55 pm »
Hmmm it would seem so.  Is it really so much of a hassle to flip the negative bit, multiply/divide, then flip it again?  Seems trivial compared to any other modification, although i'm not an asm guy

#### calc84maniac

• Epic z80 roflpwner
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2885
• Rating: +460/-17
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #22 on: March 15, 2010, 11:08:03 pm »
Hmmm it would seem so.  Is it really so much of a hassle to flip the negative bit, multiply/divide, then flip it again?  Seems trivial compared to any other modification, although i'm not an asm guy
You can't just flip a bit. You have to subtract from zero.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #23 on: March 15, 2010, 11:15:32 pm »
Builderboy, you're thinking of a 1's compliment system where the last bit is just a sign bit.  2's compliment is a little bit different.  The advantage of 2's compliment system is that it is arithmetically (and apparently also multiplicitively) compatible with unsigned numbers.

By the way calcmaniac, your code didn't work.  I tried -1 times 1 and it returned a weird number.  But I was able to create my own routine after looking at some other code.  Its a little slower, but its roughly the same size as the original 8bit routine.
« Last Edit: March 15, 2010, 11:16:03 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

#### calc84maniac

• Epic z80 roflpwner
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2885
• Rating: +460/-17
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #24 on: March 15, 2010, 11:41:33 pm »
By the way calcmaniac, your code didn't work.  I tried -1 times 1 and it returned a weird number.  But I was able to create my own routine after looking at some other code.  Its a little slower, but its roughly the same size as the original 8bit routine.
ld h,a
ld l,a

Code: [Select]
Max_HLDE:
xor a
sbc hl,de
jr nc,$+4 ld h,a ld l,a add hl,de "Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman #### Quigibo • The Executioner • CoT Emeritus • LV11 Super Veteran (Next: 3000) • Posts: 2031 • Rating: +1075/-24 • I wish real life had a "Save" and "Load" button... ##### Re: Assembly Programmers - Help Axe Optimize! « Reply #28 on: March 16, 2010, 09:58:29 pm » That's a cleaver trick! But wouldn't something like this be simpler? or a sbc hl,de add hl,de jr nc,$+3
ex de,hl

But I'm trying to convert all of my math commands to signed operations anyway, so I would need to tweak it a bit.

I'm going to try your multiplication routine again and see if its smaller.  I think I forgot the ret at the end which might of been what screwed me up.

___Axe_Parser___
Today the calculator, tomorrow the world!

#### AaroneusTheGreat

• Moderator
• Posts: 287
• Rating: +26/-1
##### Re: Assembly Programmers - Help Axe Optimize!
« Reply #29 on: March 16, 2010, 10:13:06 pm »
Quote
That's a cleaver trick!

Actually a cleaver trick would be more like juggling butchers knives...

Sorry I saw your typo and thought it was pretty funny, I make mistakes like that all the time and it makes me giggle that someone else does too from time to time.

</end off topic comment>

BTW I think you're doing a smart thing by asking for help optimizing your code, there are some excellent programmers here who would more than likely love to get their hands on your code to help make this as good a program as it could possibly be.
« Last Edit: March 16, 2010, 10:17:08 pm by AaroneusTheGreat »