Thursday, January 3, 2008

LE Callable Services vs. Assembler

The main program has a need to acquire storage in memory to store the member lists of the two datasets that are being compared. I used the LE Callable Services CEECRHP, CEEGTST, and CEEDSHP to acquire and release storage. These services are fairly easy to use but it just seemed like a lot of code to write to accomplish such a trivial task.

So I took all of that code out and instead I wrote an Assembler language program to invoke the GETMAIN and FREEMAIN macros directly to manage the needed storage. The new program source code is less than 100 lines long and the load module is around 500 bytes in size. I just use a static call to compile and link it in with the main program. The main program calls the new Assembler module to to all GETMAINs and FREEMAINs.

The source code for the main program is about a hundred lines smaller than it was when coded to call the LE services.


No comments: