I think if that dialect gonna be added, then it could improve perfomance of C code a lot
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
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]
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?
If it is like with SDCC, the "::" symbol marks a label as global (accessible from another source file).
If it is like with SDCC, the "::" symbol marks a label as global (accessible from another source file).
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.
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.
Nice!
Hello Santiontanon.
MDL doesn't support sjasm's : operator yet, right?
Like in
ld bc, 23:63h
which translates to:
ld bc, 5987 ; 23*256+0x63
Oh, interesting! I thought I had support for the ":" operator. But it seems that sjasm has two different semantics for ":", one when applied to symbols (to get their page), which is implemented, and this one when applied to two integers! I'll add to the to-do list, it's not yet supported!