Andes Workshop

It is currently Fri Mar 29, 2024 1:11 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: jump current location
PostPosted: Wed Oct 15, 2014 6:17 am 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
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
1.gif [ 10.35 KiB | Viewed 14712 times ]

Objdump:
Attachment:
2.gif
2.gif [ 11.9 KiB | Viewed 14712 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
3.gif [ 9.09 KiB | Viewed 14712 times ]


Sample code:
Attachment:
demo-int-j.zip [141.41 KiB]
Downloaded 1187 times


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group