开发者

Outputting issue in assembly

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

Numbe开发者_开发知识库r of Dollars: 5

Number of Cents: 30

Can anyone help? This is really bugging me


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜