For the GNU assembler...
is it acceptable to do
#pragma asm
#pragma endasm
or
#pragma __asm__
#pragma endasm
For the GNU assembler...
is it acceptable to do
#pragma asm
#pragma endasm
or
#pragma __asm__
#pragma endasm
Assuming you mean GNU as, you might want to befriend the manual https://sourceware.org/binutils/docs/as/
On the other paw, assuming the above are meant to be assember directives, I haven't seen them on the manual for the few minutes I look neither have I seen the before.
Or in fact, the GNU compiler manual, for inline assembly
I guess you're trying to write a sequence of plain assembly instructions (i.e. unquoted, without asm()) in a C/C++ file.
I don't think you can do this with gcc/g++, at least not as far as I know or could find from a bit of a hunt. Sorry. Looks like you'll have to put up with the clunky syntax, use a separate file, or write a script to turn your blocks into asm()'d blocks. Have fun!
I have a long list of board initialization assembly instructions from a project and I was hoping it would be a smooth transition.
I have seen examples where asm was used like:
asm("mov #0x05,%d1");
and
asm("mov #0x05,%d1"
"mov #0x69,%eax"
"jmp off");
and this as well...
asm("mov #0x05,%d1
mov #0x69,%eax
jmp off");
I am just trying to see which is actually the best/correct way of doing it.
I would like to use the last method but i dont think it will be possible.
Well have you tried it to see if the compiler throw up an error?