src/main.cpp
/// ***************************************************************************************************************************
/// Test function calls for the sequential C++ BC interpreter on CPU.
/// ***************************************************************************************************************************
Test function calls for the sequential C++ BC interpreter on CPU.
Test function calls for the sequential C ++ BC interpreter on CPU .
void testFunction() {
    vector<int> functionCall = {
        LOAD, -3,		
        ICONST, 2,		
        IMUL,			
        RET,			
        ICONST, 128, 	
        CALL, 0, 1, 	
        PRINT,			
        HALT			
    };
    VM vm(functionCall,  6); 
    vm.setVMConfig(100, 100);
    vm.setTrace();
    vm.runInterpreter();
}
void testFunction ( ) { vector < int > functionCall = { LOAD , -3 , ICONST , 2 , IMUL , RET , ICONST , 128 , CALL , 0 , 1 , PRINT , HALT } ; VM vm ( functionCall , 6 ) ; vm . setVMConfig ( 100 , 100 ) ; vm . setTrace ( ) ; vm . runInterpreter ( ) ; }
Test function calls for the sequential C++ BC interpreter on CPU.
Test function calls for the sequential C ++ BC interpreter on CPU .
// Instruction    address // 0 // 2 // 4 // 5 // 6 -- this is the main // 8 // 11 // 12 // Start address is 6