Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

THUMB fails to assemble instructions LDRH and LDRHT #74

Open
fdx1601 opened this issue Mar 17, 2019 · 1 comment
Open

THUMB fails to assemble instructions LDRH and LDRHT #74

fdx1601 opened this issue Mar 17, 2019 · 1 comment

Comments

@fdx1601
Copy link

fdx1601 commented Mar 17, 2019

Hi, I stumbled into this ...

THUMB assembler fails to assemble these lines:

        LDRH    R0,CONFIG       ; should load 0x5678 into R0
        LDRHT   R1,CONFIG       ; should load 0x1234 into R1

        MOV     PC,LR

        NOP

Gives these errors:

Pass 1...
Error: Unknown operands combo for 'LDRH' at src/foo.asm:11.

and

Pass 1...
Error: Unknown instruction 'LDRHT' at src/foo.asm:12

Assembling with gnu-as it gives the following object code:

   0:	f8bf 0008 	ldrh.w	r0, [pc, #8]	; c <CONFIG>
   4:	f8bf 1004 	ldrh.w	r1, [pc, #4]	; c <CONFIG>
   8:	46f7      	mov	pc, lr
   a:	bf00      	nop

0000000c <CONFIG>:
   c:	12345678 	.word	0x12345678
  10:	00000000 	.word	0x00000000

Regards.

@fdx1601
Copy link
Author

fdx1601 commented Mar 17, 2019

Just complementing the ARM Architecture Reference Manual
Thumb-2 Supplement
documentation where it says in section 1.5.1:

New T variants of LDR and STR
The ARM LDRH, LDRSB, LDRSH and STRH instructions now have T variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant