The "old" Nasm manual had descriptions of the instructions - the "new" manual is just a list.
http://home.myfairpoint.net/fbkotler/nasmdocr.htmlNote the disclaimer!
This is derived from the old, obsolete, and potentially buggy instruction set reference from the old Nasm Manual. The Nasm development team explicitly disclaims any responsibility for errors and omissions in this document!
In spite of that, it may be useful to you. Doesn't mention the effect on flags. There are other, potentially better, instruction set references floating around - perhaps best to go straight to the horse's mouth, the Intel/AMD manuals... but I "rescued" this one... 'cause I'm used to it...
Right, you need to pop registers in the opposite order from which you pushed 'em. And to complete the question in the topic, "call" puts the return address on the stack, and "ret" removes it, so you do need to pop everything you pushed before you hit the "ret"!
But... do you really need to preserve all those registers? You're reloading ax and bx before each call to Print_Num, and not really using dx (in the caller), so the only thing you need to preserve is cx. Doesn't do any harm, but in a bootsector, you may want to save every byte you can, since space is limited.
Another potential "savings":
Pop_Digits:
; pop dx
; mov al, dl
pop ax
add al, 48 ; nasm has some special op for this I know.
int 16 ; video interrupt to display the value in al to screen.
loop .Pop_Digits
.Done:
There's only one stack, and you need to pop everything you pushed, but you *can* pop it into a different register than you pushed...
Nasm doesn't have any "special op" that I know of, but you could write it different ways:
add al, 48
add al, 30h
add al, '0'
... all do the same thing. Also, speaking of writing things different ways, you've called "int 10h", "int 16". This will work fine - it's the same number (bit pattern) - but it's more "usual" to use hex for interrupt numbers. They're usually documented that way. For example:
http://www.ctyme.com/rbrown.htm(if you haven't discovered Ralf Brown yet, he's your new best friend!)
You mention that it "moves too fast"... You can "hold" the display so you've got time to read it by waiting for a key-press:
mov ah, 0
int 16h ; note hex!
I understand that you can debug a bootsector by running it in an emulator - Bochs, or some other. I don't "trust" emulators to be exactly the same as "real hardware" (which differs from bios to bios), so I like to run my bootsectors on "real hardware"... so I can't advise you on emulators.
Since a bootsector is hard to debug, and for other reasons, it isn't an easy place for a beginner to start. I'd advise doing a few .com files first (if your OS supports it), but a lot of beginners like to start with a bootsector - go for it, if you wanna, but it isn't the easiest thing to do!
Best,
Frank