The x86 instruction "jmp $" is to jump current location.
The character ‘$’ in jump instructions indicates current location.
In Andes assembly, we recommend you use the statement:
Code:
1: b 1b
But the instruction "j 0" also works.
Code:
Attachment:
1.gif [ 10.35 KiB | Viewed 16420 times ]
Objdump:
Attachment:
2.gif [ 11.9 KiB | Viewed 16420 times ]
There is a warning just remind you that absolute address is dangerous.
Code:
nds32le-elf-gcc -D__ASSEMBLY__ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/crt0.d" -MT"src/crt0.d" -o "src/crt0.o" "../src/crt0.S"
../src/crt0.S: Assembler messages:
../src/crt0.S:215: Warning: Branch instruction 'j 0' with absolute offset is dangerous.
Finished building: ../src/crt0.S
Attachment:
3.gif [ 9.09 KiB | Viewed 16420 times ]
Sample code:
Attachment:
demo-int-j.zip [141.41 KiB]
Downloaded 1510 times