next up previous contents
Next: 14.1 The Binary Source Up: The Interactive C Manual Previous: 13.2 Run-Time Errors

14 Binary Programs

With the use of a customized 6811 assembler program, IC allows the use of machine language programs within the C environment. There are two ways that machine language programs may be incorporated:

  1. Programs may be called from C as if they were C functions.

  2. Programs may install themselves into the interrupt structure of the 6811, running repetitiously or when invoked due to a hardware or software interrupt.

When operating as a function, the interface between C and a binary program is limited: a binary program must be given one integer as an argument, and will return an integer as its return value. However, programs in a binary file can declare any number of global integer variables in the C environment. Also, the binary program can use its argument as a pointer to a C data structure.

Fred G. Martin
Fri Mar 29 17:44:15 EST 1996