Simple Virtual Machine A simple but flexible virtual machine

Loading...
Searching...
No Matches
Functions
SVM symbol values
SVM 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

## 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | symbol | The symbol value to extract from.

Returns
  The address contained in the value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | symbol | The symbol value to extract from.

Returns
  The SVM_Code contained in the value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | symbol | The symbol referencing the instruction.

Returns
  The string representation of the location of the instruction.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | code | The code of the library.
  [in] | symbol | The address into the library.

Returns
  The symbol value.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.

Returns
  A non initialised symbol value.

Exceptions

  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The symbol value to update.
  [in] | symbol | The symbol to use for update.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an symbol.
  FAILURE | interruption when the symbol parameter does not contain an symbol.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The symbol value to update.
  [in] | address | The new address value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an symbol.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The symbol value to update.
  [in] | code | The new code value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an symbol.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in,out] | value | The symbol value to update.
  [in] | code | The new code value.
  [in] | address | The new address value.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)
  FAILURE | interruption when the value parameter does not contain an symbol.
  FAILURE | interruption 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] | svm | The SVM pointer passed as first argument of the callback function.
  [in] | value | The value to be diagnosed.

Returns
  TRUE if the value contains a symbol, FALSE otherwise.

Exceptions

  FAILURE | interruption when a parameter is incorrect. (Please refer to the main description page of this API.)