ex af,af'
ex af,af'
Hi
i was staring blind very much why my code wasnt accepted
the line pointed out my simplistic and very usefull EX AF,AF'
which includes the ' sign as i am used to that for about say 35 years.
But zcc does not like it. it does NOT want that alternative register set sign '
i did find it and now my code works, remains the question, why is that needed? to avoid the '
?
i was staring blind very much why my code wasnt accepted
the line pointed out my simplistic and very usefull EX AF,AF'
which includes the ' sign as i am used to that for about say 35 years.
But zcc does not like it. it does NOT want that alternative register set sign '
i did find it and now my code works, remains the question, why is that needed? to avoid the '
?
Re: ex af,af'
I was disappointed as you are when I noticed it, but it is not so uncommon to find z80 assemblers not accepting AF'.
If you feel it as a terrible loss, then an issue can be opened on github.
If you feel it as a terrible loss, then an issue can be opened on github.
-
- Member
- Posts: 71
- Joined: Sun Apr 01, 2018 4:02 pm
Re: ex af,af'
Have tried with?
Code: Select all
ex af, af
Re: ex af,af'
i know it now but foresure i will bump my head on it again. technicly there is no way off controling what register set you work with, from that point off view there are two AF registers and not AF and AF '
But i have plenty asm that will have to be addepted on that 1 small ' sign meaning that adding it to the compiler to accept both cases would be much easier, i hope ?
for the parser it migth be complex if the code is totaly mixed with asm and common C codings...
Last edited by cborn on Fri Apr 21, 2023 2:32 pm, edited 1 time in total.
Re: ex af,af'
yes i did ommit the '
but if i copy/past old file i will bump into it again.
Re: ex af,af'
I guess the ' works like brackets in pairs and af' uses only a single one giving a uneven count missmatch with needs extra code to keep it appart
Re: ex af,af'
So, af,af' works in .asm file, but as you deduced, when embedded in a C file, the preprocessor expects to see a '[char]' sequence and will report an error if it comes across a "stray" '
Re: ex af,af'
knowing the problem is half off the solution, they say
Perhaps the compiler can mention the error by what it is?
and its a little releave that if i use my ol' code as file it will work without changes.
cheers
Perhaps the compiler can mention the error by what it is?
and its a little releave that if i use my ol' code as file it will work without changes.
cheers
-
- Member
- Posts: 71
- Joined: Sun Apr 01, 2018 4:02 pm
Re: ex af,af'
Maybe could change those lines to:
So is valid asm code and also should be valid for the C compiler.
Any text processor should allow you to replace one text by this new one very easily.
Code: Select all
ex af, af’;’
Any text processor should allow you to replace one text by this new one very easily.
Re: ex af,af'
that works indeed !! then one file can be used by both systemsDarkSchneider wrote: ↑Tue Apr 25, 2023 5:48 pm Maybe could change those lines to:So is valid asm code and also should be valid for the C compiler.Code: Select all
ex af, af’;’
Any text processor should allow you to replace one text by this new one very easily.
Re: ex af,af'
BUT
...
now it migth inject an DEB 59 !!
mind that z80 instuction 0x3b dec 59 is DEC SP
which is very bad if executed randomly
its a good trick but migth have an edge on it
...
now it migth inject an DEB 59 !!
mind that z80 instuction 0x3b dec 59 is DEC SP
which is very bad if executed randomly
its a good trick but migth have an edge on it
-
- Member
- Posts: 71
- Joined: Sun Apr 01, 2018 4:02 pm
Re: ex af,af'
Try it, maybe the C compiler interpret it as string. If it injects a DEC SP the program should freeze soon after execution. Can also generate the assembled (-a option of zcc) and watch the code.