private static TranslationResult processSimpleMemoryAccessFromCompoundAddress(ITranslationEnvironment environment,IOperandTreeNode segmentOverride,OperandSize size,boolean loadOperand,TranslationResult intermediateResult){
  final OperandSize archSize=environment.getArchitectureSize();
  final String truncationMask=String.valueOf(TranslationHelpers.getAllBitsMask(archSize));
  String childResult=intermediateResult.getRegister();
  if (segmentOverride != null) {
    final String pseudoRegister=getSegmentOverridePseudoRegister(segmentOverride);
    String nextVariableString=environment.getNextVariableString();
    intermediateResult.addInstruction(ReilHelpers.createAdd(0,archSize,childResult,archSize,pseudoRegister,archSize,nextVariableString));
    childResult=nextVariableString;
  }
  final String truncatedAddress=environment.getNextVariableString();
  intermediateResult.addInstruction(ReilHelpers.createAnd(0,archSize,childResult,archSize,truncationMask,archSize,truncatedAddress));
  if (loadOperand) {
    final String loadedValue=environment.getNextVariableString();
    intermediateResult.addInstruction(ReilHelpers.createLdm(0,archSize,truncatedAddress,size,loadedValue));
    intermediateResult.updateResult(loadedValue,size,truncatedAddress,TranslationResultType.MEMORY_ACCESS);
  }
 else {
    intermediateResult.updateResult(truncatedAddress,size,"",TranslationResultType.MEMORY_ACCESS);
  }
  return intermediateResult;
}

private static TranslationResult processSimpleMemoryAccessFromCompoundAddress ( ITranslationEnvironment environment , IOperandTreeNode segmentOverride , OperandSize size , boolean loadOperand , TranslationResult intermediateResult ) { final OperandSize archSize = environment . getArchitectureSize ( ) ; final String truncationMask = String . valueOf ( TranslationHelpers . getAllBitsMask ( archSize ) ) ; String childResult = intermediateResult . getRegister ( ) ; if ( segmentOverride != null ) { final String pseudoRegister = getSegmentOverridePseudoRegister ( segmentOverride ) ; String nextVariableString = environment . getNextVariableString ( ) ; intermediateResult . addInstruction ( ReilHelpers . createAdd ( 0 , archSize , childResult , archSize , pseudoRegister , archSize , nextVariableString ) ) ; childResult = nextVariableString ; } final String truncatedAddress = environment . getNextVariableString ( ) ; intermediateResult . addInstruction ( ReilHelpers . createAnd ( 0 , archSize , childResult , archSize , truncationMask , archSize , truncatedAddress ) ) ; if ( loadOperand ) { final String loadedValue = environment . getNextVariableString ( ) ; intermediateResult . addInstruction ( ReilHelpers . createLdm ( 0 , archSize , truncatedAddress , size , loadedValue ) ) ; intermediateResult . updateResult ( loadedValue , size , truncatedAddress , TranslationResultType . MEMORY_ACCESS ) ; } else { intermediateResult . updateResult ( truncatedAddress , size , "" , TranslationResultType . MEMORY_ACCESS ) ; } return intermediateResult ; }
if the operand involves arithmetic , once this arithmetic is done , the segment base register ( if present ) has to be added in and the result has to be truncated to 32 bits . this function performs this task .
