$include (..\lib\compStch.ext) /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore as the author * * While the ACME Software Deli does not work for money, there is nonetheless a * significant amount of work involved. The ACME Software Deli maintains the rights * to all code written, though it may be used and distributed as long as the following * conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in your * distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli * 4. You distribute your code and any modifications to my code freely. * 5. There is no charge for your work which uses this library *============================================================================ */ testFunctionParametersModule: do; $if not noID declare IDString (*) byte data ( '$Id: tFParam.p86 946 2024-03-04 23:29:57Z rmgillmore $', 0 ); $endif $include (..\lib\comnDefs.ext) $set ( testFunctionParametersSource ) $include (..\lib\debugHlp.ext) $include (..\lib\parmData.ext) $include (..\lib\sysCalls.ext) $include (..\lib\ptrMath.ext) declare noParams pointer data ( @noParamsFunc ), oneParam pointer data ( @oneParamFunc ), twoParams pointer data ( @twoParamsFunc ); declare charVar char; noParamsFunc: procedure public; declare actualBasePtr pointer, parameterData paramDataStruct, BLOCK_SIZE literally '64', reportPointer pointer; actualBasePtr = reportBasePtr; call initParamData( actualBasePtr, @parameterData ); call reportVarValue( @( 'address passed to initParamData', 0 ), pointerType, @actualBasePtr ); reportPointer = decPtr( actualBasePtr, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in noParamsFunc: surrounding base', 0 ), wordType, BLOCK_SIZE, reportPointer ); reportPointer = decPtr( @parameterData, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in noParamsFunc: surrounding parameterData', 0 ), wordType, BLOCK_SIZE, reportPointer ); end noParamsFunc; oneParamFunc: procedure ( oneParamVar ) public; declare oneParamVar word; declare actualBasePtr pointer, parameterData paramDataStruct, BLOCK_SIZE literally '64', reportPointer pointer; actualBasePtr = reportBasePtr; call reportVarValue( @( 'actualBasePtr', 0 ), pointerType, @actualBasePtr ); call initParamData( actualBasePtr, @parameterData ); reportPointer = @oneParamVar; call reportVarValue( @( 'address of oneParamVar', 0 ), pointerType, @reportPointer ); call reportVarValue( @( 'value of onParamVar', 0 ), wordType, @oneParamVar ); call reportVarValue( @( 'address passed to initParamData', 0 ), pointerType, @actualBasePtr ); reportPointer = decPtr( actualBasePtr, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in oneParamFunc: surrounding base', 0 ), wordType, BLOCK_SIZE, reportPointer ); reportPointer = decPtr( parameterData.stackDataPtr, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in oneParamFunc: surrounding parameterData', 0 ), wordType, BLOCK_SIZE, reportPointer ); end oneParamFunc; twoParamsFunc: procedure ( firstParam, secondParam ) public; declare firstParam word, secondParam word; declare actualBasePtr pointer, parameterData paramDataStruct, BLOCK_SIZE literally '64', reportPointer pointer; actualBasePtr = reportBasePtr; call initParamData( actualBasePtr, @parameterData ); reportPointer = @firstParam; call reportVarValue( @( 'address of firstParam', 0 ), pointerType, @reportPointer ); reportPointer = @secondParam; call reportVarValue( @( 'address of secondParam', 0 ), pointerType, @reportPointer ); call reportVarValue( @( 'address passed to initParamData', 0 ), pointerType, @actualBasePtr ); reportPointer = decPtr( actualBasePtr, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in twoParamsFunc: surrounding base', 0 ), wordType, BLOCK_SIZE, reportPointer ); call reportVarValue( @( 'stackDataPtr', 0 ), pointerType, @parameterData.stackDataPtr ); reportPointer = decPtr( parameterData.stackDataPtr, size( charVar ), BLOCK_SIZE ); call reportBlockValues( @( 'in twoParamsFunc: surrounding parameterData', 0 ), wordType, BLOCK_SIZE, reportPointer ); end twoParamsFunc; main: procedure ( numArgs, argStrsPtr, envPtr ) integer public; declare numArgs integer, argStrsPtr pointer, argStrs based argStrsPtr (*) pointer, envPtr pointer; declare returnCode integer; returnCode = 0; call noParams( 1, 2, 3 ); call oneParam( 4, 5, 6 ); call twoParams( 7, 8, 9 ); return ( returnCode ); end main; end testFunctionParametersModule;