开发者

Outputting issue in assembly

开发者 https://www.devze.com 2023-04-13 07:55 出处:网络
Currently my code is this. resultLbl BYTE\"Coin Information\", 0 sumBYTE\"Number of Coins: \", 0 NumberOfDollars BYTE\"Dollars: \", 0

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

精彩评论

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

关注公众号