Simple Virtual Machine
A simple but flexible virtual machine
SVM symbol values

This module contains API functions to handle SVM symbol values. More...

Functions

SVM_FUNCTION SVM_Value_Symbol svm_value_symbol_new (const void *svm, const SVM_Code code, const SVM_Address symbol)
 This function creates a symbol value the SVM can store in its memories from a SVM code and an address. More...
 
SVM_FUNCTION SVM_Value_Symbol svm_value_symbol_new_null (const void *svm)
 This function creates a symbol value the SVM can store in its memories without a value. More...
 
SVM_FUNCTION SVM_Boolean svm_value_type_is_symbol (const void *svm, const SVM_Value value)
 This function checks whether a value contains a symbol. More...
 
SVM_FUNCTION SVM_Code svm_value_symbol_get_code (const void *svm, const SVM_Value_Symbol symbol)
 This function extracts the code contained in a symbol value. More...
 
SVM_FUNCTION SVM_Address svm_value_symbol_get_address (const void *svm, const SVM_Value_Symbol symbol)
 This function extracts the address contained in a symbol value. More...
 
SVM_FUNCTION SVM_String svm_value_symbol_get_location (const void *svm, const SVM_Value_Symbol symbol)
 This function returns the location string of the instruction referenced by a symbol. More...
 
SVM_FUNCTION void svm_value_symbol_set (const void *svm, SVM_Value_Symbol value, const SVM_Value_Symbol symbol)
 This function replaces the symbol value by another symbol value. More...
 
SVM_FUNCTION void svm_value_symbol_set_code (const void *svm, SVM_Value_Symbol value, const SVM_Code code)
 This function replaces the code contained in a symbol value from a SVM_Code. More...
 
SVM_FUNCTION void svm_value_symbol_set_address (const void *svm, SVM_Value_Symbol value, const SVM_Address address)
 This function replaces the address contained in a symbol value from a SVM_Address. More...
 
SVM_FUNCTION void svm_value_symbol_set_codeaddress (const void *svm, SVM_Value_Symbol value, const SVM_Code code, const SVM_Address address)
 This function replaces the code and the address contained in a symbol value from a SVM_Code and a SVM_Address. More...
 

Detailed Description

This module contains API functions to handle SVM symbol values.

Function Documentation

◆ svm_value_symbol_get_address()

SVM_FUNCTION SVM_Address svm_value_symbol_get_address ( const void *  svm,
const SVM_Value_Symbol  symbol 
)

This function extracts the address contained in a symbol value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]symbolThe symbol value to extract from.
Returns
The address contained in the value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the symbol parameter does not contain an symbol.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_symbol_get_code()

SVM_FUNCTION SVM_Code svm_value_symbol_get_code ( const void *  svm,
const SVM_Value_Symbol  symbol 
)

This function extracts the code contained in a symbol value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]symbolThe symbol value to extract from.
Returns
The SVM_Code contained in the value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the symbol parameter does not contain an symbol.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_symbol_get_location()

SVM_FUNCTION SVM_String svm_value_symbol_get_location ( const void *  svm,
const SVM_Value_Symbol  symbol 
)

This function returns the location string of the instruction referenced by a symbol.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]symbolThe symbol referencing the instruction.
Returns
The string representation of the location of the instruction.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the symbol is not linked to an instruction.
See also
svm_processor_get_currentinstruction

◆ svm_value_symbol_new()

SVM_FUNCTION SVM_Value_Symbol svm_value_symbol_new ( const void *  svm,
const SVM_Code  code,
const SVM_Address  symbol 
)

This function creates a symbol value the SVM can store in its memories from a SVM code and an address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]codeThe code of the library.
[in]symbolThe address into the library.
Returns
The symbol value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_value_symbol_new_null()

SVM_FUNCTION SVM_Value_Symbol svm_value_symbol_new_null ( const void *  svm)

This function creates a symbol value the SVM can store in its memories without a value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
Returns
A non initialised symbol value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)

◆ svm_value_symbol_set()

SVM_FUNCTION void svm_value_symbol_set ( const void *  svm,
SVM_Value_Symbol  value,
const SVM_Value_Symbol  symbol 
)

This function replaces the symbol value by another symbol value.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe symbol value to update.
[in]symbolThe symbol to use for update.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an symbol.
FAILUREinterruption when the symbol parameter does not contain an symbol.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_symbol_set_address()

SVM_FUNCTION void svm_value_symbol_set_address ( const void *  svm,
SVM_Value_Symbol  value,
const SVM_Address  address 
)

This function replaces the address contained in a symbol value from a SVM_Address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe symbol value to update.
[in]addressThe new address value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an symbol.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_symbol_set_code()

SVM_FUNCTION void svm_value_symbol_set_code ( const void *  svm,
SVM_Value_Symbol  value,
const SVM_Code  code 
)

This function replaces the code contained in a symbol value from a SVM_Code.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe symbol value to update.
[in]codeThe new code value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an symbol.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_symbol_set_codeaddress()

SVM_FUNCTION void svm_value_symbol_set_codeaddress ( const void *  svm,
SVM_Value_Symbol  value,
const SVM_Code  code,
const SVM_Address  address 
)

This function replaces the code and the address contained in a symbol value from a SVM_Code and a SVM_Address.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in,out]valueThe symbol value to update.
[in]codeThe new code value.
[in]addressThe new address value.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)
FAILUREinterruption when the value parameter does not contain an symbol.
FAILUREinterruption when the value is a constant.
See also
svm_value_type_is_symbol
svm_value_type_get

◆ svm_value_type_is_symbol()

SVM_FUNCTION SVM_Boolean svm_value_type_is_symbol ( const void *  svm,
const SVM_Value  value 
)

This function checks whether a value contains a symbol.

Parameters
[in]svmThe SVM pointer passed as first argument of the callback function.
[in]valueThe value to be diagnosed.
Returns
TRUE if the value contains a symbol, FALSE otherwise.
Exceptions
FAILUREinterruption when a parameter is incorrect. (Please refer to the main description page of this API.)