[MSX-C] Q&A official thread

Pagina 50/57
43 | 44 | 45 | 46 | 47 | 48 | 49 | | 51 | 52 | 53 | 54 | 55

Van DarkSchneider

Paladin (942)

afbeelding van DarkSchneider

01-11-2016, 20:21

ARTRAG wrote:

The Hi-tech C passes the function parameters using registers when you use ansi c definitions and the stack when you use old k&r definitions.
I do not have the cp/m version anymore, I cannot compile sorry

Looking at the asm generated, it seems to use DE and BC and then the stack. So up to 4 8 bit parameters can be passed by registers or up to 2 16 bit.
Do you have the full calling convention to take a look?

Also, take care with signed math. I notice that on hi-tech also involves calling, can see the wrelop and wrelopbc in the asm generated. So use always unless really needed (because data nature itself) unsigned types. The FOR loops are well done no need to change them to WHILE.

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

02-11-2016, 00:14

Look for z80man.pdf on my repository in GitHub

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

02-11-2016, 01:12

Van DarkSchneider

Paladin (942)

afbeelding van DarkSchneider

02-11-2016, 09:00

ARTRAG wrote:

this is the cp/m version
https://github.com/sharksym/CPMEMU_HI-TECH_C

Yes I knew about that repository, a great work indeed. MSX-C libs port and other libs.

With the usage of IX and IY it could be worth to take a look at it. We are working on an engine that uses many and many structs so it could benefit. This first version will be made on MSX-C but then depending on some benchmarks (porting a part of the engine) we'll see. With the MSX-DOS/2, MSXBIOS and GLIB libs it should not be hard.

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

02-11-2016, 19:54

In case, I suggest to use the cross compiler directly.
The cp/m version is slightly different by the dos version and some problems could occur in the way parameters are exchanged and the memory is arranged.
AR

Van AxelStone

Prophet (3064)

afbeelding van AxelStone

04-11-2016, 12:46

So Hi-tech C is future for MSX developers that wants to use C Smile

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

04-11-2016, 15:07

No, any tool is ok if you like it. I have never tried sdcc but it should be a good tool as well provided that you know how to access to the hw resources.

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

05-11-2016, 09:27

IAR compiler seems a good candidate as well

http://sdcc.sourceforge.net/mediawiki/index.php/Z80_code_size

Anyway hi-tech c do not fail compiling in any test

Van ARTRAG

Enlighted (6704)

afbeelding van ARTRAG

05-11-2016, 10:56

About IAR, I've it, but making an exe files suitable from msx is not trivial, as there is no CPM target nor a simple ROM target

Van AxelStone

Prophet (3064)

afbeelding van AxelStone

05-11-2016, 21:28

ARTRAG wrote:

No, any tool is ok if you like it. I have never tried sdcc but it should be a good tool as well provided that you know how to access to the hw resources.

Well I feel that HiTech is a very good option for 2 causes:

  1. It's a good compiler that has CPM and DOS versions.
  2. It has a lot of support. The libraries made by shahkym are really a boost for use this compiler.

SDCC lacks of MSX specific stuff, you need to program every component and library. I suposse that in a few years it could be a real alternative, but nowadays I feel that it's not a compiler for MSX.

Pagina 50/57
43 | 44 | 45 | 46 | 47 | 48 | 49 | | 51 | 52 | 53 | 54 | 55