Is it possible to tell the inline assembler to output something to the resulting assembler file even though it doesn't recognise the opcode?
Mailing lists / fpc-devel / 2012-07
Inline assembler.
4 messages · 3 people · –
- JJonas Maebe 2
- KKonstantin 1
- Ppeter green 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
peter green wroteIs it possible to tell the inline assembler to output something to the resulting assembler file even though it doesn't recognise the opcode?
No. We used to have a "direct" assembler reader that allowed this, but that's incompatible with the concept of having an internal assembler and also in general just a hack.
Jonas
On 19 Jul 2012, at 23:54, peter green wrote: > Is it possible to tell the inline assembler to output something to the resulting assembler file even though it doesn't recognise the opcode? No. We used to have a "direct" assembler reader that allowed this, but that's incompatible with the concept of having an internal assembler and also in general just a hack.
An even dirtier hack would be entering machine code like this:
ASM
mov ax,dx
db $98,$90,$f8,$fc,
add eax,ecx
END;
With some more dirty hacks you can add addresses and other stuff to the machine code but this is probably not the way you want to go ;-).
Konstantin
Konstantin wrote 12 lines
Jonas Maebe schrieb:
> On 19 Jul 2012, at 23:54, peter green wrote:
>
>> Is it possible to tell the inline assembler to output something to the resulting assembler file even though it doesn't recognise the opcode?
> No. We used to have a "direct" assembler reader that allowed this, but that's incompatible with the concept of having an internal assembler and also in general just a hack.
An even dirtier hack would be entering machine code like this:
ASM
mov ax,dx
db $98,$90,$f8,$fc,
add eax,ecx
END;
That's actually cleaner, because this can be parsed by the assembler reader and be assembled correctly by the internal assembler.
Jonas
