• Please review our updated Terms and Rules here

Altos 8000 ASM

SSN638

New Member
Joined
Oct 12, 2025
Messages
7
I recently purchased an Altos CP/M Z80 machine from a fellow collector. OS is Digital Research CP/M ver2.2 with CP/M Assembler ver2.0. I'm new to the CP/M world - that's why I purchased it (and it was in excellent condition with a nice TeleVideo 910 CRT). So, I want to write Assembly Language programs for it, but the last time I wrote ASM was 40 years ago for the IBM PC. I downloaded lots of Z80 Assembly Language books, but have no success getting even "Hello World" to compile!

I would be grateful if anyone could provide a simple assembly program that is known to work on an Altos 8000 to get me started?
Is the issue that the Altos BIOS is so different?
Thanks All,
John
 
Any 'Hello World' program for any CP/M machine should work.
That's whole point of having a standard API set of calls.
Try this:
Code:
;================================================
; CP/M "Hello World" for M80/L80
; Test program by John Garza
; Jan 2010 Conroe
;=================================================
;
;------------------
; COMMON EQUATES

CR    EQU    0DH    ; ASCII Carriage return
LF    EQU    0AH    ; ASCII Line feed
BDOS    EQU    5    ; CPM BDOS entry point
DMABUF    EQU    80H    ; CPM DMA Buffer location
PRSTR    EQU    9H    ; BDOS Print String Function
BOOT    EQU    0H    ; CPM Reboot
;------------------
; Assembler Setups

.Z80            ;Use Z80 mnemonics (delete for 8080)
    ORG    100H    ;CPM TPA starts @ 0100H
    ENTRY    MAIN    ;REQUIRED by L80 !

;------------------
; MAIN

MAIN:

; 8080 code
;    LXI    SP,STACK    ;SET LOCAL STACK POINTER   
;    LXI    D,MSG
;    MVI    C,PRSTR
;    CALL    BDOS
;    JMP    BOOT
    
; Z80 code
    LD    SP,STACK
    LD    DE,MSG
    LD    C,PRSTR
    CALL    BDOS
    JP    BOOT

MSG:
    DB        CR,LF,'Hello World',CR,LF,'$'
        
;------------------
; STACK AREA

    DS    100H    ;MODIFY STACK SIZE AS NEEDED
STACK    EQU    $    ;TOP OF STACK

;------------------
    END MAIN    ;END <startlabel> REQUIRED by L80 !
;------------------
 
If the assembler you have is the Digital Research ASM, which sounds like what you have, you'll need to use Intel mnemonics, not Zilog. See the "8080 code" section of comments. If you name the file "HELLO.ASM", then the commands would be
Code:
asm hello
load hello
hello
The last step actually runs the program "HELLO.COM", produced by the "load" command. If there are any errors along the way, then subsequent steps won't work.
 
I downloaded lots of Z80 Assembly Language books, but have no success getting even "Hello World" to compile!
The original CP/M assembler uses the Intel 8080 syntax. It does not understand Z80 instructions.

The following minimal program should work:

Code:
        ORG     100H

START:  MVI     C, 9        ; print string = function 9
        LXI     D, MSG      ; load string pointer in DE
        CALL    5           ; call BDOS = address 5
        RET                 ; return directly (CCP is still in memory)

MSG:    DB 'Hello World!$'  ; CP/M dollar-terminates strings

Save this as HELLO.ASM, then execute the following:
ASM HELLO.AAZ
LOAD HELLO
The ASM command syntax is special. It means "read HELLO.ASM from drive A: and write HELLO.HEX to drive A: and write HELLO.PRN to nowhere". Running "ASM HELLO.HEX" means "read HELLO.ASM from drive H: and write HELLO.HEX to drive E: and write HELLO.PRN to the console", which is not what you want.

The LOAD command converts your HEX file to a COM file.
 
All,
Good stuff here - a step or two I have forgotten!
So to understand, I must use the Intel 8080 format in johnx993's code. Haven't done that yet!
Ok, so far I entered, compiled and loaded the HELLO.ASM code as johnx993 recommended. It compiled and loaded. When I ran the HELLO.COM file I did not receive any errors, but I also did NOT see any output. Attached is the HELLO.PRN file printed to the CRT.

Question: What does the ".Z80" just below the "; Assembler Setups" line mean in johnx993's code?
AND will ".Z80" just go away when I use the 8080 code?

My next step is to use the 8080 instead of the Z80 code in johnx993's code. Will get back to you!

Hello.PRN.jpg
 
If you are truly getting started at the rock bottom, I can recommend the book: Soul of CP/M by Waite and LaFore.
It covers everything you need to get started with the basics provided by DR.
 
If you are truly getting started at the rock bottom, I can recommend the book: Soul of CP/M by Waite and LaFore.
It covers everything you need to get started with the basics provided by DR.
Ya, good idea. A "frame-off restoration" of my assembly language knowledge it probably the best way to go. I remember doing it in college, but that was when we used punch cards!
 
When you try to assemble this program (when it has the Zilog mnemonics) using ASM.COM you get the following output:
Code:
CP/M ASSEMBLER - VER 2.0
S               .Z80            ;Use Z80 mnemonics (delete for 8080)
L                   ENTRY    MAIN    ;REQUIRED by L80 !
S                   LD    SP,STACK
L                   LD    DE,MSG
S                   LD    C,PRSTR
S0216               END MAIN    ;END <startlabel> REQUIRED by L80 !
0216
000H USE FACTOR
END OF ASSEMBLY
While it may not be obvious, those lines beginning with 'S' and 'L' are assembler errors. The assembler still generates a HEX file, but because of the errors that HEX is not a viable program.

Again, you need to be using the Intel mnemonics.

"Zilog mnemonics" and "Intel mnemonics" are more precise terms compared to "8080 code" and "Z80 code". It is possible to write Z80 code using Intel mnemonics (possibly using macros for the Z80 instructions), and it is also possible to write code to be run on an 8080 using Zilog mnemonics (as long as you avoid the Z80 instructions). The assemblers Digital Research provides only support Intel mnemonics. Microsoft's M80 supports both.
 
Ok, so far I entered, compiled and loaded the HELLO.ASM code as johnx993 recommended. It compiled and loaded. When I ran the HELLO.COM file I did not receive any errors, but I also did NOT see any output. Attached is the HELLO.PRN file printed to the CRT.
Whenever the DRI assembler gets verbose, something is wrong. In your case, the HELLO.PRN is filled with error messages. Obviously, the result won't work. The code you entered is written for Microsoft's toolchain, i.e. M80 (assembler) and L80 (linker).

Try the code I provided instead.

Question: What does the ".Z80" just below the "; Assembler Setups" line mean in johnx993's code?
It tells the assembler to switch into Z80 mnemonic mode. ASM does not understand this.

The documentation for ASM is available [here].
 
Whenever the DRI assembler gets verbose, something is wrong. In your case, the HELLO.PRN is filled with error messages. Obviously, the result won't work. The code you entered is written for Microsoft's toolchain, i.e. M80 (assembler) and L80 (linker).

Try the code I provided instead.


It tells the assembler to switch into Z80 mnemonic mode. ASM does not understand this.

The documentation for ASM is available [here].
Your code worked fine!
Written lots of C# code, so I thought I would never get excited about a "HELLO WORLD" program!!
This gives me a good idea of where I need to go next. I ordered the "Soul of CP/M" by Waite and LaFore recommended by johnx993.
 

Attachments

  • HELLO2 13Oct25.JPG
    HELLO2 13Oct25.JPG
    86.7 KB · Views: 3
If you are truly getting started at the rock bottom, I can recommend the book: Soul of CP/M by Waite and LaFore.
It covers everything you need to get started with the basics provided by DR.
Ordered the book.
I used the Intel mnemonic part of your code, but I believe I added extra code that is not allowed because I get an "INVERTED LOAD ADDRESS" error when I run LOAD.COM. Attached is the screen shot of the PRN and error message. I got svenska's code to work fine.

I found a description of the error message - not sure what it means!
ERROR: INVERTED LOAD ADDRESS, LOAD ADDRESS hhhh
LOAD. The address of a record was too far from the address of the previously-processed record. This is an internal limitation of LOAD, but it can be circumvented. Use DDT to read the HEX file into memory, then use a SAVE command to store the memory image file on disk.

Thanks for your help!
John
 

Attachments

  • HELLO.PRN 13Oct25.JPG
    HELLO.PRN 13Oct25.JPG
    102.1 KB · Views: 6
LOAD expects origin address to be declared ORG 0100H otherwise gives INVERTED LOAD ADDRESS.
Load creates a COM file to be run at 0100h.

Larry G
 
I used the Intel mnemonic part of your code, but I believe I added extra code that is not allowed because I get an "INVERTED LOAD ADDRESS" error when I run LOAD.COM.
You are using Digital Research's ASM, which is very simple and creates an absolute output file (in hexadecimal format). The final address needs to be set with an ORG statement in the code. For COM files, this is always "ORG 0100h". The LOAD command just converts the hexadecimal to binary.

Microsofts tools are more advanced. M80 creates a relocatable object file. L80 will then combine object files to form the absolute output file. The final address is set with an argument to L80 and not in the code.

So if you send code written for M80/L80 to ASM, the final address is unset (set to 0000h), which is what causes the error. Simply put, the code John posted is not suitable for your environment. You need Microsoft's assembler to use it. Otherwise you end up rewriting most of the code (since there is so little of it).
 
When you try to assemble this program (when it has the Zilog mnemonics) using ASM.COM you get the following output:
Sorry, I thought everyone knew by now that ASM is 8080 only.
If you bother to read the comments of my code (a good programming habit),
you will see it's for M80/L80 which does support Z80 mnemonics with the .Z80 directive.
M80 is far superior to ASM and supports macros as well as Z80 code.
I also included the equivalent 8080 assembly steps commented out for comparison, or to use with ASM.
Enjoy!
-J
 
See John (SSM368) ?
I told you these guys on the VCF were good.
The best of them died recently but the remaining ones are good guys too.

I'm the guy that John bought the Altos and Televideo from.
John's trying stuff on that Altos that I never tried !
Keep at it John.

Lorne.
 
Back
Top