Jump to content
  • Advertisement
Sign in to follow this  
godsenddeath

a few asm questions (NASM)

This topic is 3764 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok i've been working on bootloader/os dev stuff, and it's coming along nicely, i've just got a couple of assembly questions: 1) is there a difference between 'jmp' and 'call'? and am I right assuming you can't 'ret' from a 'jmp' instruction? 2)i see blocks proceeded by start: , loader: , and the like. these are labels right? which is basicly another name for the memory location? kind of like a pointer? 3)I see blocks preceeded by another style - .reset, .read, and .print . how do these differ from 'start:'? thanks alot

Share this post


Link to post
Share on other sites
Advertisement

1) correct
2) correct
3) labels like ".read" are labels "within" labels (they jump to different parts of labels) and can be reused under different labels

just a side note you may want to posts this on osdev.com not gameDev

Hope this helps!

Share this post


Link to post
Share on other sites
CALL places a return address on the stack. It's used to call procedures.

The RET instruction transfers control to the return address located on the stack. This address is usually placed on the stack by a call instruction.

You cannot RET from a JMP. JMP is used to simply jump to a label.

Labels are used to give easy to remember names to memory locations.

The other 'labels' you cited are probably nasm specific macros.

I suggest you read a book on asm instructions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!