--- title: "Processor Test" id: 56704 type: "computer_media" slug: "processor-test" url: "http://localhost/computer_media/processor-test/" markdown_url: "http://localhost/computer_media/processor-test.md" published_at: "2024-09-22T23:31:48+00:00" modified_at: "2026-04-04T20:17:48+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2024/09/SCR-20241027-pyfl.png" excerpt: "A passcode-protected processor benchmark that draws a blinking grid of blocks and hands off to machine code to measure CPU speed." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" model: - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" genre: - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Processor%20Test%20%281985%29%28Beh%20Sys%20Science%20Orgn%29%28TS1000%29%28US%29%28Cassette%29.zip" mediadate: "1985" images: - url: "http://localhost/wp-content/uploads/2024/09/SCR-20241027-pyfl.png" - url: "http://localhost/wp-content/uploads/2024/09/SCR-20241027-pycm.png" - url: "http://localhost/wp-content/uploads/2024/09/ProcTester.jpg" - url: "http://localhost/wp-content/uploads/2024/09/ProcTester1.jpg" media_type_tags: "Utility" --- # Processor Test Processor Test displays a grid of nine filled-block characters at fixed screen positions and then calls a machine code routine at address 16514 via USR to perform a processor speed test. The program requires the user to enter a specific passcode (“3EDC7UJMXDR5NHY6”) before proceeding, acting as a simple access gate. Line 1 contains an extensive REM statement that holds the machine code data loaded into memory prior to the test routine. The SLOW command at lines 10 and 130 ensures the display runs in the standard interrupted mode before the USR call benchmarks the processor. *** ## Program Analysis ### Program Structure The program is organized into four logical phases: 1. **Machine code storage (line 1):** A `REM` statement holds binary data in its tail bytes, providing the machine code routine that will be called via `USR 16514`. 2. **Access control (lines 10–60):** The user must enter the exact string `3EDC7UJMXDR5NHY6` before the test proceeds; incorrect input loops back to the prompt. 3. **Instructions (lines 90–120):** A brief text screen explains what the test does and how to stop it, followed by a `PAUSE 500` delay. 4. **Test loop (lines 130–210):** Nine filled-block characters are printed at fixed grid positions and then `USR 16514` is called, delegating the actual timing work to machine code. ### Machine Code in the REM Statement Line 1’s `REM` statement contains a substantial sequence of keyword tokens and characters that encode a Z80 machine code routine. The routine begins at address 16514, which is the address of the second byte of line 1 (the first byte after the `REM` opcode in the tokenized line). This is the standard technique for embedding machine code in a BASIC program: `USR 16514` in line 210 transfers control directly into the REM payload. The REM content references tokens such as `GOSUB`, `LPRINT`, `LLIST`, `LOAD`, `CHR$`, `LN`, `OR`, `RND`, `TAN`, `SGN`, `VAL`, `PRINT`, `EXP`, `LET`, `AT`, `NEW`, `RETURN`, along with numeric literals and block graphic characters — all interpreted not as BASIC keywords but as raw opcode bytes by the Z80 processor. ### Display Layout Line 200 places nine `█` (filled block) characters at a 3×3 grid of screen positions: | Row | Columns | | --- | --- | | 1 | 0, 15, 31 | | 12 | 0, 15, 31 | | 21 | 0, 15, 31 | These nine markers serve as visual reference points whose “blinking” behavior (caused by the display interrupt interacting with the machine code loop) can be observed and timed to assess processor speed. ### Key BASIC Idioms and Techniques - **Passcode gate:** Lines 40–60 use `INPUT D$` and a string comparison; any mismatch loops unconditionally back to line 30 via `GOTO 30`. - **USR call as benchmark:**`LET Y=USR 16514` in line 210 both transfers control to machine code and captures any return value in `Y`, though the return value is not subsequently used in the BASIC portion of the program. - **SLOW mode enforcement:**`SLOW` appears at lines 10 and 130, ensuring the display interrupt is active — relevant because the visual blinking effect depends on normal interrupted operation. - **SAVE and auto-restart (lines 9500–9520):** After the test logic, a `SAVE` is followed by `SLOW` and `GOTO 1`, creating an infinite restart loop if the program ever returns from the machine code routine back into BASIC. ### Notable Anomalies The `GOTO 1` at line 9520 targets line 1, which contains only a `REM` statement. In practice this is harmless — BASIC will simply advance to the next executable line (line 10) — but it is slightly unusual compared to targeting line 10 directly. The variable `Y` assigned from `USR 16514` is never read after line 210, suggesting the machine code routine either runs indefinitely (consistent with the instruction that only a reset or power-off will stop it) or its return value is irrelevant to the BASIC program’s logic. ## Source Code ``` 1 REM GOSUB #£RNDE(RND GOSUB # FASTAT STR$ LPRINT )WRNDY█ GOSUB [L] LLIST [7]RNDF#><#><7/ LOAD #CHR$ W3#: Y -▘LN OR RNDC3Y█-~~LN OR RND4-Y -▘LN OR RNDC$Y█-~~LN OR RND4▖▞ £TAN £#[S]CSGN /SGN VAL PRINT [R]#▘WRND*▟##EXP #~~#▀~~# LET AT #UORND[>]#UORND[V]4 IF Y█#<=█ NEW▒ RETURN TAN 10 SLOW 20 CLS 30 PRINT AT 1,3;"HI. I▘M PROCESSOR TESTER.";AT 6,4;"ENTER: 3EDC7UJMXDR5NHY6" 40 INPUT D$ 50 IF D$="3EDC7UJMXDR5NHY6" THEN GOTO 90 60 GOTO 30 90 CLS 100 PRINT AT 5,0;"THIS TEST ONLY DISPLAYS BLINKING";AT 7,4;"BOXES TO HAVE THEIR SPEED";AT 9,3;"CHECKED. ONLY [R][E][S][E][T]TING OR";AT 11,8;"TURNING POWER [O][F][F]";AT 13,9;"WILL STOP THEM." 110 PAUSE 500 120 CLS 130 SLOW 200 PRINT AT 1,0;"█";AT 1,15;"█";AT 1,31;"█";AT 12,0;"█";AT 12,15;"█";AT 12,31;"█";AT 21,0;"█";AT 21,15;"█";AT 21,31;"█" 210 LET Y=USR 16514 9500 SAVE "PROCESSOR TESTE[R]" 9510 SLOW 9520 GOTO 1 ```