Printing 3 digits in assembly

五迷三道 提交于 2019-12-04 19:19:19

"div bx" divides dx:ax by bx. So, what is your dx?

I believe you are taking the address of "RES" instead of its value, which needs a parenthesis or bracket.

At the tens stage your remainder is in AH, not AX.

And NEVER put comments like "Save AX on the stack" or "Restore AX". Anyone with any fluency in assembler (and it's been 20 years since I've written anything in it, yet that includes me) will know what those instructions are doing.

Comments should be explaining WHY you are doing it, not what you are doing.

I'm rusty enough on this that I won't swear that there aren't more bugs, I'm just pointing out one I see.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!