This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with assembler

AREA bob, CODE
b main
org 0
main
nop
nop
nop
nop
nop
loop:
b loop
END

with this code I get the following message
*** ERROR L138: CODE GENERATION: PROBLEM WHEN PROCESSING INSTRUCTIONS
CAUSE: ORG: offset below current offset

How do I fix this?

Parents
  • [You forgot to select a Toolset -- this looks like ARM, so that's what I selected...]

    The following is an educated guess, made without actually knowing ARM assembly language: This snippet tries to write two opcodes to address zero: the "b main" ends up there because its outside any relocatable segment, and then you're trying to write other code to it, following the 'org 0'. It's only natural that the tools don't think of that as a good idea.

    ORG should, generally, only appear at the start of a segment, and it may only position forward, not backward, inside the same segment.

Reply
  • [You forgot to select a Toolset -- this looks like ARM, so that's what I selected...]

    The following is an educated guess, made without actually knowing ARM assembly language: This snippet tries to write two opcodes to address zero: the "b main" ends up there because its outside any relocatable segment, and then you're trying to write other code to it, following the 'org 0'. It's only natural that the tools don't think of that as a good idea.

    ORG should, generally, only appear at the start of a segment, and it may only position forward, not backward, inside the same segment.

Children
No data