From: "Ronald G. Minnich" <rminnich@lanl.gov>
To: 9fans@cse.psu.edu
Subject: [9fans] ARM question
Date: Thu, 10 Mar 2005 14:55:37 -0700 [thread overview]
Message-ID: <Pine.LNX.4.58.0503101453470.13080@enigma.lanl.gov> (raw)
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
next reply other threads:[~2005-03-10 21:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-10 21:55 Ronald G. Minnich [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0503101453470.13080@enigma.lanl.gov \
--to=rminnich@lanl.gov \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).