首页 > 解决方案 > 在使用 CodeWarrior 的 HCS12 微控制器上,将文本打印到汇编代码的新行中的代码是什么?

问题描述

我需要将我的输出放在终端上的冒号中,但它们始终显示在第一行。我需要实现一部分代码(我试图在 YouTube 上找到它,但它们使用不同的微处理器,我不太熟悉汇编语言来做出改变)来代替空格来跳转到下一行。

例如,每次循环运行时,如何在新行中打印此循环的输出:

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

标签: assemblycodewarrior68hc12

解决方案


推荐阅读