Project journal

A project log for NS 32000 cross-assembler in C

By Richard Rodman, and published in Dr. Dobbs' Journal.

keithKeith 02/11/2024 at 15:500 Comments

Tasks done

There's about a weekend work there.

I don't have the time to debug the code right now, but I have uploaded it for other people who might be interested in doing so.

The code itself is very old, in K&R instead of ANSI style. I took the liberty of updating it to ANSI style and standard include files.

The code uses short variable names like 'o' and 'l' which people used to do when disk space was limited. The OCR confused them with '0' and '1', requiring many corrections. Modern style is to use longer and self-explanatory names, but I shan't change variable names for now.

The code uses pointers a lot, which is not as readable as arrays. Rogue pointers are apt to crash programs, which is likely the cause of the current crashing.

The code use alloc(), which my compiler didn't recognise so I replaced it with malloc(). I have never written programs that required malloc, so I don't know if that is a big mistake or not.


Alan Cox gets the code to a respectable state where it can do something before crashing.

I notice that it does note assemble the file you tell it to.
You have to give it the filename without extension.
It will then look for filename.s and create filename.hex

It assembles test_nop.s with the command

./A32000 test_nop


./A32000 test


>>---> Error u at icu
>>---> Error u at zvers
>>---> Error u at realst
>>---> Error u at memszx
>>---> Error u at mem1
Segmentation fault (core dumped)

To do: