From: Thorsten O. <ad...@th...> - 2024-04-04 10:24:42
|
On Donnerstag, 4. April 2024 12:07:55 CEST Miro Kropáček wrote: > But that requires getting rid of those "short _a = (short)(a);" first No, that does not matter: $ cat foo.c static void test(int x, int y) { short _x = x; short _y = y; __asm__ volatile( "movw %0,%%sp@-\n\t" "movw %1,%%sp@-\n\t" "trap #14\n\t" "addq.l #4,%%sp\n" : : "ri"(_x), "ri"(_y) : "d1", "d2", "a0", "a1", "a2", "cc", "memory"); } void test2(int x) { test(x, 100); } $ m68k-atari-mint-gcc -S -O2 -fomit-frame-pointer -o - foo.c _test2: move.l %a2,-(%sp) move.l %d2,-(%sp) move.l 12(%sp),%d0 movw %d0,%sp@- movw #100,%sp@- trap #14 addq.l #4,%sp move.l (%sp)+,%d2 move.l (%sp)+,%a2 rts |