HP Forums

Full Version: Why can't I execute C program on EMU48?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am learning hpgcc (and c) now. So I type some tiny C program and I want to execute C program on emu48. But if I send program to stack 1 with emu48. press PrRUN. It instantly crashes.

In different way, I can execute C program with S->EXE, EVAL. But if I try this way press EVAL and EMU48 has no reaction so I have to click Edit - Reset Calculator. Press on then It says "Try To Recover Memory?".

How can I run C program in emu48? Attach my hello.hp program below.

p.s. I use Horizontal 50G (4x Zoom) skin. and It can run by my actual 50g.
Emu48 only emulates the Saturn chip, not the ARM chip. This means ARM-native code (like the compiled C generated by hpgcc) won't run on it. There are some other emulators that support ARM, like x49gp, but they don't easily run on Windows.
(03-08-2021 02:09 PM)Eric Rechlin Wrote: [ -> ]Emu48 only emulates the Saturn chip, not the ARM chip. This means ARM-native code (like the compiled C generated by hpgcc) won't run on it. There are some other emulators that support ARM, like x49gp, but they don't easily run on Windows.
thanks for your reply.
(03-08-2021 02:09 PM)Eric Rechlin Wrote: [ -> ]Emu48 only emulates the Saturn chip, not the ARM chip. This means ARM-native code (like the compiled C generated by hpgcc) won't run on it. There are some other emulators that support ARM, like x49gp, but they don't easily run on Windows.

What about Emu48+?
On a similar note, I cannot get EMU48 to run on my Windows 10 computers. I did want to use the EMU48 in HP50 mode to get a cheap long-integer program. It works fine on Android (except I cannot figure how to cut and paste to and from the stack.)
(03-13-2021 06:13 PM)ijabbott Wrote: [ -> ]
(03-08-2021 02:09 PM)Eric Rechlin Wrote: [ -> ]Emu48 only emulates the Saturn chip, not the ARM chip. This means ARM-native code (like the compiled C generated by hpgcc) won't run on it. There are some other emulators that support ARM, like x49gp, but they don't easily run on Windows.

What about Emu48+?
Then, are there no problem if I install emu48 amd emu48+ at the same time?
Emu48+ also doesn't emulate the ARM, it just emulates the Saturn+ in the "Apple" series of calculators. But yes, you can have Emu48 and Emu48+ simultaneously; I keep both in the same folder just with different names, but there really isn't any need for Emu48 if you have Emu48+, since Emu48+ does everything Emu48 does and more.
Sorry to hear your problems getting programs running.

If you have some space left over, see if you can get a copy of x49gp. I have absolutely no idea whether this could be run under the new WSL2, but I know it'd work fine in a virtual Linux machine. It'll be a bit of work to get going. This won't solve the "can't run a C program on EMU48/+) though but it will probably work under x4gp.

For getting data back and forth between calculator and computer, I've found that a copy of kermit (under Linux) seems to work well enough, I can't quite remember how I managed to get kermit to talk to the usb cable. Another method is to use the SD card (if your computer has a SD card reader) as a go-between.

(Post 335)
If you just want to test hpgcc code on Windows try https://kdntl.pagesperso-orange.fr/hp49/hpapine/

I've tested it with Windows, Linux, Mac. Over 10 years ago.
(03-15-2021 09:56 AM)brickviking Wrote: [ -> ]For getting data back and forth between calculator and computer, I've found that a copy of kermit (under Linux) seems to work well enough, I can't quite remember how I managed to get kermit to talk to the usb cable. Another method is to use the SD card (if your computer has a SD card reader) as a go-between.

(Post 335)

Well, in my experience ( although with HP48GXs not HP50Gs ) is that if one is using a USB-to-serial adapter in Linux or any other USB device that presents a serial interface, it usually shows up as "/dev/ttyUSBx" where "x" is usually 0 or 1, but can be other values. One way to find out which USB serial interface is the correct one is to run the command :

Code:
sudo udevadmn info --query=all --name=ttyUSBx

( replace x with the interface about which you want information )

If you're using Kermit, then to avoid having to run it as root you'll usually need to add your user to the "dialout" or perhaps the "tty" groups ( Just do an eg. ls -la /dev/ttyUSB0 to see to which group it belongs ). Also, in Kermit, you'll need to issue an eg. "SET PORT /dev/ttyUSB0" command.

Regards,

Jonathan
Reference URL's