0

I can't seem to print the banner A, the # is all on the same line. I am not allowed to edit the string by adding CR nor LF. Help pls!

     START:                  ; first instruction of program

loop
move.b #5,D0
trap #15

lea str,A1
move.b #0,D0
trap #15

bra loop


SIMHALT             ; halt simulator


             str
              dc.b '    #     '
              dc.b '   # #    '
              dc.b '  #   #   '
              dc.b ' #     #  '
              dc.b ' #######  '
              dc.b ' #     #  '
              dc.b ' #     #  '





END    START        ; last line of source
HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Randy
  • 11
  • 3

1 Answers1

0

I have spotted a few things in your code.

When you are passing a task number to the trap 15 call you should store it using move.w, this will ensure that only the value you intend is received by the trap handler. If the register had previously had a number like $12345678 assigned to it, move.b #0,Dr would leave it containing $12345600 and the trap handler would take the task number as being $5600 rather than 0.

In your call for task 0 to display the string held in A1, you have not specified a length of string to display in D1 (as per the manual), this again should be word length. The manual does say that it stops on a NULL, but this is referring to reading a NULL character in the string, not in D1.

So your code becomes:

loop
    move.w #5,D0
    trap #15

    lea str,A1
    move.w #0,D0   ; Display string action
    move.w #70,d1  ; Maximum number of characters to display
    trap #15

    bra loop
Graeme
  • 1,643
  • 15
  • 27