Post Reply 
Connect HP41 to Apple
12-15-2023, 05:09 AM (This post was last modified: 12-15-2023 04:18 PM by Sylvain Cote.)
Post: #2
RE: Connect HP41 to Apple
Hello Peter,

To transfer files between the HP-41 and my MacBook Pro intel, I use the following: Formatting a virtual tape

Create a LIF volume file of 128KB that can hold a maximum of 64 files
Code:
lifinit -z -m cass tape01.dat 64

Set LIF volume name to TAPE01
Code:
liflabel tape01.dat TAPE01

Show lif volume catalog
Code:
lifdir tape01.dat
Code:
Volume : TAPE01 , formatted : 14/12/23 23:00:00
Tracks: 2 Surfaces: 1 Blocks/Track: 256 Total size: 512 Blocks, 131072 Bytes
0 files (64 max), last block used: 0 of 512

In pyILPER,
  • add a mass media (aka drive) peripheral and give it a name (ex.: TAPE)
  • restart pyILPER
  • select your drive tab (ex.: TAPE)
  • set the "Drive Type" to "HP82161A"
  • change the "LIF Image File" to "tape01.dat"

Transfer HP-41 program(s) from the computer to the HP-41

Computer side

Write your program in a text file
Ex.: cat hello.txt
Code:
LBL "HELLO"
"HELLO !!!"
AVIEW
END

Compile the HP-41 program from a text file to a raw file
Code:
comp41 <hello.txt >hello.raw

Add a lif header with a name
Code:
raw41lif HELLO <hello.raw >hello.lif

Add lif file to the lif volume
Code:
lifput tape01.dat hello.lif

Show lif volume catalog
Code:
lifdir tape01.dat
Code:
Volume : TAPE01 , formatted : 14/12/23 23:00:00
Tracks: 2 Surfaces: 1 Blocks/Track: 256 Total size: 512 Blocks, 131072 Bytes
HELLO       PGM41          24/256
1 files (64 max), last block used: 10 of 512

HP-41 side

Read HELLO program from tape to main memory
Code:
"HELLO"
LOADP
XEQ "HELLO"

Transfer HP-41 program(s) from the HP-41 to the computer

HP-41 side

save WORLD program from main memory to tape
Code:
"WORLD"
WRTP

Computer side

Catalog lif volume
Code:
lifdir tape01.dat
Code:
Volume : TAPE01 , formatted : 14/12/23 23:00:00
Tracks: 2 Surfaces: 1 Blocks/Track: 256 Total size: 512 Blocks, 131072 Bytes
HELLO       PGM41          24/256
WORLD       PGM41          20/256
2 files (64 max), last block used: 11 of 512

Save WORLD program to a raw file
Code:
lifget -r tape01.dat WORLD world.raw

Decompile the HP-41 program from a raw file to a text file
Code:
decomp41 <world.raw >world.txt

cat world.txt
Code:
LBL "WORLD"
"WORLD"
AVIEW
END

Transfer HP-41 ROM from the computer to the HP-41

Computer side

Show ROM content
Code:
rom41cat <math.rom
Code:
XROM 01,00 Entry = 0068 (Mcode) -MATH_1D
XROM 01,01 Entry = 006b (Focal) MATRIX
...
XROM 01,44 Entry = 0df3 (Focal) TRANS
XROM 01,45 Entry = 0f50 (Focal) *FN

Convert ROM file to ERAMCO
Code:
rom41er MATH1D <math.rom >math.lif

Add ROM lif file to the lif volume
Code:
lifput tape01.dat math.lif

Catalog lif volume
Code:
lifdir tape01.dat
Code:
Volume : TAPE01 , formatted : 14/12/23 23:00:00
Tracks: 2 Surfaces: 1 Blocks/Track: 256 Total size: 512 Blocks, 131072 Bytes
HELLO       PGM41          24/256
WORLD       PGM41          20/256
MATH1D      X-M41        5121/5120
3 files (64 max), last block used: 31 of 512

HP-41 side

load MATH1D ROM from tape to rambox page
Code:
"MATH1D"        // ROM filename
12              // page to store ROM
READPG          // read ROM file and save it to the specified page

Transfer HP-41 ROM from the HP-41 to the computer

HP-41 side

Save a ROM page from rambox page to the tape
Code:
"MYROM"         // ROM filename
13              // page of the ROM to save
WRTPG           // save ROM at page to the tape

Computer side

Catalog lif volume
Code:
lifdir tape01.dat
Code:
Volume : TAPE01 , formatted : 14/12/23 23:00:00
Tracks: 2 Surfaces: 1 Blocks/Track: 256 Total size: 512 Blocks, 131072 Bytes
HELLO       PGM41          24/256
WORLD       PGM41          20/256
MATH1D      X-M41        5121/5120
MYROM       X-M41        5121/5120
4 files (64 max), last block used: 52 of 512

Get MYROM ROM from lif volume to a ROM file in ERAMCO format
Code:
lifget -r tape01.dat MYROM myrom.er

Convert the ERAMCO file to a ROM file format
Code:
er41rom <myrom.er >myrom.rom

Show ROM content
Code:
rom41cat <myrom.rom
Code:
...

edit: add more information for pyILPER

Sylvain Côté
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Connect HP41 to Apple - PeterP - 12-14-2023, 06:37 PM
RE: Connect HP41 to Apple - Sylvain Cote - 12-15-2023 05:09 AM
RE: Connect HP41 to Apple - Bill Duncan - 12-16-2023, 12:52 AM
RE: Connect HP41 to Apple - Sylvain Cote - 12-16-2023, 12:57 AM
RE: Connect HP41 to Apple - PeterP - 12-15-2023, 02:31 PM
RE: Connect HP41 to Apple - hesc - 01-20-2024, 12:29 PM
RE: Connect HP41 to Apple - Sylvain Cote - 01-24-2024, 01:59 AM
RE: Connect HP41 to Apple - hesc - 01-22-2024, 06:57 PM
RE: Connect HP41 to Apple - floppy - 01-24-2024, 10:33 AM
RE: Connect HP41 to Apple - Sylvain Cote - 01-23-2024, 01:24 PM
RE: Connect HP41 to Apple - hesc - 01-23-2024, 05:45 PM
RE: Connect HP41 to Apple - hesc - 01-24-2024, 02:55 PM



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