--- title: "Entering and Recalling Text in Machine Code" id: 77397 type: "computer_media" slug: "entering-and-recalling-text-in-machine-code" url: "http://localhost/computer_media/entering-and-recalling-text-in-machine-code/" markdown_url: "http://localhost/computer_media/entering-and-recalling-text-in-machine-code.md" published_at: "2026-11-15T18:38:58+00:00" modified_at: "2026-11-15T18:38:58+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/entering-and-recalling-text-1.png" excerpt: "Stores up to 277 characters of messages above 55224 and prints them back with a 34-byte machine-code routine." post_tag: - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Dennis Jurries" slug: "dennis-jurries" taxonomy: "indiv" url: "http://localhost/indiv/dennis-jurries/" genre: - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" programmers: - name: "Dennis Jurries" slug: "dennis-jurries" taxonomy: "indiv" url: "http://localhost/indiv/dennis-jurries/" mediadate: "1991" images: - url: "http://localhost/wp-content/uploads/2026/11/entering-and-recalling-text-1.png" - url: "http://localhost/wp-content/uploads/2026/11/entering-and-recalling-text-2.png" article_media: - id: 23548 title: "Entering and Recalling Text in Machine Code" type: "article" url: "http://localhost/article/entering-and-recalling-text-in-machine-code/" media_type_tags: "Utility" license: false --- # Entering and Recalling Text in Machine Code A subroutine that stores up to 277 characters of messages in memory above 55224 and prints any one of them back with a short machine-code routine (CALL 4656 to open the channel, then RST 16 for each character). Part 1 POKEs the routine to 55501; part 3 asks for each message and stores it with an end marker; part 2 prints messages 1 to z, one per key press, on the bottom line (POKE 55502,2 prints at the top instead). The text and code can then be saved with SAVE “mssg” CODE 55224,350. Part 1 POKEs the routine, part 3 stores the text and part 2 recalls it. As printed, the loader stops one byte short (55533), so the routine’s final RET is never POKEd and recalling a message crashes the computer. Published in Sinc-Link May-June 1991 ([Entering and Recalling Text in Machine Code](https://timexsinclair.com/article/entering-and-recalling-text-in-machine-code/)). ## Source Code ``` Part 1: machine code loader 10 FOR x=55501 TO 55533 20 READ z: POKE x,z 30 NEXT x 40 DATA 62,0,205,48,18,225,70,35,229,33,183,215,126,35,254,128,56,250,16,248,126,35,254,128,200,215,24,248,201,205,205,216,1,201 Parts 2 and 3: recall and enter text 10 FOR x=1 TO z 20 POKE 55533,x 30 RANDOMIZE USR 55530 40 PAUSE 0 50 NEXT x 60 STOP 100 LET z=1: LET j=55224: LET a$="" 110 PRINT "Input text (limit 32 characters if you want to print text on the 24th line only). Press enter when finished with text." 120 PRINT 130 GO SUB 300 140 INPUT a$ 150 IF LEN a$>=55500-j THEN PRINT AT 0,0;"Text too long. Input text.": CLS : LET j=j-LEN a$: LET z=z-1: GO TO 110 160 FOR i=1 TO LEN a$ 170 POKE j,CODE a$(i) 180 IF j<55500 AND i=LEN a$ THEN POKE j+1,128 190 IF j<55500 AND i=LEN a$ THEN LET j=j+1 200 IF j<55500 THEN LET j=j+1 210 NEXT i 220 LET z=z+1 230 GO SUB 400 240 LET z=z-1 250 STOP 300 PRINT "TEXT #";z;" ";277-LEN a$;" characters remaining." 310 RETURN 400 PRINT 410 PRINT "More text? (y/n)" 420 PAUSE 0 430 IF INKEY$="y" OR INKEY$="Y" THEN CLS : GO TO 110 440 RETURN Part 4: op codes 55501 LD A,0 55503 CALL 4656 55506 POP HL 55507 LD B,(HL) 55508 INC HL 55509 PUSH HL 55510 LD HL,55223 55513 LD A,(HL) 55514 INC HL 55515 CP 128 55517 JR C,55513 55519 DJNZ B,55513 55521 LD A,(HL) 55522 INC HL 55523 CP 128 55525 RET Z 55526 RST 16 55527 JR 55521 55529 RET 55530 CALL 55501 55533 01 55534 RET ```