--- title: "Tas>MS (Machine Code Version)" id: 77526 type: "computer_media" slug: "tasms-machine-code-version" url: "http://localhost/computer_media/tasms-machine-code-version/" markdown_url: "http://localhost/computer_media/tasms-machine-code-version.md" published_at: "2026-11-15T18:38:06+00:00" modified_at: "2026-11-15T18:38:06+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "An 86-byte machine-code routine that converts Tasword files to MScript format, with a checked DATA loader and a Larken disk front end." post_tag: - name: "LKDOS" slug: "lkdos" taxonomy: "post_tag" url: "http://localhost/tag/lkdos/" - 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: "Steve Gunhouse" slug: "steve-gunhouse" taxonomy: "indiv" url: "http://localhost/indiv/steve-gunhouse/" genre: - name: "Word Processor" slug: "word-processor" taxonomy: "genre" url: "http://localhost/type/word-processor/" media_type: "Program" programmers: - name: "Steve Gunhouse" slug: "steve-gunhouse" taxonomy: "indiv" url: "http://localhost/indiv/steve-gunhouse/" mediadate: "1990" article_media: - id: 23207 title: "Letter from Steve Gunhouse: Tasword -> MScript" type: "article" url: "http://localhost/article/letter-from-steve-gunhouse-tasword-mscript/" media_type_tags: "Word Processor" license: false --- # Tas>MS (Machine Code Version) Converts a Tasword II text file into an MScript file with an 86-byte machine-code routine at 65280, a rewrite of Bob Mitchell’s compiled Tas>MS. It removes the spaces at the ends of lines, starts a new paragraph (CHR$ 13) wherever a line begins with a space, and returns the length of the result; an 18000-byte file takes about a second. Three listings: a pseudo-assembly listing of the two routines, the DATA loader (it checks a weighted sum of the bytes before saving the code) and the BASIC that loads a .CT file, converts it and saves the result. Listing only: every file operation (CAT, LOAD and SAVE of the .CT files and of the code) uses the Larken disk system (RANDOMIZE USR 100). The machine code itself does not use LKDOS. Published in Sinc-Link July-August 1990 ([Letter from Steve Gunhouse: Tasword -> MScript](https://timexsinclair.com/article/letter-from-steve-gunhouse-tasword-mscript/)). ## Source Code ``` Machine Code: (for unjustified text) First Routine: clear buffer FF00 21 00 6C :HL = 27648 (Start of Tasword memory area) FF03 54 :D = H FF04 5D :E = L FF05 13 :DE = DE+1 FF06 36 20 :POKE HL,32 (CODE " ") FF08 01 00 4B :BC = 19200 FF0B ED B0 :Block Move FF0D C9 :RETURN (to BASIC) Second Routine: Reformat file FF14 21 FF B6 :HL = 46847 FF17 3E 20 :A = 32 (CODE " ") FF19 2B :HL = HL-1 FF1A BE :IF A = PEEK HL (A is CODE " " throughout) FF1B 28 FC :THEN GOTO FF19 FF1D 23 :HL = HL+1 FF1E 22 56 FF :POKE 65366,HL FF21 21 00 6C :HL = 27648 (Start of Tasword text file) FF24 11 4F B7 :DE = 46927 (Start of MScript memory area) FF27 06 00 :B = 0 FF29 0E 40 :C = 64 FF2B BE :IF A <> PEEK HL FF2C 20 06 :THEN GOTO FF34 FF2E EB :Exchange DE and HL FF2F 2B :HL = HL-1 FF30 36 0D :POKE HL,13 FF32 23 :HL = HL+1 FF33 EB :Exchange DE and HL FF34 ED B0 :Block Move FF36 EB :Exchange DE and HL FF37 2B :HL = HL-1 FF38 BE :IF A =PEEK HL FF39 28 FC :THEN GOTO FF37 FF3B 23 :HL = HL+1 FF3C 77 :POKE HL,A FF3D 23 :HL = HL+1 FF3E E5 :PUSH HL FF3F 2A 56 FF :HL = PEEK 65366 FF42 A7 :A = A AND A (Clear carry) FF43 ED 52 :HL = HL-DE FF45 E1 :POP HL FF46 EB :Exchange DE and HL FF47 30 E0 :IF DE <= End THEN GOTO FF29 FF49 EB :Exchange DE and HL FF4A 11 4F B7 :DE = 46927 FF4D 36 00 :POKE HL,0 FF4F 23 :HL = HL+1 FF50 A7 :A = A AND A (Clear carry) FF51 ED 52 :HL = HL-DE FF53 44 :B = H FF54 4D :C = L FF55 C9 :RETURN (to BASIC) ML loader program: 10 LET t=0 100 FOR i=1 TO 86 110 READ a 120 POKE 65279+i,a 130 LET t=t+i*a 140 NEXT i 150 IF t<>428022 THEN BEEP 1,1: PRINT "Error in DATA!": STOP 200 RANDOMIZE USR 100: SAVE "Tas>MS.Cm" CODE65280,86 500 DATA 33,0,108,84,93,19,54,32,1,0 510 DATA 75,237,176,201,0,0,0,0,0,0 520 DATA 33,255,182,62,32,43,190,40,252,35 530 DATA 34,86,255,33,0,108,17,79,183,6 540 DATA 0,14,64,190,32,6,235,43,54,13 550 DATA 35,235,237,176,235,43,190,40,252,35 560 DATA 119,35,229,42,86,255,167,237,82,225 570 DATA 235,48,224,235,17,79,183,54,0,35 580 DATA 167,237,82,68,77,201 BASIC program to control ml 100 RANDOMIZE USR 65280 110 RANDOMIZE USR 100: CAT ".CT", 200 INPUT "File Name? ";LINE n$ 210 IF n$="" OR LEN n$>6 THEN GOTO 200 220 RANDOMIZE USR 100: LOAD n$+".CT"CODE 27648 250 LET len=USR 65300 260 INPUT "SAVE file as: ";LINE s$ 270 IF s$="" THEN LET s$=n$ 280 IF LEN s$>6 THEN GOTO 260 290 RANDOMIZE USR 100: SAVE s$+".CT"CODE 46927,len 300 PRINT #1;"LOAD another file? (Y/N)" 310 PAUSE 0: LET s$=INKEY$: IF s$="Y" OR s$="y" THEN GOTO 100 320 IF s$="N" OR s$="n" THEN STOP 330 GOTO 310 9800 RANDOMIZE USR 100: LOAD "Tas>MS.Cm"CODE 9810 GOTO 100 9900 RANDOMIZE USR 100: SAVE "Tas>MS.Bm"LINE 9800 9910 RANDOMIZE USR 100: SAVE "Tas>MS.Cm"CODE 65280,86 ```