From: SourceForge.net <no...@so...> - 2009-07-04 09:45:33
|
Feature Requests item #2815320, was opened at 2009-07-01 13:13 Message generated for change (Tracker Item Submitted) made by dfulab You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2815320&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 5 Private: No Submitted By: dfulab (dfulab) Assigned to: Nobody/Anonymous (nobody) Summary: please add asm() pseudo function as alternate Initial Comment: Is it possible to add the asm() as an alternate to _asm _endasm? The reason why I am asking is that _asm and _endasm seems to be doing a lot of unnecessary processing that so far causes bugs in my embedded assembly code. I would like to see one that treats the embedded as a string and simply paste it into the assembly file without any processing. Since it doesn't make sense to alter the behavior of existing feature, this would be an alternative. Bugs I have caught so far for Z80 version: - assembly comments contains ! causes internal error (resolved) - ex af,af' - that extra ' is part of a valid operand, but causes an error because the compiler thinks it is an unclosed ' ' quote. I had to use a .db with the right values to trick the compiler into putting the right code. - multi-line #define macro issues all lumped into the same line. If you are not careful, this can cause serious issues. A simple ; comment can turn every assembly code after it into comments. The following is taken from ez80 port from freertos project. This makes the assembly listing easier to read instead of a clump of text all squeezed into a single line. Also funny stuff like the ex af,af' won't cause grief and eliminates any potential compiler induced bug cause by its own processing. #define portSAVE_CONTEXT() \ asm ( "xref _pxCurrentTCB \n\t" \ "di \n\t" \ "push af \n\t" \ "in0 a, (62h) \n\t" \ "push bc \n\t" \ "push de \n\t" \ "push hl \n\t" \ "push iy \n\t" \ "ex af, af' \n\t" \ "exx \n\t" \ "push af \n\t" \ "push bc \n\t" \ "push de \n\t" \ "push hl \n\t" \ "ld ix, 0 \n\t" \ "add ix, sp \n\t" \ "ld hl, (_pxCurrentTCB) \n\t" \ "ld (hl), ix \n\t" \ ); ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=350599&aid=2815320&group_id=599 |