Cromemco Macro Assembler

14 views
Skip to first unread message

Chris LaFond

unread,
Aug 31, 2025, 12:00:52 AM (9 days ago) Aug 31
to Cromemco

Hello everyone,

I am still having some issues with Cromemco's Macro assembler. For some reason I cannot get programs to work right with the ORG statement.

If ORG 100H is at  the top of the code it is fine, but if I put ORG 100H not at the top, it starts executing at whatever is first. I am also putting the main routines name with the END statement but that isn't helping.

MYPROG:

    ... some code

END MYPROG

Does the main routine have to be named something special?

I thought the assembler/linker would put a jump instruction at the beginning of the code to jump to the 'main' routine. Is this true?

If someone has some advice or could help me understand this better I would appreciate it.

Thanks

--

David Roberts

unread,
Aug 31, 2025, 3:11:54 AM (9 days ago) Aug 31
to crom...@googlegroups.com
I would put ORG 100h before any code at all.

I would also put a jump to the entry point of your program (if not the first instruction).

I would usually equate a symbol (like START) to be 100h and then you can use "ORG START", and a label called MAIN: as your entry point that you can jump to.

Of course, please change the symbols to suite your naming convention.

Some assemblers accept a symbol after the END statement to define the entry point.

Some linkers permit the entry point symbol (assuming it has been made public) to be used as the entry point.

I can't remember exactly what conventions are used by the Cromemco Macro Assembler, but my post should give you a couple of things to look at.

Dave


--
You received this message because you are subscribed to the Google Groups "Cromemco" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cromemco+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cromemco/72e5238e-bf12-46e3-beb9-eae89db2d072%40gmail.com.

Udo Munk

unread,
Aug 31, 2025, 3:18:50 AM (9 days ago) Aug 31
to Cromemco
If you use something like:

LABEL:
...
...
            END LABEL

the assembler won't put a JP LABEL into the code, it can't because it won't know where LABEL is. So it generates a hint for the linker, which then can compute the address for LABEL and generate an appropriate JP.

David Roberts

unread,
Aug 31, 2025, 3:56:45 AM (9 days ago) Aug 31
to crom...@googlegroups.com
See page 44 of the Cromemco Macro assembler manual describing the END statement.

Dave

--
You received this message because you are subscribed to the Google Groups "Cromemco" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cromemco+u...@googlegroups.com.

Chris LaFond

unread,
Aug 31, 2025, 1:46:31 PM (8 days ago) Aug 31
to crom...@googlegroups.com

Thank you for the replies.

I have read through the assembler manual and reread the END,ENTRY and I am not seeing where it explicitly states the rules for this.

I know older manuals make you read between the lines versus stating crucial information to an obvious manner.

The only thing that works for me is putting ORG 100H at the top with a jump instruction next to point to the main routine.

Adding END MAIN (label to main routine) does not seem to produce the effect that it is supposed to. adding ENTRY MAIN above the main routine does not seem to effect anything either.

An example of what is confusing me. From the TUART manual, page 24 "initialization subroutine". Maybe I shouldn't be trying to assemble this as a stand alone program but it looks like it should work. The example starts with line 36 -  ORG 1000H. line 107 has ORG 100H (where the entry point should be). The program does not use the END statement. The linker complains about invalid jump addresses and overlaying data.

Link to manual:

https://deramp.com/downloads/mfe_archive/010-S100%20Computers%20and%20Boards/00-Cromemco/10-Cromemco%20S100%20Boards/TU-ART/Cromemco%20TU-ART%20Manual%201978.pdf

My machine does not like this code. ORG 1000H is the biggest problem. If I replace that with ORG 100H and JP to line 109 ( I labeled it START, commented out the original org 100h)), the program runs.

Thanks for the help. I feel ignorant and I appreciate the enlightenment.

curt mayer

unread,
Aug 31, 2025, 2:24:24 PM (8 days ago) Aug 31
to crom...@googlegroups.com
Not sure what exactly you are trying to do.  ORG just sets the current location address, and subsequent code assembles from that, incrementing the location.  For relocatable code like a subroutine library, you don't want ORG in there at all.

Cp/m and derivatives want to load com files at 0x100, and all jump directly there from the CCP 



one of the crossbeams has gone out of skew on the treadle

EmailLogo.png

David Roberts

unread,
Aug 31, 2025, 2:41:14 PM (8 days ago) Aug 31
to crom...@googlegroups.com
Page 23 is just a 'part example' hence the reason ot doesn't have an END.

Also, putting an ORG 1000h before the first instruction (label INIT:) would be assembler stupidity!

Either you will end up with a very large amount of waste space between the end of your main program (starting at 100h) and 1000h. Or else your main program will exceed address 1000h and then you are telling the assembler that you want some (more) code overlapping 1000h...

Note that page 23 and page 24 are separate programs and are not related to each other in any way.

Note that both of the separate programs both contain a label called INIT:. If you tried to put the two 'programs' in the same program, the assembler/linker would either complain, or confuse the h*ll out of the human reader with two labels called INIT:.

Dave

KDK KDK

unread,
Aug 31, 2025, 2:44:59 PM (8 days ago) Aug 31
to Cromemco
I am trying to create a standalone program. No external calls. From the example code in the TUART manual, is that meant to be typed in and ran as is? I would assume it is. 
I understand how ORG works but I don't understand why the linker isn't starting at 100H, if there is an org statement before that one. In the example it states ORG 1000H and then ORG 100H. Program doesn't run and debug shows nothing in memory at 100H.
Maybe someone has a better example I could use to learn off of - that might solve my problems

David Roberts

unread,
Aug 31, 2025, 2:51:22 PM (8 days ago) Aug 31
to crom...@googlegroups.com
Can you post your source program please?

Dave

Roger Hanscom

unread,
Aug 31, 2025, 2:52:32 PM (8 days ago) Aug 31
to crom...@googlegroups.com

>> My machine does not like this code. ORG 1000H is the biggest problem. If I replace that with ORG 100H

>> and JP to line 109 ( I labeled it START, commented out the original org 100h)), the program runs.

I'm looking at my TUART manual right now.  I think that the initialization code shown is just meant to be a subroutine to be included in a program that uses the TUART.  The ORG 1000H is just used to put this little snippet of code somewhere out of the way of the main program that will probably be ORGed at 100H.

As far as the END syntax, that sounds like an assembler problem or bug.  I always use a cross assembler to generate Z80 code and then download the .HEX file for "LOAD" and run.  That way you wouldn't have to put up with ancient applications that might have problems.

Roger

David Roberts

unread,
Aug 31, 2025, 2:53:12 PM (8 days ago) Aug 31
to crom...@googlegroups.com
I am not understanding...

The two (2) parts of programs (page 23 and page 24) do not have anything to do with each other...

Dave

On Sun, 31 Aug 2025, 19:44 KDK KDK, <kdkconstr...@gmail.com> wrote:

KDK KDK

unread,
Aug 31, 2025, 3:06:36 PM (8 days ago) Aug 31
to Cromemco
I am not using the example on 23. 
The second example starts on 24 and goes for a few pages. 
Why did they put ORG 1000H at the top?
Is this a bad example and they should have wrote it different?

Roger Hanscom

unread,
Aug 31, 2025, 3:22:28 PM (8 days ago) Aug 31
to crom...@googlegroups.com
How about this?

Roger

[Please keep in mind that the average programmer can't write around 8-10 lines of code without introducing an error, and I'm not anywhere close to average!!  *grin*]
myecho.lst

David Roberts

unread,
Aug 31, 2025, 3:23:14 PM (8 days ago) Aug 31
to crom...@googlegroups.com
If you enter the program (and associated subroutines) as defined on pages 24, 25 and 26; and add the missing END statement (!) This program should work.

The main program is the bit on page 26 containing the ORG 100h. The assembler places this code at 100h extending to 10Dh.

The subroutines (pages 24 and 25) have an ORG at 1000h to keep the code AWAY from 100h (as this is where the main program should be located).

I would (personally) start my program as follows:

   ORG 100H
   JP GOGOGO

; Then include the codes for the subroutines and the main program itself (but minus any ORG statements).

The main program entry point would contain the label GOGOGO:.

This avoids the necessity to have a silly ORG in place to convince the assembler to reserve space for the main program that us at the end of the file...

It also avoids having a load of potentially wasted space from 10Eh to FFFh.

Dave

Reply all
Reply to author
Forward
0 new messages