ontaining the declaration of crcok. #ifndef CODEINCLUDEINCLUDED #include "code_include.h" #endif #ifndef GEODESM2 This_file_can_only_be_used_with_objectGEODE_Simulato #endif #ifndef GEODESMEXPORT #define GEODESMEXPORT #include "hpredef.h" typedef char SDLCHARSTRING [GX STRMAX] struct SDLCHARSTRINGstruct { SDLCHARSTRING a; } ; extern DL_CHARSTRING_SDL_CHARSTRING_empty; #define SDL_CHARSTRING_empty (_SDL_CHARSTRING_empty.a) extern SDL_BOOLEAN crcok (SDL_INTEGER crcl) #endif Figure 8.18 The generated file v76.h F. Copy the file v76.h, rename it my_c.c, and modify it to obtain the content shown in Figure 8.19. The function crcok is defined, performing the same behavior as the SDL version. Here you could paste an actual CRC computation. Other Simulator Features 281 #include "v76.h" /* Test of the CRC, simplified version: if parameter crcl is negative, the CRC is incorrect else it is correct: * / SDL BOOLEAN crcok (SDL INTEGER crcl) if (crcl<0) return SDL_FALSE; else return SDL_TRUE; Figure 8.19 The file my_c.c G. Create the file v76.lub (list of user binaries) as shown in Figure 8.20. my_c.obj geodecc_sm my_c.c Figure 8.20 The files (a) v76.lub and (b) geodesm_ubld.bat H. Create the file geodesm_ubld.bat (geodesm_ubld.cmd in Unix) as shown in Figure 8.20. In the ObjectGeode Launcher, press again the Build button: the Simulator compiles the code generated from the SDL model, the file my_c.c, and generates the executable v76.sim (the file hpredef.h is also generated). J. Press the Execute button: the Simulator executes the SDL model plus the C function crcok. 8.2.3 Simulating ASN.1 data types The Simulator accepts SDL models containing ASN.1 data types definitions, as described in [Z105_1], with a few minor restrictions. ASN.1 is more powerful than the SDL data types, for example, it allows the CHOICE construct (similar to a C union). In addition, several protocol standards use ASN. 1 to describe data. 8.2.4 Adding buttons to the Simulator To simplify repetitive commands, buttons can be added to the Simulator interface.