--- title: "Ohm’s ZXlaw" id: 76547 type: "computer_media" slug: "ohms-zxlaw" url: "http://localhost/computer_media/ohms-zxlaw/" markdown_url: "http://localhost/computer_media/ohms-zxlaw.md" published_at: "2026-11-11T08:02:29+00:00" modified_at: "2026-11-11T08:02:29+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/ohms-zxlaw-1.png" excerpt: "Work out power, current, voltage and resistance from any two of them with Ohm's law." 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/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Brad Hogg" slug: "brad-hogg" taxonomy: "indiv" url: "http://localhost/indiv/brad-hogg/" genre: - name: "Electronics" slug: "electronics" taxonomy: "genre" url: "http://localhost/type/electronics/" media_type: "Program" programmers: - name: "Brad Hogg" slug: "brad-hogg" taxonomy: "indiv" url: "http://localhost/indiv/brad-hogg/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Ohm%27s%20ZXlaw%20%281983%29%28Hogg%2C%20Brad%29%28TS1000%29%28CA%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/11/ohms-zxlaw-1.png" - url: "http://localhost/wp-content/uploads/2026/11/ohms-zxlaw-2.png" article_media: - id: 19570 title: "Ohm’s ZXlaw" type: "article" url: "http://localhost/article/ohms-zxlaw/" media_type_tags: "Electronics" license: false --- # Ohm’s ZXlaw An Ohm’s law calculator. Enter the values you know for voltage, current, resistance and power, and 0 for the ones you don’t; after two values the program calculates and shows the other two. Press any key for another calculation, or BREAK to stop. Line 1 saves the program, so start it with GOTO 2 after typing it in. As printed, line 390 multiplies by R where it should divide, so with voltage and resistance as the known values the power comes out wrong (12 V and 6 ohms give 864 W instead of 24 W). Change (V**2)*R to (V**2)/R to fix it. The article shows how to make the title REM line 0. Published in Syntax December 1983 ([Ohm’s ZXlaw](https://timexsinclair.com/article/ohms-zxlaw/)). ## Source Code ``` 0 REM OHMS ZXLAW (C) 1982 BRAD HOGG BOX 1814 SWAN RIVER, MB CANADA R0L 1Z0 1 SAVE "OHM" 2 SLOW 10 CLS 20 LET V=0 30 LET I=0 40 LET R=0 50 LET P=0 60 LET C=3 70 PRINT " OHMS LAW INPUT KNOWN VALUES V,I,R,P (0 IF UNKNOWN)" 80 PRINT AT C,0;"VOLTAGE (V)="; 90 INPUT V 100 IF V THEN LET C=C+1 110 PRINT V;" V" 120 PRINT AT C,0;" " 130 PRINT AT C,0;"CURRENT (I)="; 140 INPUT I 150 IF I THEN LET C=C+1 160 PRINT I;" A" 170 IF V AND I THEN GOTO 290 180 PRINT AT C,0;" " 190 PRINT AT C,0;"RESISTANCE (R)="; 200 INPUT R 210 IF R THEN LET C=C+1 220 PRINT R;" OHMS" 230 IF V AND R OR I AND R THEN GOTO 290 240 PRINT AT C,0;" " 250 PRINT AT C,0;"POWER (P)="; 260 INPUT P 265 PRINT P;" W" 270 IF P THEN LET C=C+1 290 IF NOT V OR NOT I THEN GOTO 320 300 PRINT "POWER (P)=";V*I;" W" 310 PRINT "RESISTANCE (R)=";V/I;" OHMS" 320 IF NOT P OR NOT R THEN GOTO 350 330 PRINT "CURRENT (I)=";SQR (P/R);" A" 340 PRINT "VOLTAGE (V)=";SQR (P*R);" V" 350 IF NOT P OR NOT I THEN GOTO 380 360 PRINT "VOLTAGE (V)=";P/I;" V" 370 PRINT "RESISTANCE (R)=";P/(I**2);" OHMS" 380 IF NOT R OR NOT V THEN GOTO 410 390 PRINT "POWER (P)=";(V**2)*R;" W" 400 PRINT "CURRENT (I)=";V/R;" A" 410 IF NOT I OR NOT R THEN GOTO 440 420 PRINT "POWER (P)=";(I**2)*R;" W" 430 PRINT "VOLTAGE (V)=";I*R;" V" 440 IF NOT V OR NOT P THEN GOTO 470 450 PRINT "RESISTANCE (R)=";(V**2)/P;" OHMS" 460 PRINT "CURRENT (I)=";P/V;" A" 470 PRINT AT 21,0;"PRESS ANY KEY TO CONTINUE" 490 IF INKEY$="" THEN GOTO 490 500 RUN 2 ```