Search code examples
assemblylc3

Alternate ways to print strings on separate lines using LC-3 assembly language


I was wondering if there was another way to print multiple strings on separate lines other than using "\n" at the end of a string, like shown below?

        .ORIG x4000

        LEA R0, K1

        TRAP x22

        LEA R0, K2

        TRAP x22

        TRAP x25

    K1      .STRINGZ "Happy\n"

    K2      .STRINGZ "Birthday\n"

Solution

  • you would fill up to screed width manually (e.g. on a 10 char screen print out "abc def" (with 7 spaces) instead of "abc\n" and "def"