HP Forums
(41CX, DM41X): Cash Register - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (41CX, DM41X): Cash Register (/thread-19482.html)



(41CX, DM41X): Cash Register - Eddie W. Shore - 01-29-2023 05:37 PM

Download the program here (raw file): https://drive.google.com/file/d/102ekvHr4c3shBY6RvAuAZzjj1g1ctD7L/view?usp=share_link

This program simulates a cash register. If you have an HP infrared printer like the HP 82240B (from the 1980s and 1990s), the program is set to print the results. The printer is enabled by setting flag 21. When a printer is present, flag 55 is set internally.

When the printer flag is turned on (21):

AVIEW: print what ever is in the alpha register
VIEW: print the contents of a numeric register
ADV: advances the paper

A printer is not required to run the program, unplug the Infrared Printer Module. This way the program stops when an AVIEW, VIEW, and ADV instruction displays. Press [ R/S ] to continue.

This program assumes every item entered is subject to a sales tax, which is set within the program, line 03.

When you are done entering the costs for items checked out, enter zero.

Code:
01  LBL^T CASHREG
02  FIX 2
03  8.75    ← set your sales tax rate here 
04  STO 02
05  0
06  STO 01
07  SF 21   ← allows the calculator to print/display
08  ^T THE STORE
09  33
10  XTOA  ← ammends an exclamation point (!)
11  AVIEW
12  CLA
13  FIX 8
14  DATE
15  ADATE
16  AVIEW  ← prints the date
17  CLA
18  FIX 2
19  ADV
20  LBL 00   ← main loop
21  ^T COST?
22  PROMPT
23  X=0?
24  GTO 01
25  ARCL X
26  AVIEW
27  ST+ 01
28  GTO 00
29  LBL 01
30  ^T SUBTOTAL
31  ARCL 01
32  AVIEW
33  CLA
34  ARCL 02
35  ^T |- % TAX:
36  RCL 01
37  RCL 02
38  %
39  ARCL X
40  AVIEW
41  +
42  ^T TOTAL:
43  ARCL X
44  AVIEW
45  ^T PAID:
46  PROMPT
47  ARCL X
48  AVIEW
49  X<>Y
50  -
51  ^T CHANGE:
52  ARCL X
53  AVIEW
54  END

Example

Checkout:
$19.99
$27.95
$28.94
Sales Tax Rate: 8.75%
Paid: $100.00

XEQ CASHREG


THE STORE
01/29/2023 ← the current date is shown here
COST? 19.99 R/S
COST? 27.95 R/S
COST? 28.94 R/S
COST? 0
SUBTOTAL: 76.88
8.75% TAX: 6.73
TOTAL: 83.61
PAID: 100 R/S
PAID: 100.00
CHANGE: 16.39