flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 02 Jun 2012, 07:38
Using the "=" format of the LDR opcode is a pseudo instruction. You won't find it in the CPU manual because the CPU does not support it.
With that in mind: To follow the fasm paradigm this type of thing is best suited to using a macro. The "=" form involves two parts. 1) the instruction is converted to an ordinary LDR reg,[PC+offset] and, 2) later the compiler must find a place to insert the literal constant into the output file. It is the second part that must be properly coordinated by the macro. The assembler cannot determine the appropriate place to insert the literal constant value. Simply inserting a constant randomly into the output can cause problems if it is not properly done with the overall control by the programmer. Often this is controlled by the use of proc/endp to signal that it is safe to insert values between such pairs. But proc/endp are also macros and the assemlber has no such knowledge of their inner workings to be able to do automatic insertions. Moving to non-x86 section |
|||
![]() |
|
mark4th 02 Jun 2012, 08:11
Yes,the =literal syntax is like a forward ref to a local lable. the assembler should be able to remember all these forward references and the USER should define where they get resolved with a .ltorg directove or ltorg (that dot always looked FUNKY to me too).
as with local labels this literal pool needs to be within a certain distance of the code referencing it and if its out of range we could have a "pool out of range" error here. i dont think this would be too difficult to implement, after all you already have local labels! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.