Re[3]: [Gc] Powerpc/m68k issue running test_stack
Thorsten Glaser
tg at mirbsd.de
Sun Sep 23 07:36:08 PDT 2012
Ivan Maidanski dixit:
>Is cas.l asm instruction supported on ARAnyM emulator?
Yes, even recently fixed AFAIK, hence my version numbering
recommendation. I just wrote a small test program to see
whether it really matches the description in the M68000PRM
(and yes, it does):
root at aranym:~ # gcc -o t t1.c t2.S
root at aranym:~ # ./t
#1: cmp(1->1) new(2) val(1->2)
#2: cmp(3->2) new(4) val(^->2)
root at aranym:~ # cat t1.c
#include <stdio.h>
volatile int v __attribute__((__aligned__(4)));
extern int cas_l(int cmpval, int newval, volatile int *valptr);
int
main(void)
{
int rv;
v = 1;
rv = cas_l(1, 2, &v);
printf("#1: cmp(1->%d) new(2) val(1->%d)\n", rv, v);
rv = cas_l(3, 4, &v);
printf("#2: cmp(3->%d) new(4) val(^->%d)\n", rv, v);
return (0);
}
root at aranym:~ # cat t2.S
.text
.globl cas_l
cas_l: move.l 4(%sp),%d0
move.l 8(%sp),%d1
move.l 12(%sp),%a0
cas.l %d0,%d1,(%a0)
rts
bye,
//mirabilos
--
> emacs als auch vi zum Kotzen finde (joe rules) und pine für den einzig
> bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)
Hallooooo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls
... pine-User, und das auch noch gewohnheitsmäßig ("Oooooooohhh"). [aus dasr]
More information about the Gc
mailing list