Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
26 May, 2013, 01:25:00 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 [2] 3 4 ... 20   Go Down
  Print  
Author Topic: Assembly Programmers - Help Axe Optimize! -  (Read 20530 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #15 on: 14 March, 2010, 23:11:40 »
0

Thanks!  I'll try that Smiley

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?
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 23:34:24
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50238


Total Post Ratings: +2615

View Profile WWW
« Reply #16 on: 15 March, 2010, 02:11:17 »
0

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.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #17 on: 15 March, 2010, 19:44:10 »
0

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  Tongue
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Iambian
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 14:52:06
Date Registered: 04 September, 2008, 20:12:14
Location: Nowhere in particular
Posts: 636


Total Post Ratings: +167

View Profile
« Reply #18 on: 15 March, 2010, 20:02:31 »
0

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.
Logged

A Cherry-Flavored Iambian draws near... what do you do? ...
Projects in my development environment:
Celtic 3 (83+) 95% (Hold) | CaDan (83+) 15% (Rst) | E:SoR (84+) 10% (Rst) | CaDanITE (83+) 4% (Hold) | FF:TIoC (83+) 2% (Data)
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 23:34:24
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50238


Total Post Ratings: +2615

View Profile WWW
« Reply #19 on: 15 March, 2010, 23:46:22 »
0

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  Tongue
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.
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #20 on: 16 March, 2010, 02:57:53 »
0

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.
Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Online Online

Gender: Male
Last Login: Today at 01:17:04
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5644


Total Post Ratings: +589

View Profile
« Reply #21 on: 16 March, 2010, 04:09:55 »
0

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 Tongue
Logged

calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 16:59:06
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #22 on: 16 March, 2010, 05:08:03 »
0

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 Tongue
You can't just flip a bit. You have to subtract from zero.
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #23 on: 16 March, 2010, 05:15:32 »
0

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: 16 March, 2010, 05:16:03 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 16:59:06
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #24 on: 16 March, 2010, 05:41:33 »
0

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.
I just typed it in on my calculator and tried $ffff*$0001 and $0001*$ffff and both gave $ffff. Did you make a typo somewhere or something?
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #25 on: 16 March, 2010, 05:48:02 »
0

I meant -1 times -1 sorry.  I just copied and pasted it btw.
« Last Edit: 16 March, 2010, 05:48:54 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 16:59:06
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #26 on: 16 March, 2010, 05:59:11 »
0

I tried -1*-1 and I ended up with 1. I dunno, maybe there's something going on with the underscore in the loop label? I've never really used that.
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 16:59:06
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #27 on: 17 March, 2010, 03:21:55 »
0

I just made optimized min/max routines that you can use Cheesy

1
2
3
4
5
6
7
Min_HLDE:
 xor a
 sbc hl,de
 jr c,$+4
 ld h,a
 ld l,a
 add hl,de


1
2
3
4
5
6
7
Max_HLDE:
 xor a
 sbc hl,de
 jr nc,$+4
 ld h,a
 ld l,a
 add hl,de
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #28 on: 17 March, 2010, 03:58:29 »
0

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.

Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
AaroneusTheGreat
Anti-Riot Squad
LV6 Super Member (Next: 500)
*
Offline Offline

Last Login: 19 May, 2013, 23:50:14
Date Registered: 30 August, 2008, 16:17:37
Posts: 309

Total Post Ratings: +23

View Profile
« Reply #29 on: 17 March, 2010, 04:13:06 »
0

Quote
That's a cleaver trick!

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

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.  Grin

</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: 17 March, 2010, 04:17:08 by AaroneusTheGreat » Logged
Pages: 1 [2] 3 4 ... 20   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.387 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.