This is probably an easy one, but I'm stumped.
I want to run this ZX Spectrum Hello World routine on my Sinclair ZX Spectrum 48k.
I'm going to describe all the steps I took so it's easier to see where the problem lies.
1) I didn't change the default RAMTOP, so I started my routine at 65415.
2) I translated the hex codes into decimal like so:
ld a, 2 ; 3E 02 ; => 62 2
call CHAN_OPEN ; CD 01 16; => 205 1 22
ld de, text ; 11 0E 7F; => 17 14 127
ld bc, textend-text ; 01 0E 00; => 1 14 0
jp PRINT ; C3 3C 20; => 195 60 32
defb 'Hello, World!' ; 48 65 6C 6C 6F 2C 20 57
; 6F 72 6C 64 21; => 72 101 108 108 111 44 32 87 111 114 108 100 33
defb 13 ; 0D; => 13
3) I wrote a short basic program to put the code into memory:
10 FOR I=65415 TO 65535
20 PRINT I,
30 INPUT C
40 POKE I,C
50 PRINT C,
60 NEXT I
4) And one to check it was in place
10 FOR I=65415 TO 65535
20 PRINT I, PEEK(I),
30 NEXT I
5) I ran it with
RANDOMIZE USR 65415
The good news is that the routine ran & exited, but instead of "Hello, World!", it printed ?????????????
6) For debugging I checked my hex to decimal calculations and made sure I hadn't missed anything. I also checked the character codes for the alphabet letters in the user manual.
So my question is: Why did this not produce "Hello, World!" printed to screen as desired?