9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] ARM question
@ 2005-03-10 21:55 Ronald G. Minnich
  2005-03-10 22:05 ` Russ Cox
  0 siblings, 1 reply; 9+ messages in thread
From: Ronald G. Minnich @ 2005-03-10 21:55 UTC (permalink / raw)
  To: 9fans


here's the code in c:
#include <u.h>
#include <libc.h>
y(){
	unsigned long *x;
	x = (unsigned long *) 0x4000;
	*x = (unsigned long) 0x40e;
}
main(){
	unsigned long *x;
	static unsigned long y[64];
	int i;

	x = (unsigned long *) 0x4000;
	*x = (unsigned long) 0x40e;
	x++;
	*x = (unsigned long)0x100000 + 0x40e;
	x++;
	*x = (unsigned long)0x200000 + 0x40e;
	x++;
	*x = (unsigned long)0x300000 + 0x40e;
	x++;
	*x = (unsigned long)0x400000 + 0x40e;
	x++;
	*x = (unsigned long)0x500000 + 0x40e;
	x++;
	*x = (unsigned long)0x600000 + 0x40e;
	x++;
	*x = (unsigned long)0x700000 + 0x40e;

}

And the .s
	TEXT	y+0(SB),0,$4
	MOVW	$1038,R4
	MOVW	$16384,R1
	MOVW	R4,0(R1)
	RET	,
	TEXT	main+0(SB),0,$8
	MOVW	$1049614,R10
	MOVW	$2098190,R9
	MOVW	$3146766,R8
	MOVW	$4195342,R7
	MOVW	$5243918,R6
	MOVW	$6292494,R5
	MOVW	$7341070,R4
	MOVW	$16384,R3
	MOVW	$1038,R2
	MOVW.P	R2,4(R3)
	MOVW.P	R10,4(R3)
	MOVW.P	R9,4(R3)
	MOVW.P	R8,4(R3)
	MOVW.P	R7,4(R3)
	MOVW.P	R6,4(R3)
	MOVW	R5,0(R3)
	MOVW	R4,4(R3)
	RET	,
	GLOBL	y$2<>+0(SB),R0,$256
	END	,

The code for y() I can understand.

but this:

	MOVW	$16384,R3
	MOVW	$1038,R2
	MOVW.P	R2,4(R3)

I don't get. How can R2 get stored to 16384, given the 4(R3)?

Are we pretty much agreed that the MOVW.P is a post-increment mode?

ron


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-03-11 15:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-10 21:55 [9fans] ARM question Ronald G. Minnich
2005-03-10 22:05 ` Russ Cox
2005-03-11  8:59   ` Richard Miller
2005-03-11 13:02     ` Bruce Ellis
2005-03-11 13:10       ` Charles Forsyth
2005-03-11 13:21         ` Bruce Ellis
2005-03-11 13:16     ` boyd, rounin
2005-03-11 14:56     ` Ronald G. Minnich
2005-03-11 15:04     ` boyd, rounin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).