Post Reply 
MCODEing on OSX
02-24-2019, 03:55 PM
Post: #1
MCODEing on OSX
Soon the HP-41 gets 40 and I still don't know how to program it in MCODE. Time to change that. The first step was to create a project setup that allows to conveniently develop MCODE programs on my MacBook Pro. After some research I decided to use SDK41 together with DOSBox. I defined a project setup and wrote a build script. If you're interested have a look here:

HP-41 MCODE Example Project on OSX

The journey of a thousand miles begins with one step.
- Lao Tzu
Find all posts by this user
Quote this message in a reply
02-25-2019, 03:26 AM
Post: #2
RE: MCODEing on OSX
Hi Jurgen,
Good luck getting a whole ROM up & running, or even a bank switched set!
X<>Y gets lots easier when just calling 12FCh, but I get the point of your first effort example.
Do you have a future ROM project that is driving you? if so we would love to hear about it.
DA.
Find all posts by this user
Quote this message in a reply
02-25-2019, 07:58 AM
Post: #3
RE: MCODEing on OSX
Never too late to start, you'll have lots of fun spiked up with the due dose of frustration - but that only makes the journey more interesting ;-)

ÁM
Find all posts by this user
Quote this message in a reply
02-25-2019, 07:26 PM
Post: #4
RE: MCODEing on OSX
(02-25-2019 03:26 AM)derekamos Wrote:  Good luck getting a whole ROM up & running, or even a bank switched set!
X<>Y gets lots easier when just calling 12FCh, but I get the point of your first effort example.
Do you have a future ROM project that is driving you? if so we would love to hear about it.

Thank you for your good wishes, I'm sure there will be some occasions where I'm in need of positive words to keep going on :-)

The main driver is currently just curiosity. The HP-41 is my favorite HP calc and I just want to delve deeper into its architecture. However, I have some concrete project ideas but it's too early to discuss them.

The purpose of the first step and the sample project on Github was just to build a convenient development environment and set up the toolchain. I just copied the sample source files from well known sources and didn't actually care about the contents. Anyway, I'm sure I will need the expertise of you and other MCODErs at some point because there is not that much documentation available.

The next step is most probably to make syntax highlighting work for MCODE in my text editor (TextMate). The reason is that from my daily work as software engineer I'm just so used to this visual help that simple black-on-white code looks somehow annoying to me. It also seems a good exercise to get an overview of the instruction classes and to carefully read through the SDK41 manual.

Another HP-41 enthusiast living near me just told me that he is also interested to get into MCODE. So we decided to make our first MCODE hackathon on March 15. Together it's definitely more fun and maybe more productive and less frustrating.
Find all posts by this user
Quote this message in a reply
02-25-2019, 07:30 PM
Post: #5
RE: MCODEing on OSX
(02-25-2019 07:58 AM)Ángel Martin Wrote:  Never too late to start

Some brain food keeps you young :-)

(02-25-2019 07:58 AM)Ángel Martin Wrote:  you'll have lots of fun spiked up with the due dose of frustration - but that only makes the journey more interesting ;-)

I'm sure that the experts here in this forum will help me to overcome frustrating failures!
Find all posts by this user
Quote this message in a reply
02-25-2019, 08:14 PM
Post: #6
RE: MCODEing on OSX
Jurgen - If you don't already have it, definitely get a copy of Poul Kaarup's eBook "A programmers handbook v.2.07" available on TOS. Besides MCODE details, it includes lots of other 41 content (h/w info, synthetics, buffers, detailed memory and register maps, etc.) and is simply an incredible goldmine of useful 41 info and reference material.

I have accepted I will never be an MCODE programmer, but if I were to consider doing so, this is one of the first resources I would make sure to have handy.

And my hats-off to you for deciding to tackle this task. While there is MUCH more information readily available to someone doing so today than 'back in the day' it is still a non-trivial challenge, which I'm convinced does include the need for small doses of black magic here and there.

Good luck!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
02-25-2019, 08:16 PM
Post: #7
RE: MCODEing on OSX
(02-24-2019 03:55 PM)Jurgen Keller Wrote:  Soon the HP-41 gets 40 and I still don't know how to program it in MCODE. Time to change that. The first step was to create a project setup that allows to conveniently develop MCODE programs on my MacBook Pro. After some research I decided to use SDK41 together with DOSBox. I defined a project setup and wrote a build script. If you're interested have a look here:

HP-41 MCODE Example Project on OSX

The journey of a thousand miles begins with one step.
- Lao Tzu

I assume you've looked at the NEWT Manual on the 41CL website for detailed descriptions of the various instructions. I still refer to it every time I do any mcode. I also have a printed copy of the 41C OS listing next to me when I am coding.

Monte
Visit this user's website Find all posts by this user
Quote this message in a reply
02-26-2019, 07:30 AM
Post: #8
RE: MCODEing on OSX
For small projects: With an 41CL, an installed RAM Page und the famous included David Assembler you can "play" MCODE on the way, without mac or pc... my favorite
Find all posts by this user
Quote this message in a reply
02-26-2019, 07:30 PM
Post: #9
RE: MCODEing on OSX
(02-25-2019 07:26 PM)Jurgen Keller Wrote:  The main driver is currently just curiosity. The HP-41 is my favorite HP calc and I just want to delve deeper into its architecture. However, I have some concrete project ideas but it's too early to discuss them.

The purpose of the first step and the sample project on Github was just to build a convenient development environment and set up the toolchain. I just copied the sample source files from well known sources and didn't actually care about the contents. Anyway, I'm sure I will need the expertise of you and other MCODErs at some point because there is not that much documentation available.

Another HP-41 enthusiast living near me just told me that he is also interested to get into MCODE. So we decided to make our first MCODE hackathon on March 15. Together it's definitely more fun and maybe more productive and less frustrating.

I also want to go to MCODE hackathons...

There are actually plenty of documentation available. HP released a lot back in the days including most of the relevant source code, fully commented. In addition to this there are NEWT processor manual and Kaarup's Programmers handbook. There is also the HP-41 MCODE for beginners book, as well as loads of other manuals and documents to consult.

I have some source projects online if you are interested in looking at example source code, drop me a PM in that case.
Find all posts by this user
Quote this message in a reply
02-27-2019, 08:32 PM
Post: #10
RE: MCODEing on OSX
(02-25-2019 08:14 PM)rprosperi Wrote:  Jurgen - If you don't already have it, definitely get a copy of Poul Kaarup's eBook "A programmers handbook v.2.07" available on TOS. Besides MCODE details, it includes lots of other 41 content (h/w info, synthetics, buffers, detailed memory and register maps, etc.) and is simply an incredible goldmine of useful 41 info and reference material.

I have accepted I will never be an MCODE programmer, but if I were to consider doing so, this is one of the first resources I would make sure to have handy.

And my hats-off to you for deciding to tackle this task. While there is MUCH more information readily available to someone doing so today than 'back in the day' it is still a non-trivial challenge, which I'm convinced does include the need for small doses of black magic here and there.

Good luck!

I already know Poul Kaarup's eBook and I like it!

And you're right: there was never a better time to start MCODEing than today. Plenty of documentation and a great forum here where I'll get answers to nearly every question. That's encouraging :-)
Find all posts by this user
Quote this message in a reply
02-27-2019, 08:35 PM
Post: #11
RE: MCODEing on OSX
(02-25-2019 08:16 PM)Monte Dalrymple Wrote:  
(02-24-2019 03:55 PM)Jurgen Keller Wrote:  Soon the HP-41 gets 40 and I still don't know how to program it in MCODE. Time to change that. The first step was to create a project setup that allows to conveniently develop MCODE programs on my MacBook Pro. After some research I decided to use SDK41 together with DOSBox. I defined a project setup and wrote a build script. If you're interested have a look here:

HP-41 MCODE Example Project on OSX

The journey of a thousand miles begins with one step.
- Lao Tzu

I assume you've looked at the NEWT Manual on the 41CL website for detailed descriptions of the various instructions. I still refer to it every time I do any mcode. I also have a printed copy of the 41C OS listing next to me when I am coding.

Monte

How could I have missed that? I've just added it to my standard list of MCODE documentation. Thanks for the hint!
Find all posts by this user
Quote this message in a reply
02-27-2019, 08:40 PM
Post: #12
RE: MCODEing on OSX
(02-26-2019 07:30 AM)charger73 Wrote:  For small projects: With an 41CL, an installed RAM Page und the famous included David Assembler you can "play" MCODE on the way, without mac or pc... my favorite

For small project that might work. However, I'm going to rewrite the 41 OS, so I'm in real need of a text editor to keep the overview ;-)
Find all posts by this user
Quote this message in a reply
02-27-2019, 08:53 PM
Post: #13
RE: MCODEing on OSX
(02-26-2019 07:30 PM)hth Wrote:  I also want to go to MCODE hackathons...

It would be great to have an experienced MCODEr here. Just for your consideration: Switzerland is a great place to spend you vacations ;-)

(02-26-2019 07:30 PM)hth Wrote:  There are actually plenty of documentation available. HP released a lot back in the days including most of the relevant source code, fully commented. In addition to this there are NEWT processor manual and Kaarup's Programmers handbook. There is also the HP-41 MCODE for beginners book, as well as loads of other manuals and documents to consult.

That's exactly my current list of MCODE documentation:
  • MCODE for Beginners by Ken Emery
  • SDK41 Manual
  • A Programmer's handbook by Poul Kaarup
  • NEWT Microprocessor Technical Manual by Monte Dalrymple
  • Coconut VASM listing

(02-26-2019 07:30 PM)hth Wrote:  I have some source projects online if you are interested in looking at example source code, drop me a PM in that case.
Yes, I'm interested in looking into examples. PM sent. Thank you!
Find all posts by this user
Quote this message in a reply
02-27-2019, 09:09 PM (This post was last modified: 02-27-2019 09:19 PM by Didier Lachieze.)
Post: #14
RE: MCODEing on OSX
(02-27-2019 08:40 PM)Jurgen Keller Wrote:  I'm going to rewrite the 41 OS

Wow ! For a MCODE beginner that's not a small project... anyway, let me know if this can be useful for you.
Find all posts by this user
Quote this message in a reply
02-27-2019, 10:02 PM
Post: #15
RE: MCODEing on OSX
(02-27-2019 09:09 PM)Didier Lachieze Wrote:  
(02-27-2019 08:40 PM)Jurgen Keller Wrote:  I'm going to rewrite the 41 OS

Wow ! For a MCODE beginner that's not a small project... anyway, let me know if this can be useful for you.

Well, I was just kidding, I don't aim that high!

I've read through the referenced thread a while ago. It's an interesting project but I guess it's also a LOT of work. Personally, a VASM PDF is good enough for my purposes (as a reference and to study some code). However, from a preservation point of view a SDK41 compatible version of the 41C VASM source files is a very nice-to-have.
Find all posts by this user
Quote this message in a reply
02-28-2019, 02:17 AM
Post: #16
RE: MCODEing on OSX
Hi everybody,
Its the character of assembler/mCode to get in charge of things, just as Bill Gates said "Its software that will shape the things to come in computing". Look at what has happened with the HP41, since HP did their work on it in the 1980's, to the revolutionary 41CL model of today.
See the adaptability because of mCode, that has joined the dots. Surely everyone should be into it, although, looking at the optimization in ROMs & peripheral hardware, there might not be much left to program? Some while ago now, I mentioned in a post about merging syntho' RPN into the mainframe ROMs!
Its a going to be another great day for programmers.
The result: 'OLD JUNK' that is not junk. DA.
Find all posts by this user
Quote this message in a reply
02-28-2019, 08:02 PM
Post: #17
RE: MCODEing on OSX
(02-27-2019 08:53 PM)Jurgen Keller Wrote:  That's exactly my current list of MCODE documentation:
  • MCODE for Beginners by Ken Emery
  • SDK41 Manual
  • A Programmer's handbook by Poul Kaarup
  • NEWT Microprocessor Technical Manual by Monte Dalrymple
  • Coconut VASM listing

I would also add the HEPAX Module Manual, Volume 2, available on TOS. Some useful information on BANK switching, memory access idiosyncrasies, and peripherals and other things.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-01-2019, 10:52 AM
Post: #18
RE: MCODEing on OSX
(02-28-2019 08:02 PM)RobertM Wrote:  
(02-27-2019 08:53 PM)Jurgen Keller Wrote:  That's exactly my current list of MCODE documentation:
  • MCODE for Beginners by Ken Emery
  • SDK41 Manual
  • A Programmer's handbook by Poul Kaarup
  • NEWT Microprocessor Technical Manual by Monte Dalrymple
  • Coconut VASM listing

I would also add the HEPAX Module Manual, Volume 2, available on TOS. Some useful information on BANK switching, memory access idiosyncrasies, and peripherals and other things.

Fully agreed. There are well-done PDFs available on TOS of both HEPAX manuals. Recently I've used a book printing service to get a hard copy for a few bucks.

[Image: hepax-manuals-printed.jpg]
Find all posts by this user
Quote this message in a reply
03-07-2019, 02:42 PM
Post: #19
RE: MCODEing on OSX
Besides reading about MCODE and trying to make sense out it I also made some progress with syntax highlighting. Still some refinements needed so.

[Image: mcode-highlight-beta.png]
Find all posts by this user
Quote this message in a reply
03-08-2019, 12:02 PM (This post was last modified: 03-08-2019 12:03 PM by Ángel Martin.)
Post: #20
RE: MCODEing on OSX
(03-07-2019 02:42 PM)Jurgen Keller Wrote:  Besides reading about MCODE and trying to make sense out it I also made some progress with syntax highlighting. Still some refinements needed so.

Very handsome!
Find all posts by this user
Quote this message in a reply
Post Reply 




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