Post Reply 
Assembler, but not at all
10-11-2023, 09:43 AM
Post: #8
RE: Assembler, but not at all
(09-22-2023 09:03 PM)jte Wrote:  A while back I was pondering on the languages built into the HP Prime; I was thinking something Forth-ish might be nice, to carry on a bit of the stack tradition. But a very simple language close to the underlying cpu is certainly another possibility to consider.

If FORTH were available on the HP Prime and it was compiled to machine code (instead of being interpreted), it would be a game changer. I think most people who love HP calculators for their RPN would be over the moon about such a feature. However, since Python is already there and it's the main focus for development, the chances for another language are slim, right?

(09-22-2023 09:19 PM)jte Wrote:  One thing that pops into my head is that having convenient framebuffer access could be nice. But I was thinking of making some changes regarding how graphics are handled in a few places… (Currently, the Function Plot view, for example, does not use, in the main, offscreen buffers. I wrote this code for the HP 39gII where memory is extremely limited. With the much greater memory resources of the HP Prime, offscreen buffers are more appropriate. As a programmer, perhaps you can appreciate the care needed to do things like drawing and undrawing the tangent lines, marching ants, and signed area display in the Function app’s plot view — without using offscreen buffers… [and without redrawing the plotted functions — using just the pixels onscreen {the tangent line only know the value and slope for the function at where the tracing cursor is; the marching ants only know the pixel coordinates of the cursor; changing the signed area by one column involves computing the upper and lower bounds at one X value}].)

That's the incredible thing about this kind of programming, where most conventional developers will say "it's impossible" or, even if they somehow manage to do it, it either works in a very limited way or runs painfully slow. Skillful use of the right algorithms can produce astonishing results even with incredibly limited resources.
I personally wrote a game for a PC (for DOS, about year 1997) once, where the executable file was just 1229 bytes (this already included graphical elements [perhaps simple, but still there]). The file with the data for individual levels was separate but also designed so that dozens of levels fit into just over 900 bytes. If anyone has seen Radioactive Wastes on HP Prime, that was the game (with identical rules carried over 100%), but the PC version had much more modest graphics since I took on the challenge to keep the file as small as possible.
However, an even bigger challenge was when, finishing technical school, my friend and I had to construct a laser controller (for light effects) from scratch. My friend, who loved soldering, mostly took care of the hardware, but left the entire firmware programming to me. The controller consisted of a 2x16 character LCD display, a few buttons, with the key component being two servomechanisms controlled usign "Pulse WIdth Modulation" (PWM), where each motor tilted at an angle proportional to the pulse fill value. At the end of the second servo, a laser was attached. To achieve this back in the day (with a very limited budget), I had at my disposal the AT89C4051 microcontroller, which only had 128 bytes of RAM (1/8 kb!!!) and 4kB of flash memory for the program. The program had to manage a menu, where among other things, one could calibrate the device, set the starting point (using arrow keys), program a set of shapes to draw (their sequence, time, etc.), and, of course, run the program. Sure, it was a simple device, but fitting all that into such limited RAM was a genuine feat. I was fighting for every single bit of memory. The entire program, from start to finish, was written in 8051 assembler. If I had written it in C or another high-level language, there would've been no chance to fit it.
Ultimately, the work was submitted (as a final project in the last grade), and it was a real hit with the instructors.

It's nice to reminisce about those times Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Assembler, but not at all - komame - 09-21-2023, 09:26 AM
RE: Assembler, but not at all - komame - 09-22-2023, 03:50 AM
RE: Assembler, but not at all - jte - 09-22-2023, 09:03 PM
RE: Assembler, but not at all - komame - 09-25-2023, 05:24 PM
RE: Assembler, but not at all - jte - 09-26-2023, 07:24 AM
RE: Assembler, but not at all - komame - 10-11-2023 09:43 AM
RE: Assembler, but not at all - John Keith - 10-11-2023, 02:20 PM
RE: Assembler, but not at all - komame - 10-11-2023, 04:36 PM
RE: Assembler, but not at all - jte - 10-12-2023, 12:08 AM
RE: Assembler, but not at all - jte - 09-22-2023, 09:19 PM
RE: Assembler, but not at all - John Keith - 10-11-2023, 10:41 PM
RE: Assembler, but not at all - komame - 10-12-2023, 03:31 AM
RE: Assembler, but not at all - Claudio L. - 10-14-2023, 08:52 PM
RE: Assembler, but not at all - parisse - 10-12-2023, 06:55 AM
RE: Assembler, but not at all - komame - 10-12-2023, 07:13 AM
RE: Assembler, but not at all - parisse - 10-12-2023, 12:15 PM
RE: Assembler, but not at all - John Keith - 10-12-2023, 08:40 PM
RE: Assembler, but not at all - parisse - 10-12-2023, 12:49 PM
RE: Assembler, but not at all - parisse - 10-13-2023, 05:36 AM
RE: Assembler, but not at all - komame - 10-13-2023, 01:16 PM
RE: Assembler, but not at all - komame - 10-14-2023, 04:12 PM
RE: Assembler, but not at all - parisse - 10-13-2023, 04:56 PM
RE: Assembler, but not at all - parisse - 10-15-2023, 06:21 AM
RE: Assembler, but not at all - Claudio L. - 10-18-2023, 02:46 AM
RE: Assembler, but not at all - komame - 10-18-2023, 05:41 PM
RE: Assembler, but not at all - Claudio L. - 10-19-2023, 02:54 AM
RE: Assembler, but not at all - komame - 11-01-2023, 07:06 AM
RE: Assembler, but not at all - dlidstrom - 11-12-2023, 07:57 PM
RE: Assembler, but not at all - komame - 11-13-2023, 02:07 PM
RE: Assembler, but not at all - komame - 02-19-2024, 06:21 PM



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