Poll: Include Key Codes in Program Listings
This poll is closed.
Yes 78.95% 15 78.95%
No 0% 0 0%
Indifferent 21.05% 4 21.05%
Total 19 votes 100%
* You voted for this item. [Show Results]

Post Reply 
Key Codes in Program Listings (70's/80's calculators)
04-15-2024, 12:38 AM
Post: #1
Key Codes in Program Listings (70's/80's calculators)
I don't remember if I asked this before but for calculators from the 70s/80s (25C, 65, 67, 12C, 11C, 15C, etc), but what style of listing would you prefer?

Style 1 where the key codes are included:
Example: (15C)
001 ; 42, 21, 11 ; LBL A
002 ; 1 ; 1
003 ; 40 ; +
004 ; 43, 32 ; RTN


Style 2 where it's just step numbers and keys:
001 LBL A
002 1
003 +
004 RTN


I've been listing my programs in style 1 and considering dropping the key codes.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-15-2024, 01:20 AM (This post was last modified: 04-15-2024 01:34 AM by carey.)
Post: #2
RE: Key Codes in Program Listings (70's/80's calculators)
(04-15-2024 12:38 AM)Eddie W. Shore Wrote:  I don't remember if I asked this before but for calculators from the 70s/80s (25C, 65, 67, 12C, 11C, 15C, etc), but what style of listing would you prefer?

Style 1 where the key codes are included:
Example: (15C)
001 ; 42, 21, 11 ; LBL A
002 ; 1 ; 1
003 ; 40 ; +
004 ; 43, 32 ; RTN


Style 2 where it's just step numbers and keys:
001 LBL A
002 1
003 +
004 RTN


I've been listing my programs in style 1 and considering dropping the key codes.

I find Style 1 preferable for the 15C (the only one of the listed calculators I use) because including key codes offer the advantage of providing a check (similar to a checksum and useful for long listings) that the correct keys were pressed.

Since Style 2 has the advantage of making program logic clearer, if Style 1 could be modified so keys are indented and aligned to the right (as below), both Style 1 and Style 2 advantages could be achieved (though with more work for the author! :)

Code:
Modified Style 1:
Example:   (15C)
001 ;  42, 21, 11 ; LBL A
002 ;  1 ;          1
003 ;  40 ;         +
004 ;  43, 32 ;     RTN

Another possibility is Style 2 for short programs and Style 1 for long programs.
Find all posts by this user
Quote this message in a reply
04-15-2024, 01:44 AM
Post: #3
RE: Key Codes in Program Listings (70's/80's calculators)
When I used the TI-58c and 59 in the early- to mid-1980's which showed only numbers in the display, and I programmed lots, all the key codes were ingrained in my mind and very automatic; so when I wrote programs, I just wrote columns of numbers.  When I went to the HP-41 which showed the instructions' names in the LCD, I only wrote instructions, no key codes.

http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, http://wilsonminesco.com/links.html )
Visit this user's website Find all posts by this user
Quote this message in a reply
04-15-2024, 03:18 AM (This post was last modified: 04-27-2024 02:00 AM by toml_12953.)
Post: #4
RE: Key Codes in Program Listings (70's/80's calculators)
(04-15-2024 12:38 AM)Eddie W. Shore Wrote:  I don't remember if I asked this before but for calculators from the 70s/80s (25C, 65, 67, 12C, 11C, 15C, etc), but what style of listing would you prefer?

Style 1 where the key codes are included:
Example: (15C)
001 ; 42, 21, 11 ; LBL A
002 ; 1 ; 1
003 ; 40 ; +
004 ; 43, 32 ; RTN


Style 2 where it's just step numbers and keys:
001 LBL A
002 1
003 +
004 RTN


I've been listing my programs in style 1 and considering dropping the key codes.

If the labels were in a neat column, then I'd prefer the first style.

Code:
001 ;  42, 21, 11  ; LBL A
002 ;  1           ; 1
003 ; 40           ; +
004 ; 43, 32       ; RTN

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
04-15-2024, 07:16 AM (This post was last modified: 04-15-2024 07:17 AM by StephenG1CMZ.)
Post: #5
RE: Key Codes in Program Listings (70's/80's calculators)
Indenting those instructions looks like a lot of work, but the end result looks clearer.
I wonder whether having two listings would be any good:

Keycodes:
001 42,41
002 42,41
Instructions:
001 LBL
002 LBL

Probably not, but I just thought I'd ask the experts for their view.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
04-15-2024, 12:16 PM
Post: #6
RE: Key Codes in Program Listings (70's/80's calculators)
Both are useful, for different reasons. The codes are useful if you are verifying what you have already entered, while the key instructions are better for entry or just studying the logic and technique used.

I think there's no question that Tom's suggestion is the best, but it takes more work, so that may not be what Eddie was looking for... Wink Be careful what you ask for... Smile

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
04-15-2024, 12:19 PM
Post: #7
RE: Key Codes in Program Listings (70's/80's calculators)
I mainly use the format used by online emulators:

HP-15C
Code:
#  Program produced by JRPN 15C.
#  Generated 2024-4-15 13:33 Central European Summer Time.
#  Program occupies 7 bytes.

   000 {          } 
   001 { 42 21 11 } f LBL A
   002 {        1 } 1
   003 {       40 } +
   004 {    43 32 } g RTN

# End.

HP-16C
Code:
#  Program produced by JRPN 16C.
#  Generated 2024-4-15 13:53 Central European Summer Time.
#  Program occupies 7 bytes.

   000 {          } 
   001 { 43 22  A } g LBL A
   002 {        1 } 1
   003 {       40 } +
   004 {    43 21 } g RTN

# End.

HP-25C
Code:
01: 01       : 1
02: 51       : +

HP-29C
Code:
01: 15 13 00 : g LBL 0
02: 01       : 1
03: 51       : +
04: 15 12    : g RTN

HP-65
Code:
001: 23    : LBL
002: 11    : A
003: 01    : 1
004: 61    : +
005: 24    : RTN

HP-67
Code:
001: 31 25 11
002: 01
003: 61
004: 35 22

But I clip it to the relevant lines.
And in case of the HP-67 I would add the missing keys in a separate column.
Find all posts by this user
Quote this message in a reply
04-15-2024, 12:20 PM
Post: #8
RE: Key Codes in Program Listings (70's/80's calculators)
It would be great if there was a tab tag ([tag]), that would help a lot.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-15-2024, 12:40 PM
Post: #9
RE: Key Codes in Program Listings (70's/80's calculators)
(04-15-2024 12:38 AM)Eddie W. Shore Wrote:  Example: (15C)
001 ; 42, 21, 11 ; LBL A
002 ; 1 ; 1
003 ; 40 ; +
004 ; 43, 32 ; RTN

This can be reformatted with:
Code:
perl -F\; -ane 'printf "%s;%12s;%s", @F' <<EOF
001 ; 42, 21, 11 ; LBL A
002 ; 1 ; 1
003 ; 40 ; +
004 ; 43, 32 ; RTN
EOF

001 ; 42, 21, 11 ; LBL A
002 ;          1 ; 1
003 ;         40 ; +
004 ;     43, 32 ; RTN

But the result must be entered into a code-block.
Find all posts by this user
Quote this message in a reply
04-16-2024, 06:02 AM
Post: #10
RE: Key Codes in Program Listings (70's/80's calculators)
When I write out my 15C programs, I just use the key descriptions without the codes. I find that easier to read and when checking, I get familiar with how they correspond to the codes.

But I don't have a worthwhile opinion about posting the codes here since I don't tend to enter programs by others, although I'm interested to read and learn about them
Find all posts by this user
Quote this message in a reply
04-26-2024, 11:55 PM
Post: #11
RE: Key Codes in Program Listings (70's/80's calculators)
(04-15-2024 01:44 AM)Garth Wilson Wrote:  When I used the TI-58c and 59 in the early- to mid-1980's which showed only numbers in the display, and I programmed lots, all the key codes were ingrained in my mind and very automatic [...]

Same here, I started with a TI-59 and knew the op codes by heart, but still it was a pain to check a long program for correct entry. So when I upgraded to an HP-41C (which BTW I still have) I was extremely happy not to have to worry about key codes.

Recently I was given a TI-56 which even though it can connect to the PC100A print cradle (like the TI-58 and 59) it just prints the line number and op codes. No mnemonics.

So I wrote a small spreadsheet that will convert keycodes to mnemonics and thus produce a listing similar to what you would get with a TI-59 and PC100 printer.

The approach can, of course, be carried over to most calculators of the era with similar encodings.

Vassilis
http://www.series80.org
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)