--- title: "Useful ROM Routines in the TS 2068" type: "article" slug: "useful-rom-routines-in-the-ts-2068" url: "http://localhost/article/useful-rom-routines-in-the-ts-2068/" markdown_url: "http://localhost/article/useful-rom-routines-in-the-ts-2068.md" published_at: "2022-01-24T02:56:48+00:00" modified_at: "2026-08-09T11:23:18+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "Assembly routines that enable error reporting, character printing, beeping, screen manipulation, drawing, string handling, and numeric operations efficiently." category: - name: "Sinc-Link" slug: "sinc-link" taxonomy: "category" url: "http://localhost/category/periodicals/sinc-link/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "Reference" slug: "reference" taxonomy: "post_tag" url: "http://localhost/tag/reference/" - 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/" publication_r: id: 10240 title: "Sinc-Link" type: "periodical" url: "http://localhost/periodical/sinc-link/" volume: "4" issue: "5" issues_articles: - id: 38197 title: "Sinc-Link v4 n5" type: "issue" url: "http://localhost/issue/sinc-link-v4-n5/" pages: "9,11" pubdate: "September/October 1986" archive_link: false --- # Useful ROM Routines in the TS 2068 **RST 8 (or CALL 8) – Report an error.** : This causes the routine to halt, and report the error whose code is one MORE than the following byte. E.g. RST 8 DEFB 8 is a STOP (Error 9). DEFB 9 for ERROR A, etc. Useful for programming your own error reports. **RST (or CALL) 10H – Print CHR$(A)** : Prints the character whose code is in A to the current output stream. This can be used with all the “control characters” listed in the character set, followed by loading any necessary operand or operands into A and using another RST 10. I found that TAB requires two operands like AT, even though the second makes no difference! **CALL 436 H – BEEP** : To do a BEEP X,Y, and Y must have been successively placed on the calculator stack with the routines for that purpose. E.g. BEEP 1,30 LD A,1 CALL 30E6 LD A,30 CALL 30E6 CALL 0436H **CALL 73F – PRINT MESSAGE** : A very useful routine for handling “ragged” message tables. The table should be at address TABLE, starting with a byte 80H, and with the last character of each message “inverted” by adding 128 to its code to mark the end. The routine is called with TABLE in DE, and the message number in A (The first message is “0”). **CALL 8A6 – CLS CALL 8A9 – CLEAR LOWER SCREEN CALL 939H – SCROLL CALL 938 – PART SCROLL** : Scrolls the bottom “B” lines, leaving the screen above intact. **CALL 97F – PART CLEAR** : Similar to the last, but CLEARS the bottom B lines. **CALL 26EE – DRAW X, Y,Z** : The parameters must be stacked, and H’L’ saved as for CIRCLE. **CALL 2813 – DRAW X,Y** : CALL with ABS x 1n C. ABS Y in B, SGH X in E, and SGN Y in D; and save H’L’ as above. **CALL 2E70 – STACK STRING** : Passes the “parameters” of & string to the calculator stack as an argument for string functions. At entry, A holds i if the string is “simple”. O if it is DiMensioned or a slice; DE holds the string address; and BC holds the length. **CALL 2EB2 – MULTIPLY 16** : This multiplies HL by DE, giving “Out of Memory” if the result overflows. **CALL 2FAF – UNSTACK STRING** : Retrieves the “parameters” of a string result from the calculator stack; address to DE, length to BC. **CALL 3046H – ALPHANUM** : Returns with CARRY if A holds the code of a letter or digit, NO CARRY otherwise. **CALL 3046 – ALPHA** : Returns CARRY if A holds a valid letter code. **CALL 30D9 – NUMERIC** : Returns with NO CARRY If CODE “0”<= A ›=CODE “9”. **CALL 30E6 – STACK** : A Converts the integer value in A to floating-point and puts in on the calculator stack. **CALL 30E9 – STACK** : Converts the integer value in BC to floating-point and puts in on the calculator stack. **CALL 3160H – UNSTACK BC** : Retrieves the top value from the calculator stack and loads it into BC. **CALL 31A1 – PRINT FP** : Prints the top number on the calculator stack.