--- title: "Adding Machine" id: 80633 type: "computer_media" slug: "adding-machine" url: "http://localhost/computer_media/adding-machine/" markdown_url: "http://localhost/computer_media/adding-machine.md" published_at: "2026-11-26T15:24:19+00:00" modified_at: "2026-11-26T15:24:19+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/adding-machine-1.png" excerpt: "A ZX81 printing adding machine that lines up the decimal points, reprinted from ZX Computing." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" 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: "Mervin Cagle" slug: "mervin-cagle" taxonomy: "indiv" url: "http://localhost/indiv/mervin-cagle/" genre: - name: "Printer" slug: "printer" taxonomy: "genre" url: "http://localhost/type/printer/" media_type: "Program" programmers: - name: "Mervin Cagle" slug: "mervin-cagle" taxonomy: "indiv" url: "http://localhost/indiv/mervin-cagle/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Adding%20Machine%20%281984%29%28Cagle%2C%20Mervin%29%28TS1000%29%28Program%29.zip" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/11/adding-machine-1.png" - url: "http://localhost/wp-content/uploads/2026/11/adding-machine-2.png" - url: "http://localhost/wp-content/uploads/2026/11/adding-machine-3.png" article_media: - id: 42554 title: "Adding Machine" type: "article" url: "http://localhost/article/adding-machine/" media_type_tags: "Printer" license: false --- # Adding Machine Turns the ZX81 or TS1000 into a printing adding machine. Type each amount at the INPUT prompt and press ENTER: the amount is printed on the ZX printer (or TS2040) with the decimal points lined up, whole numbers with .00 added and one-place decimals with a 0. Press ENTER on its own to print TOTAL and the running total. Needs the printer: nothing but the INPUT prompt appears on the screen. After the total the program stops with report C/140 (VAL of the empty entry); RUN starts a new tape. The article suggests saving paper by turning the printer paper round and using it again. One correction: line 15 was printed IF .1>ABS E AND ABS E>=1, which can never be true, so amounts from .01 to .099 printed one column out of line; the download has ABS E>=.01. The Plotter reprinted this program from ZX Computing, the British magazine; the issue is not given. Published in The Plotter December 1984 ([Adding Machine](https://timexsinclair.com/article/adding-machine/)). ## Source Code ``` 1 REM "ADDING MACHINE" 2 GOTO 60 3 LET B=0 6 IF E=0 THEN GOTO 21 9 LET B=INT (LN (ABS E)/LN 10) 12 IF 1>ABS E AND ABS E>0 THEN LET B=0 15 IF .1>ABS E AND ABS E>=.01 THEN LET B=-1 18 IF E<0 THEN LET B=B+1 20 IF E$="" THEN LPRINT TAB 21-B;"TOTAL" 21 IF E=INT E THEN LPRINT TAB 28-B;E;".00" 23 IF E=INT E THEN RETURN 25 LET W=10*E-INT ((E*10)+.5) 27 IF -1E-8