# A first key script: arithmetic, a tiny program, and saving the memory.
# Works with any HP-16C CE firmware.
# Run:  cargo run -- --firmware YOUR-16C-FIRMWARE.bin --test examples/first-session.txt
keys 1 ENTER 1 +           # the calculator starts in HEX
expect 2 h
keys DEC 5 ENTER 6 *       # * is the multiply key (you can also write ×)
expect 30 d
show
# key in a program: LBL A, ENTER, ×, RTN  (squares X)
keys g R/S                 # g P/R: program mode
keys g GTO A               # g LBL A
keys ENTER *
keys g GSB                 # g RTN
keys g R/S                 # back to run mode
keys 12 GSB A
expect 144 d
fmem                       # print f MEM
