Assembler Optimizer

Страница 58/58
51 | 52 | 53 | 54 | 55 | 56 | 57 |

By Pencioner

Scribe (1532)

Аватар пользователя Pencioner

28-01-2023, 16:05

I think if that dialect gonna be added, then it could improve perfomance of C code a lot

By rolandve

Champion (298)

Аватар пользователя rolandve

28-01-2023, 16:19

santiontanon wrote:

Oh, not sure! Which assembler dialect does the ASCII C compiler generate assembler in? Do you have an example? I can definitively take a look Smile

Not sure what qualifies as a good example. I just copied and paste a part from the ascii C msxbios.mac file. I can certainly send a lot more.

[code]
;
;	Call a SUB-ROM routine from C program
;
CALSUB@::
	push	de		; save pointer to REGS structure
	push	hl		; set routine address to IX
	pop	ix
	ld	iy,0		; save SP in IY
	add	iy,sp
	ex	de,hl
	di
	ld	sp,hl		; Copy to registers
	pop	af
	pop	bc
	pop	de
	pop	hl
	ei
	ld	sp,iy		; restore true stack pointer
	push	iy
	call	_CALSUB
	pop	iy
	pop	ix		; restore pointer to REGS structure
	di
	ld	sp,ix		; copy from registers
	inc	sp
	inc	sp
	inc	sp
	inc	sp
	inc	sp
	inc	sp
	inc	sp
	inc	sp
	push	hl
	push	de
	push	bc
	push	af
	ei
	ld	sp,iy		; restore true stack
	pop	af		; discard stack
	ret

[/code]

By santiontanon

Paragon (1734)

Аватар пользователя santiontanon

30-01-2023, 01:08

That looks fairly standard z80 notation, so, MDL should be able to work on that with some adjustments (I see some "@" and "::" symbols, that I'll have to check for what is their semantics). I'd be happy to try to add support for this. Is there any example code that uses ascii C that I could try to compile myself to do some tests that you would recommend?

By aoineko

Paladin (809)

Аватар пользователя aoineko

30-01-2023, 02:03

If it is like with SDCC, the "::" symbol marks a label as global (accessible from another source file).

By aoineko

Paladin (809)

Аватар пользователя aoineko

30-01-2023, 02:03

If it is like with SDCC, the "::" symbol marks a label as global (accessible from another source file).

By rolandve

Champion (298)

Аватар пользователя rolandve

31-01-2023, 12:35

For complete information:
This document describes the M80 assembler used by Ascii C
and
Here you can find how to embed assembly in MSX C
Last link also explains about the label.

By santiontanon

Paragon (1734)

Аватар пользователя santiontanon

31-01-2023, 16:07

Oh! If it's Macro-80, then MDL already supports that. So, it should be already applicable. Just make sure to specify "-dialect macro80" when calling MDL to optimize these assembler files.

By rolandve

Champion (298)

Аватар пользователя rolandve

01-02-2023, 11:47

Nice!

Страница 58/58
51 | 52 | 53 | 54 | 55 | 56 | 57 |