basic directly to assembly
Moderator: MaxCoderz Staff
basic directly to assembly
this is an interesting idea...I doubt it been thought of befor ok, probably not, but it has NEVER been done as of yet. Why isn't their a program to convert basic code into a faster asm program.
It would be a very handy thing for basic programmers (like myself) who's progs lack the speed to do everything they want. Often I find my programs limmited, not by size but by speed...and something like this would be the fastest (thoug MLC does sound very neat.) And it would only make since as either an app or computer utility. A program like this that could use external asm libs for basic and allready converted basic code.
It would be a very handy thing for basic programmers (like myself) who's progs lack the speed to do everything they want. Often I find my programs limmited, not by size but by speed...and something like this would be the fastest (thoug MLC does sound very neat.) And it would only make since as either an app or computer utility. A program like this that could use external asm libs for basic and allready converted basic code.
- Jim e
- Calc King
- Posts: 2457
- Joined: Sun 26 Dec, 2004 5:27 am
- Location: SXIOPO = Infinite lives for both players
- Contact:
*sigh*
You can't convert basic to assembly because basic is interpreted by z80 assembly there would no gain in speed and the size would shoot up to increddible levels. 7 or 8 bytes in basic could means hundreds in asm.
But as far as speeding things up, one thought had crossed my mind.
Parsing takes a long time in basic and can slow things down. If we were to preparse the basic code into faster interpreted code.
basicly like this
( ( 2 + A ) ^ 3 * ( 4 - B ) ^ 4 ) - 10 -> C
The calc would have to figure what to do first, that wasted time.
what if we convert it to some thing like this
Add( 2 , A ) -> temp1
Power( temp1 , 3 ) -> temp1
Sub( 4 , B ) -> temp2
Power( temp2 , 4 ) -> temp2
Mult( temp1 , temp2 ) -> temp1
Sub( temp1 , 10 ) -> C
Using a stack may even speed it up more but it was just a thought I had. Alot still has to be considered.
You can't convert basic to assembly because basic is interpreted by z80 assembly there would no gain in speed and the size would shoot up to increddible levels. 7 or 8 bytes in basic could means hundreds in asm.
But as far as speeding things up, one thought had crossed my mind.
Parsing takes a long time in basic and can slow things down. If we were to preparse the basic code into faster interpreted code.
basicly like this
( ( 2 + A ) ^ 3 * ( 4 - B ) ^ 4 ) - 10 -> C
The calc would have to figure what to do first, that wasted time.
what if we convert it to some thing like this
Add( 2 , A ) -> temp1
Power( temp1 , 3 ) -> temp1
Sub( 4 , B ) -> temp2
Power( temp2 , 4 ) -> temp2
Mult( temp1 , temp2 ) -> temp1
Sub( temp1 , 10 ) -> C
Using a stack may even speed it up more but it was just a thought I had. Alot still has to be considered.
- kv83
- Maxcoderz Staff
- Posts: 2735
- Joined: Wed 15 Dec, 2004 7:26 pm
- Location: The Hague, Netherlands
- Contact:
EZAsm... yup, I even created a simple tic-tac-toe with it... But it's not really basic when you write it... and the output is very, very bigGambit wrote:I remember RadicalSoft having made a new "language" that did something like this... EZAsm, IIRC. Of course, I've never used it, so I don't know...
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
-
- Calc Master
- Posts: 1089
- Joined: Fri 17 Dec, 2004 9:53 am
...
Or use an ASM lib (EBL)!
-
- Extreme Poster
- Posts: 479
- Joined: Fri 17 Dec, 2004 11:09 pm
- Contact:
-
- Calc Wizard
- Posts: 526
- Joined: Tue 08 Mar, 2005 1:37 am
- Location: who wants to know?
- Contact:
Re: ...
How that alternative slipped my mind I don't know.the_unknown_one wrote:Or use an ASM lib (EBL)!
- dysfunction
- Calc Master
- Posts: 1454
- Joined: Wed 22 Dec, 2004 3:07 am
- Location: Through the Aura