PDA

View Full Version : CP/M 2.2 assembly language



Mike_Z
November 28th, 2016, 07:59 AM
Over the weekend, while watching the football on TV, I started to convert my monitor and cold start loader programs to CP/M assembly. I thought of trying to use MS Word and save the file as text. Then transfer it to an 8" disk. It worked for the most part, some of the TAB's were screwed up and the format looked goofy in WordStar. It was not consistent, so I could not determine why. No matter. So, I tried to assemble it and found a boat load of errors, mostly typo's that I has made, but a few that I do not understand.
First, I have a JUMP table at the beginning and then code afterward. I want the entry or start to be at F810H, so I coded it like this.


ORG F800H
JUMPT: JMP SETDMA
JMP CSEEK
JMP CREAD
JMP CWRITE

ORG F810H
START: DI


BUT... the assembler doesn't like the second ORG statement.

Second, I used some labels that maybe reserved names?


CCP: EQU 0E400H
BIOS: EQU 0F200H


The assembler reported these as 'L' or label errors. Thanks Mike

Chuck(G)
November 28th, 2016, 08:20 AM
Easy--if a constant starts with a letter, you must prefix it with a zero--otherwise, the assembler has no way to tell if you mean a symbolic label ("F810" is a perfectly legitimate symbol). Thus, 0F810H will be accepted as a constant.

Mike_Z
November 28th, 2016, 08:40 AM
Geeezzz... I should have known that! I did that with the EQU's etal.


Thanks Mike

Mike_Z
November 28th, 2016, 08:54 AM
I have also stumbled across the Label errors, regarding CCP & BIOS. I defined them two different times with different values. I can make all kinds of mistakes and if I'm using a computer I can make them faster. Mike