我正在尝试用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发布于 2015-09-16 04:13:26
它只打印存储在NAME中的字符串,因为out例程只打印存储在R0中的指针所指向的内容。您需要执行以下操作:
LEA R0, NAME
PUTS
LEA R0, FIRST
PUTS
LEA R0, SECOND
PUTS
HALThttps://stackoverflow.com/questions/32475878
复制相似问题