如何在LC3中打印多个文本行

时间:2015-09-09 09:29:39

标签: lc3

我正在尝试在lc3中编写三行文本,我想用.stringz将它们打印到控制台这里是我的代码到目前为止。通过这种方式,我只能打印第一行。有什么建议吗?

; LC3 program that displays my name and id number to console
; then the user inputs two variables and they will be added 
; and the sum printed to the console
    .ORIG x3000
    LEA R0, NAME
    LEA R1, FIRST
    LEA R2, SECOND
    PUTS
    PUTS
    HALT
NAME    .STRINGZ "Thomas Collier"
FIRST   .STRINGZ "PLease enter first number between 0 and 9:"
SECOND  .STRINGZ "Please enter second number between 0 and 9:"  
    .END

1 个答案:

答案 0 :(得分:0)

它只打印存储在NAME中的字符串,因为PUTs例程只打印出R0中存储的指针指向的内容。您需要执行以下操作:

LEA R0, NAME
PUTS
LEA R0, FIRST
PUTS
LEA R0, SECOND
PUTS
HALT
相关问题