Writing your Language Environment-conforming assembler DLL code
To build a simple assembler DLL, your assembler routine must conform to Language Environment® conventions. To do this, begin by using the Language Environment macros CEEENTRY and CEETERM. The EXPORT= keyword parameter on the CEEENTRY macro allows you to identify specific assembler entry points for export. The CEEPDDA macro allows you to define data in your assembler routine that can be exported. Details on all Language Environment assembler macros are in Assembler macros.
Figure 1 shows how to use Language Environment macros to create an Assembler DLL. The CEEENTRY prolog macro has EXPORT=YES specified to mark this entry point exported. In this particular case we want the exported function known externally in lower case, so the CEEENTRY is followed by an assembler ALIAS statement. The ALIAS can be used to "name" the exported function with a mixed-case name up to 256 characters long. This assembler DLL also has two exported variables, "DllVar" (initial value = 123) and "DllStr" (initial value is the C string "Hello World"). When the exported function "dllfunc" is called, it sets "DllVar" to 456 and truncates the "DllStr" C string to "Hello".