CCVAX.gregory%nosc@sri-unix.UUCP (06/22/83)
------- Has anyone had any experience with the Aztec C compiler, for the CP/M operating system. I would like to know how well this C will interact with the CP/M operating system. In BDS C there are several functions that allow you to get to the BDOS, BIOS and ports without writting the code in assembler. Are there similar functions in Aztec C or will I have to write them. How does Aztec C interface with functions that are written in assembler, is this very difficult to do. Greg Meckstroth gregory@nosc -------
lee%brl-bmd@sri-unix.UUCP (06/22/83)
From: Robert Lee Feider (CTAB) <lee@brl-bmd> Hi, I have used the AZTEC C compiler for a small amount of work and I am very impressed. Yes it does have links to the BDOS and BIOS thru function calls and there is a piece of user submitted (i.e. not written by MANX software) routine which allows one to write and read from an I/O port. Aztec does allow romable routines but I have not actually tried this yet. Inline assembly code is allowed thru the use of #ASM and #ENDASM macros and the calling convention of how to pass local variables on the stack is defined and an example given. I hope this is enough information, if not give me a holler. lee@brl-bmd
CCVAX.revc%nosc@sri-unix.UUCP (06/23/83)
From: Bob Van Cleef <CCVAX.revc@nosc> Check with Bill Lafond, he has a copy. - Bob
MADLER%mit-ml@sri-unix.UUCP (06/23/83)
From: Michael C. Adler <MADLER@mit-ml> Aztec C provides an excellent interface to both BIOS/BDOS CP/M calls and assembly programming. The following calls are defined (taken from release 1.05 manual): bdos (bc,de) int bd,de; Calls the bdos with register pair BC set to bc and DE set to de. The value returned in HL is the return value. bios(n,bc,de) int n,bc,de; Calls the n'th entry into the bios with BC set to bc and DE set to de. The returned value is the accumulator contents on return from the CP/M BIOS. N equal to zero is a warm boot. bioshl(n,bc,de) int n,bc,de; Calls the n'th entry into the bios with BC set to bc and DE set to de. The returned value is the HL register contents on return from the CP/M BIOS. N equal to zero is a warm boot. CPM(bc,de) int bc,de; Calls the bdos with register pair BC set to bc and DE set to de. The value returned in HL is the return value. ------------------- Aztec C creates intermediate assembly language code. An intel assembler (subset of M80) is provided, although it is possible to use M80/L80. So, interfacing assembly code is rather trivial. Note: Aztec C DOES NOT create modules that can be bound immediately. It is only capable of generating assembly code. Hence it can be rather slow to compile (the C compiler alone is significantly slower than BDS C). You should also note that it supports a Z80 mode that allows register variables (8080 version syntax permits register vars. but stores them in memory). In tight loops you will notice a BIG difference. In 8080 mode, execution speed seems to be similar to BDS C. -Michael
andrew@orca.UUCP (06/25/83)
Yes, you can do all of the following with Aztec C (a C compiler for CP/M-80 v2): -- make arbitrary calls upon the BDOS (you pass the BDOS number and register contents, and get back new register contents); -- make calls upon arbitrary BIOS vectors (passing/receiving register contents); -- do INs and OUTs easily to arbitrary ports; -- interface to assembler language routines; the calling convention is straightforward and just what an experienced Unix C hacker would expect. Another big win of this C compiler is full support for statics, structures, and initializers. I used it to write a Basic compiler, with lots of initialization of static lex and parse table. It comes with a relocating assembler and loader, or you can use MACRO-80. -- Andrew Klossner (decvax!teklabs!tekecs!andrew) [UUCP] (andrew.tektronix@rand-relay) [ARPA]
andrew@orca.UUCP (06/25/83)
In his otherwise excellent description of Aztec C, Michael C. Adler stated: You should also note that it supports a Z80 mode that allows register variables (8080 version syntax permits register vars. but stores them in memory). In fact, the first register var in the 8080 version is allocated to the "BC" register pair. This provides impressive gains in code space and execution speed. It is true that the Z80 version gives you a total of three registers (BC, IX, and IY), but non-recursive routines always win by using static allocation in place of IX/IY. This is because every access to an IX/IY register is done via "PUSH IX; POP HL", and every access to a static word is done by "LD HL,(WORD)". Each sequence takes three bytes, but the IX access requires more cycles than the static access. Of course, "auto" allocation is the biggest lose (it results in "LD HL,OFFSET; ADD HL,SP; LD E,(HL); INC HL; LD D,(HL); EX DE,HL"), which is why IX/IY win for recursion. -- Andrew Klossner (decvax!teklabs!tekecs!andrew) [UUCP] (andrew.tektronix@rand-relay) [ARPA]