How do I print an integer in Assembly Level Programming without printf from the c library?

后端 未结 5 1420
予麋鹿
予麋鹿 2020-11-22 00:07

Can anyone tell me the purely assembly code for displaying the value in a register in decimal format? Please don\'t suggest using the printf hack and then compile w

5条回答
  •  醉酒成梦
    2020-11-22 00:21

    1 -9 are 1 -9. after that, there must be some conversion that I don't know either. Say you have a 41H in AX (EAX) and you want to print a 65, not 'A' without doing some service call. I think you need to print a character representation of a 6 and a 5 whatever that might be. There must be a constant number that can be added to get there. You need a modulus operator (however you do that in assembly) and loop for all digits.

    Not sure, but that's my guess.

提交回复
热议问题