What is the code to print text into a new line on assembly code, on HCS12 microcontroller using CodeWarrior?

373 views Asked by At

I need my output to be put in colons on the terminal but they always display in the first row. I need to implement a part of code (which I am trying to find out on YouTube but they are using different microprocessors and I am not very familiar with assembly language to make the difference) to make instead of a space an enter to jump to the next row.

For example, how can I print the output of this loop in a new line every time this loop runs:

Label2:
 JSR out2hex                ; print the counter
 LDAB #$3A                  ; load to B ASCII code of ":"
 JSR putchar                ;print to the screen the character
 LDAB #$24                  ; load to B the character of ASCII code of "$"
 JSR putchar                ; print to the screen the character
 LDAB A,X                   ; load to B the value of X+A
 JSR out2hex                ; print into the screen the hex value of it
 INCA                       ; increment the counter, the value in   
                            ;accumulator A
 LDAB #$82                  ; load to B the ASCII code of ","
 JSR putchar                ; print the character of it
 CMPA #20                   ; compare the counter with 20 (which represents  
                            ;the number of elements in the array
 BNE Loop2                  ; branch if the counter in A is not equal to 20     
                            ;to the Loop2
0

There are 0 answers