This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi folks;
I'm practicing my MSP430 assembly language skills and came across something I'm not sure of.
In a program I tried the following to test the value in r6.
cmp r6,#0x00
When I use objdump with the -d option, it produces a simple disassembly.
The disassembly from objdump includes the following:
f816: 03 96 .word 0x9603; ????
In looking at references the instruction appears to be encoded correctly, also the program simulated correctly with msp430-elf-gdb. It's just that objdump was not able to properly decode the instruction. The processor is the MSP430G2231
The situation is strange as a few instructions later another compare instruction is properly handled
f81a: 06 95 cmp r5, r6
Please take a look into objdump. I inserted the program source below.
Much thanks in advance;
; main.S - ex06 - Dec. 2, 2015
.file "main.S"
#include "asminc.h"
.data
RamAdx: .fill 1
.text
_start: mov.w #WDTPW|WDTHOLD,&WDTCTL
mov.w #__stack,SP
mov.w #List,r4
clr r5
top: mov.b @r4,r6
cmp r6,#0x00
jeq done
cmp r5,r6
jlo pass
mov r6,r5
pass: inc r4
jmp top
done: jmp done
List: .byte 0x12,0x24,0x18,0x43,0x16,0x00
.section ".resetvec","ax",@progbits
.word _start
Thanks for reporting the problem. I notified the msp430 GCC tools experts at Red Hat.
Thanks and regards,
-George
It's not strictly necessary. Typically you just adjust the constant:
CMP #1, R12 JGE case_not_le_zero MOV #2, R13 ; if (R12 <= 0) ... case_not_le_zero: