flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > [fasmarm] arm mov instruction

Author
Thread Post new topic Reply to topic
Ptarmigan



Joined: 29 Jul 2010
Posts: 4
Ptarmigan 03 Sep 2010, 22:49
Why does
mov r9,0xff00
work while
mov r9,#0xff,8

not work? they both both have to shift the 8 bit immediate value left as the instruction runs......
Any time I add a third parameter I get this error:

error: Third parameter is invalid.

Shocked

fozzie
Post 03 Sep 2010, 22:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 04 Sep 2010, 00:43
fasmarm does not support a third parameter for mov. Do you think I should add it? I've never seen anyone use it before.

Although be careful, the shift is actually a right rotation. So it should be mov r9,0xff,24
Post 04 Sep 2010, 00:43
View user's profile Send private message Visit poster's website Reply with quote
Ptarmigan



Joined: 29 Jul 2010
Posts: 4
Ptarmigan 04 Sep 2010, 01:15
revolution wrote:
fasmarm does not support a third parameter for mov. Do you think I should add it? I've never seen anyone use it before.

Although be careful, the shift is actually a right rotation. So it should be mov r9,0xff,24


you should add or document that it is missing in the compatibility section. As I understand it mov is to the left and mvn is to the right, but I may have it backwords....

mov and the missing pseudo-intructions are the two biggest things I tripped over in learning fasmarm. Most of the text books I have on arm use the 3 parameter form.... I think the explicit form reinforces the instruction's limitation better.

thanks
Post 04 Sep 2010, 01:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 04 Sep 2010, 01:30
mov is a direct move.
mvn is an inverted move.

And the shift is a right-rotation, always, for both mov and mvn.
Post 04 Sep 2010, 01:30
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 04 Sep 2010, 04:31
Ptarmigan wrote:
Most of the text books I have on arm use the 3 parameter form.... I think the explicit form reinforces the instruction's limitation better.
IIRC, revolution convinced ARM to open up some docs. Although I'm not too much of a manual reader either, you may find it helpful. You have to register though...

Links can be found at arm.flatassembler.net, if you can bare revolution's web page long enough to find them Razz.Seriously though, I would so fix that for you. I had a class in web design last year. It's nice to take a break from algorythmic thinking every once in a a while.
Post 04 Sep 2010, 04:31
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 04 Sep 2010, 04:39
Tyler wrote:
Seriously though, I would so fix that for you.
I didn't realise it was broken. Thanks for pointing it out, I have now fixed the links.
Post 04 Sep 2010, 04:39
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 04 Sep 2010, 04:57
No, I meant your page sucks... Razz The links are and were correct.
Post 04 Sep 2010, 04:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 04 Sep 2010, 05:01
Tyler wrote:
No, I meant your page sucks...
I'm not much into graphical design stuff. Maybe you already guessed that. Wink
Post 04 Sep 2010, 05:01
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 04 Sep 2010, 05:10
I noticed your source is very linear, much like asm. I'm guessing that's probably not a coincidence.

Edit: For someone not into web design, you know standards pretty well. You'd be surprised how many people in my class, at a community college, couldn't figure out that it's <br /> not <br>. Even the professor used <br> in all his examples.
Post 04 Sep 2010, 05:10
View user's profile Send private message Reply with quote
ass0



Joined: 31 Dec 2008
Posts: 518
Location: ( . Y . )
ass0 04 Sep 2010, 05:50
<br> is for SGML (HTML), while <br/> is XML compliant (XHTML).

Did you pay to learn web design?
Anyway i think i am so used to only pay for internet as a source of knowledge that everything else seems to me, a waste of money. =D

_________________
Image
Nombre: Aquiles Castro.
Location2: about:robots
Post 04 Sep 2010, 05:50
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 04 Sep 2010, 14:53
> <br> is for SGML (HTML), while <br/> is XML compliant (XHTML).
Okay, you got me. I was an entry level course. Embarassed But to be fair, the class was all about XML and XSLT. See.

> Did you pay to learn web design?
I would've had to pay if I weren't in HS. The college has an agreement with my HS to let us take college classes for free.

Quote:
Anyway i think i am so used to only pay for internet as a source of knowledge that everything else seems to me, a waste of money. =D
I agree. It seem backwards to me how academia validates knowledge and experience. There should be accepted alternative to spending money and time to get a piece of paper saying you know what knew before you took the class.
Post 04 Sep 2010, 14:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 08 Sep 2010, 11:44
I have updated fasmarm to support the byte,rotation syntax in v1.17
Post 08 Sep 2010, 11:44
View user's profile Send private message Visit poster's website Reply with quote
Ptarmigan



Joined: 29 Jul 2010
Posts: 4
Ptarmigan 08 Sep 2010, 20:43
thanks a bunch!
Post 08 Sep 2010, 20:43
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20302
Location: In your JS exploiting you and your system
revolution 09 Sep 2010, 04:36
Just to be clear, the op reg,byte,rot and op reg,reg,byte,rot syntax is only valid in ARM mode and is valid for all the following functions:

adc, add, and, bic, cmn, cmnp, cmp, cmpp, eor, mov, mvn, orr, rsb, rsc, sbc, sub, teq, teqp, tst, tstp

See the file "\ARMDOC\InstructionFormatsARM.asm" for the examples of how and where it can be used.
Post 09 Sep 2010, 04:36
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.