flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > [fasmarm] rpi lower16 upper16 |
Author |
|
revolution 13 Mar 2017, 09:59
Assuming you are using 32-bit code then:
Code: macro movlit reg,value { movw reg,(value) and 0xffff movt reg,(value) shr 16 } movlit r0,0x12345678 |
|||
13 Mar 2017, 09:59 |
|
shailesh 13 Mar 2017, 13:10
Thanks! Worked like a charm. The and and shr commands are, I am assuming, compiler specific. Can I find info about them in the fasm documentation? It wold be interesting to see what other commands I can use for implementing macros.
|
|||
13 Mar 2017, 13:10 |
|
revolution 13 Mar 2017, 13:38
fasmarm uses all the same operators as fasm. You'll need to check the fasm documentation for the basic assembler things and the specific fasmarm documentation for the ARM related stuff.
In essence you'll get: and or xor not shl shr bsr * / + - etc. See the fasm manual for the precedence rules. |
|||
13 Mar 2017, 13:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.