If I understand this correctly, it looks like dp
is set to 1, and then ram[dp]
is incremented 65 times. But ram[dp]
, aka ram[1]
, starts out holding the second character of the program, which is a carriage return character (ASCII 13). A is ASCII 65, N is ASCII 78, and 65 + 13 is 78.
Set dp
to somewhere outside of program space before you start incrementing the memory cell -- or use separate RAM to hold the program.