#162987 - strat - Wed Sep 17, 2008 9:47 pm
I thought this
Code: |
ldrb r2, [r5]
strb r2, [r3]
ldrb r2, [r5,#1]
strb r2, [r3,#1]
ldrb r2, [r5,#2]
strb r2, [r3,#2]
ldrb r2, [r5,#3]
strb r2, [r3,#3] |
was equivalent to
Code: |
ldr r2, [r5]
str r2, [r3]
|
But while the first behaves as expected, the latter only seems to work when the data pointer (r5) is pointing to every fourth byte in the array. Can the word copy work at any alignment, or do I have to check the alignment then jump to either word, half-word, or byte copies?
p.s. this is copying from ROM data to a local array.
#162989 - Cearn - Wed Sep 17, 2008 10:06 pm
Halfword and word loads and stores need to be aligned to their respective boundaries to work properly. If they aren't, things can get a little funky.
Details can be found at http://www.arm.com/support/faqip/3661.html
#163004 - tepples - Thu Sep 18, 2008 1:11 pm
In fact, I can't think of any modern architectures other than x86 that support unaligned accesses.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#163025 - elwing - Fri Sep 19, 2008 7:28 am
tepples wrote: |
In fact, I can't think of any modern architectures other than x86 that support unaligned accesses. |
damn, that's only used 80% of the actual software :)
#163031 - Miked0801 - Fri Sep 19, 2008 3:58 pm
Bah, not where I code! Oh wait...
#163066 - tepples - Sun Sep 21, 2008 12:02 pm
elwing wrote: |
tepples wrote: | In fact, I can't think of any modern architectures other than x86 that support unaligned accesses. |
damn, that's only used 80% of the actual software :) |
You appear to be ignoring a lot of computers that you don't immediately think of as computers. As I understand it, the vast majority of 32-bit microcontrollers, set-top boxes, PDAs, phones, and the like use PowerPC (like all three consoles this gen), MIPS, ARM, or some TI DSP. I've read of only one game console (original Xbox) and one handheld (Wonderswan) that use an x86 CPU.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#163077 - silent_code - Sun Sep 21, 2008 10:06 pm
OFFTOPIC:
Isn't the biggest CPU market segment ("we're de reel mony'z at") actually in 8bit microcontrollers? (Maybe not, but then, 8bit ?Cs are still quite common, even though the trend goes in favour of 16bit, from what I understand [which, I know, is just a lousy "bit" {get the "joke"?} compared to people, who actually work with that stuff].) Didn't the industry make the "big leap" from 4bit to 8bit on a large scale "just recently"?
I'm not sure, but that's what someone told me ... "recently". (Yeah, you got me. I don't remeber when it was. Kind of between one or ... maybe up to three / four years ago? ... Oh, now I'm sorry...)
Wikipedia seems to agree witht that to a certain extend. (... I hope...)
You know, these things are, like, for fridges, toasters and toys and ... other stuff that desperately needs to be "intelligent" to do your work for you, and I don't mean that in a negative way... at least not all of it.
("Don't ferget 'em 'Nentendoos' or whut ever they call 'em!")
OK guys, I couldn't withstand! This is awesome: http://www.cpu-museum.com/14500B_e.htm
It's like "the Bit Unleashed" ...
(I hope you don't hate me now for making that reference, please?)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Mon Sep 22, 2008 8:57 pm; edited 2 times in total
#163083 - keldon - Mon Sep 22, 2008 12:20 am
silent_code wrote: |
OFFTOPIC:
Isn't the biggest CPU marked segment ("we're de reel mony'z at") actually in 8bit microcontrollers? (Maybe not, but then, 8bit ?Cs are still quite common, even though the trend goes in favour of 16bit, from what I understand [which, I know, is just a lousy "bit" {get the "joke"?} compared to people, who actually work with that stuff].) Didn't the industry make the "big leap" from 4bit to 8bit on a large scale "just recently"?
I'm not sure, but that's what someone told me ... "recently". (Yeah, you got me. I don't remeber when it was. Kind of between one or ... maybe up to three / four years ago? ... Oh, now I'm sorry...)
Wikipedia seems to agree witht that to a certain extend. (... I hope...)
You know, these things are like for fridges, toasters and toys and ... other stuff that desperately needs to be "intelligent" to do you work for you, and I don't mean that in a negative way... at least not all of it.
("Don't ferget 'em 'Nentendoos' or whut ever they call 'em!")
OK guys, I couldn't withstand! This is awesome: http://www.cpu-museum.com/14500B_e.htm
It's like "the Bit Unleashed" ...
(I hope you don't hate me now for making that reference, please?) |
I've tried putting this post through google translator, but to no avail <_<
#163084 - silent_code - Mon Sep 22, 2008 1:05 am
OFF-OFFTOPIC:
Elaboratory, please? Me not understand?
No, really, what was the question, keldon? (Imagine this said rather jokingly, not in a strict tone, as I really want to know that and I care about your comment, because I'd like to improve my posting - see? I did it again! Loooong annotation. Damn! - Or maybe it's just my broken sense of humor, but who knows? [Really, I'd appreciate some sort of elaboration... as you clearly see, that I'm in need of help. {Joking... again! :^p }])
I've fixed a few typos and I've also "enhanced" the "flow" of a few parts, if that's what you meant. That won't "enhance" the "sense" of the post, though. But right now, I'm pretty much confident that there is some sense in that piece of text. Right? (Still in a pretty relaxed mood... after all, I'm going to bed now. I'm writing this to make sure people don't get this wrong.)
Please, don't tell me, that you were just jonking. I take this serial! ;^p No, really, I do (take this serious).
I mean, why would you put that through a translator? I didn't think my English was that bad... :^(
And what kind of translation would you use for that? Non-sense (it makes pretty much sense to me, but I do know, that to others it does rather rarely) to English, English to Non-sense? ;^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
Last edited by silent_code on Mon Sep 22, 2008 8:58 pm; edited 1 time in total
#163086 - DensitY - Mon Sep 22, 2008 5:34 am
you been in the diesel again slient_code? ;)
#163090 - silent_code - Mon Sep 22, 2008 11:01 am
OFF-OFF-OFFTOPIC:
Whoot? 8^o
(If "being in the diesel" means drunk, I have to disappoint you, I do not drink [alcohol or "do stuff"].) ;^D
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#163093 - pepsiman - Mon Sep 22, 2008 11:20 am
silent_code wrote: |
(If "being in the diesel" means drunk, I have to disappoint you, I do not drink [alcohol or "do stuff"].) ;^D |
You're writing this gibberish sober?
#163099 - keldon - Mon Sep 22, 2008 3:25 pm
pepsiman wrote: |
silent_code wrote: | (If "being in the diesel" means drunk, I have to disappoint you, I do not drink [alcohol or "do stuff"].) ;^D |
You're writing this gibberish sober? |
Yes, I've ruled out alcohol, benzo's, cannabis and other depressant drugs based on the [relatively] consistent flow and spelling. Giving up on a translation I sent a transcript to my mate who works with the national health service, in the mental health department ... he says, "it's nothing out of the ordinary" ^_^
#163113 - silent_code - Mon Sep 22, 2008 8:49 pm
@strat: I am sorry this went a little out-of-hand and my post caused your thread to be polluted with offtopic matters so much.
Well, I am autistic, if that helps. And I am not a native speaker, as you could probably tell from the location I set in my profile (which should be visible to everyone - right there, on the left hand side of this and any of my posts).
I also do try to not write like a robot (which I have a tendency to do - that also applies to spoken language), but rather like "people talk". I may overdo it sometimes and I'm not very good at "writing like people". Well, at least I want to improve that "skill". :^)
Then there's also that "strange kind of humor" of mine... yeah. I'm just fooling around sometimes, so: whatever. Most of the time it's not even intended to be funny for anyone but me (and those who get it and find it funny, too).
The question remains: What's wrong with the way I write? PMs with serious suggestions for improvement are very welcome.
@pepsiman: "Gibberish?" I do feel a little bit offended. By most forum standards that is not gibberish at all. Please try to be a little bit more constructive. And btw: I am always sober. Always. (Always, always! Although sometimes, I am a little bit sleepy and then the typo count and silliness increases. ;^p )
@keldon: I still don't get the translation part and why would you send that to anyone off the UK's National Health Service, even if it's just a friend? I think that's a bit over the top, given that I still don't know what's supposed to be "wrong".
Or is this a joke of some sort, that I don't get?
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.
#163118 - keldon - Tue Sep 23, 2008 1:30 am
silent_code wrote: |
@keldon: I still don't get the translation part and why would you send that to anyone off the UK's National Health Service, even if it's just a friend? I think that's a bit over the top, given that I still don't know what's supposed to be "wrong".
Or is this a joke of some sort, that I don't get? |
Nothing wrong with how you write; in fact I never even noticed the whole Germany/Berlin thing until you mentioned. I found your post slightly amusing and I guess everyone got the same feeling there was jest involved; so I was just joking myself ^_^
#163124 - elwing - Tue Sep 23, 2008 7:55 am
that's why I edited my comments... I was first speaking of processor, but that would have been damn wrong, but try comparing the number of program you will find for x86 vs other architecture... that is frightening... on most other architecture processor you just have 1firmware and that's all... most actual codding is either portable to many architecture or x86 only, if you except previously mentioned device firmware...
#163127 - pepsiman - Tue Sep 23, 2008 12:43 pm
silent_code wrote: |
@pepsiman: "Gibberish?" I do feel a little bit offended. |
Sorry.
I find it hard to follow what you're saying when you're nesting your asides 3 levels deep.