Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-07

Inline assembler.

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

peter green

Is it possible to tell the inline assembler to output something to the resulting assembler file even though it doesn't recognise the opcode?

Reply by email

Jonas Maebe
to peter green
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.

Jonas

Reply by email

Konstantin
to Jonas Maebe
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

Reply by email

Jonas Maebe
to 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

Reply by email