April 2024

AWS Blu Insights - Assembly Language Analysis

We have improved the support of the Assembly language in AWS Blu Insights! For instance, we added a Cyclomatic Complexity computation and enhanced the Dependencies Analysis for Mainframe codebases for ALC, ASM, MLC, MAC and MACRO file types.

Cyclomatic Complexity

The Cyclomatic Complexity quantifies the number of linearly independent paths through a program’s source code. This metric is important when assessing a modernization project. For more information, see the documentation.      
For the Assembly, the calculation is based on branching decision points with extended mnemonic codes and conditional instructions. Branch instructions allow you to specify an extended mnemonic code, like for example JE or BNZ, for the condition on which a branch is to occur. The handled Mnemonic code categories are: 

  • used after compare instructions
  • used after arithmetic instructions
  • used after testing under mask instructions
  • branch relative on condition long
  • branch relative on condition
  • jump on condition long

Example of branching decision points with extended mnemonic codes:

JE label Jump on Equal 
JNZ label Jump on Not Minus 
BNZ ERROR Cluster not found or open error
BREL label Br Rel Long on Equal
BRH label Branch on High 
JLNE label Jump Long on Not Equal  

Example of conditional instructions:

AIF (T’&T NE T’&F).END Statement 1 
AGO .Test Statement 2

The decision points that do not affect the Cyclomatic Complexity are: Branch or Jump, which represent unconditional or no operation, such as B, BR, J, NOP, NOPR and JNOP statements.      
 

assembly-language-analysis.png

Result for a project containing Assembly source files, showing the Cyclomatic Complexity per line of code

Dependencies

We added 10 new statements for the dependencies analysis (check the dependencies documentation for more details).

assembly_file_mlc.pngassembly_dependencies_mlc.png

In the above screenshot, we can see a project with different assembly files including assembly programs like MLC but also macro files (MAC) with links among them. The type of links are also specified.      
Note that the dependencies from other file types (e.g. Cobol) to Assembly are already supported.      

We will be happy to hear from you about those improvements.      
Have a productive day!