汇编中的输出问题

发布于 2024-12-10 03:43:55 字数 618 浏览 0 评论 0原文

目前我的代码是这样的。

resultLbl BYTE  "Coin Information", 0
sum     BYTE    "Number of Coins: ", 0
NumberOfDollars BYTE    "Dollars: ", 0
NumberOfCents   BYTE    "Cents: ", 0

        dtoa    sum, ebx       ; convert to ASCII characters
        dtoa    NumberOfDollars, ecx    ; convert to ASCII characters
        dtoa    NumberOfCents, edx      ; convert to ASCII characters
        output  resultLbl, sum        ; output label and sum

我遇到了一个问题,因为我希望它的输出方式是一个窗口,但有 3 个不同的行。我不知道如何在三个单独的行上输出。 这是我希望输出的样子。

硬币信息

硬币数量:50

美元数量:5

美分数量:30

有人能帮忙吗?这真让我烦恼

Currently my code is this.

resultLbl BYTE  "Coin Information", 0
sum     BYTE    "Number of Coins: ", 0
NumberOfDollars BYTE    "Dollars: ", 0
NumberOfCents   BYTE    "Cents: ", 0

        dtoa    sum, ebx       ; convert to ASCII characters
        dtoa    NumberOfDollars, ecx    ; convert to ASCII characters
        dtoa    NumberOfCents, edx      ; convert to ASCII characters
        output  resultLbl, sum        ; output label and sum

I'm having an issue because the way I want it to output is a single window, but 3 different lines. I don't know how to output on three seperate lines.
Here is how I would like my output to look.

Coin Information

Number of Coins: 50

Number of Dollars: 5

Number of Cents: 30

Can anyone help? This is really bugging me

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挖个坑埋了你 2024-12-17 03:43:55
resultLbl BYTE  "Coin Information", 0
sum     BYTE    "Number of Coins: ", 0
NumberOfDollars BYTE    "Dollars: ", 0
NumberOfCents   BYTE    "Cents: ", 0

您正在终止字符串,不带任何附加字符。

试试这个:

resultLbl BYTE  "Coin Information",0Dh,0Ah,0
sum     BYTE    "Number of Coins: ",0Dh,0Ah,0
NumberOfDollars BYTE    "Dollars: ",0Dh,0Ah,0
NumberOfCents   BYTE    "Cents: ",0Dh,0Ah,0
resultLbl BYTE  "Coin Information", 0
sum     BYTE    "Number of Coins: ", 0
NumberOfDollars BYTE    "Dollars: ", 0
NumberOfCents   BYTE    "Cents: ", 0

You are terminating your strings with no additional character.

Try this:

resultLbl BYTE  "Coin Information",0Dh,0Ah,0
sum     BYTE    "Number of Coins: ",0Dh,0Ah,0
NumberOfDollars BYTE    "Dollars: ",0Dh,0Ah,0
NumberOfCents   BYTE    "Cents: ",0Dh,0Ah,0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文