Is Turbo Basic as fast as ASM?

Page 1/2
| 2

By AxelStone

Prophet (3189)

AxelStone's picture

02-01-2015, 22:03

Hi, in spanish forum we have started an interesting thread about turbo basic vs asm. Since I'm not an expert I'd like to ask here. I thought that in turbo basic the CPU must wait while the VDP is working, instead of ASM where CPU and VDP can work at same time. Our friend Kai has attached a code in turbo basic wich ensures that can make both things at same time.

Is Turbo Basic as fast as ASM? This is, can turbo basic make anything at same speed than ASM? Is there any example code in ASM where we can probe that equivalent in Turbo Basic goes slower?

Thanks.

Login or register to post comments

By ARTRAG

Enlighted (6923)

ARTRAG's picture

02-01-2015, 22:32

xbasic is a compiler and its limits are in the quality of the asm produced and in the ram used by the basic sources, not in the way vdp commands work

By Manuel

Ascended (19270)

Manuel's picture

02-01-2015, 22:33

In general, with older compilers like MSX-BASIC Kun (what the real name is), the generated assembly code is not as optimized as a good/expert manual assembly programmer could do. So manually crafted assembly code by an expert would in general be faster than automatically generated code from a higher level programming language.

Note that for modern compilers this is hardly true. They are so good in efficient code generation (and optimizations, etc.) that it's hardly worth programming in assembly for modern systems.

The real advantage of this whole thing of course is that the simpler language that basic is, enables you get reasonable performance but it is much easier to create programs: you can create software faster and more people can start doing it. (Although if you program badly in a higher level language, the compiled result can still be slow due to the algorithms and constructions used...)

By meits

Scribe (6530)

meits's picture

02-01-2015, 23:00

Too bad modern computers don't invite users to start coding... Or users became lame and lazy throughout the years...

By Daemos

Paragon (2044)

Daemos's picture

03-01-2015, 00:26

The only limit would propably be if you require very specific custom code. I could imagine that if you really need to do fancy stuff like advanced system manupilations or toying around with specific interrupthandling basic may be limiting. Perhaps all these problems where allready solved a long time ago.

By ARTRAG

Enlighted (6923)

ARTRAG's picture

03-01-2015, 00:31

xbasic is limited by the fact you have to keep in ram both the source and the assembled code.
This can be very limiting for large projects

By ericb59

Paragon (1098)

ericb59's picture

03-01-2015, 07:35

yes artrag !
also the compiling time must be taken into account.
Large blocks may be very long to compil, and must be compiled each time the main program come back to this blocks.

By jltursan

Prophet (2619)

jltursan's picture

03-01-2015, 11:52

So, does anyone knows what's the maximum block size Kun Basic can handle?

By ericb59

Paragon (1098)

ericb59's picture

03-01-2015, 11:57

yes, it's around 10K of Basic code.

By jltursan

Prophet (2619)

jltursan's picture

03-01-2015, 13:24

Thanks!

Seems pretty tight if you want to keep a full program into a compiled block oO

By ericb59

Paragon (1098)

ericb59's picture

03-01-2015, 13:34

in fact this is my experience with Nestor Basic, which is based on Kun Basic.
Perhaps Kun Basic can handle a little more code.... ?

Page 1/2
| 2