Programming with CP/M-68K |
CP/M-68K commands
can be typed in
upper or lower case, however upper case is recommended. |
|
|
Compiling
BASIC programs |
|
ASCIIART.BAS file
contents: |
|
10 for y=-12 to 12 |
20 for x=-39 to 39 |
30 ca=x*0.0458 |
40 cb= y*0.08333 |
50 a=ca |
60 b=cb |
70 for i=0 to 15 |
80 t=a*a-b*b+ca |
90 b=2*a*b+cb |
100 a=t |
110 if (a*a+b*b)>4 then goto
200 |
120 next i |
130 print " "; |
140 goto 210 |
200 if i>9 then i=i+7 |
205 print chr$(48+i); |
210 next x |
220 print |
230 next y |
|
|
ASCIIART.BAS
is an example BASIC program, here we convert this to an
executable program: |
|
Type: CB68
ASCIIART |
Type: LINK68
ASCIIART.O,CB68.L68 |
|
To run the
resulting executable: |
|
Type: ASCIIART |
|
|
Compiling
C programs |
|
HELLO.C file
contents: |
|
main() |
{ |
printf("Hello World"); |
} |
|
|
HELLO.C
is an example C program, here we convert this to an
executable program: |
|
Type: C
HELLO |
Type: CLINK
HELLO |
|
To run the
resulting executable: |
|
Type: HELLO |
|
|
Assembly
Language |
|
HELLO.S file
contents: |
|
|
text |
start: |
|
|
move #9,d0 |
|
move.l #msg,d1 |
|
trap #2 |
|
rts |
|
|
|
data |
msg: |
dc.b 13,10,'Hello
World',13,10,'$' |
|
|
HELLO.S
is an example assembly language program, here we convert this to an
executable program: |
|
Type: AS68 -U
-L HELLO.S |
Type: LINK68
HELLO |
|
To run the
resulting executable: |
|
Type: HELLO |
|
|