Aseba  1.5.5
Macros | Functions
vm.c File Reference

Implementation of standard natives functions for Aseba Virtual Machine. More...

#include "../common/consts.h"
#include "../common/types.h"
#include "vm.h"
#include <string.h>

Macros

#define GET_BIT(v, b)   (((v) >> (b)) & 0x1)
 Return true if bit b of v is 1.
 
#define BIT_SET(v, b)   ((v) |= (1 << (b)))
 Set bit b of v to 1.
 
#define BIT_CLR(v, b)   ((v) &= (~(1 << (b))))
 Set bit b of v to 0.
 

Functions

void AsebaVMSendExecutionStateChanged (AsebaVMState *vm)
 Send an execution state changed message.
 
void AsebaVMInit (AsebaVMState *vm)
 Setup the execution status of the VM. More...
 
uint16 AsebaVMGetEventAddress (AsebaVMState *vm, uint16 event)
 Return the starting address of an event, or 0 if the event is not handled. More...
 
uint16 AsebaVMSetupEvent (AsebaVMState *vm, uint16 event)
 Setup VM to execute an event. More...
 
void AsebaVMStep (AsebaVMState *vm)
 Execute one bytecode of the current VM thread. More...
 
void AsebaVMEmitNodeSpecificError (AsebaVMState *vm, const char *message)
 Can be called by glue code (including native functions), to stop vm and emit a node specific error.
 
uint16 AsebaVMCheckBreakpoint (AsebaVMState *vm)
 Execute on bytecode of the current VM thread and check for potential breakpoints. More...
 
void AsebaDebugBareRun (AsebaVMState *vm, uint16 stepsLimit)
 Run without support of breakpoints. More...
 
void AsebaDebugBreakpointRun (AsebaVMState *vm, uint16 stepsLimit)
 Run with support of breakpoints. More...
 
uint16 AsebaVMRun (AsebaVMState *vm, uint16 stepsLimit)
 Run the VM depending on the current execution mode. More...
 
uint8 AsebaVMSetBreakpoint (AsebaVMState *vm, uint16 pc)
 Set a breakpoint at a specific location. More...
 
uint16 AsebaVMClearBreakpoint (AsebaVMState *vm, uint16 pc)
 Clear the breakpoint at a specific location. More...
 
void AsebaVMClearBreakpoints (AsebaVMState *vm)
 Clear all breakpoints. More...
 
void AsebaVMDebugMessage (AsebaVMState *vm, uint16 id, uint16 *data, uint16 dataLength)
 Execute a debug action from a debug message. More...
 
uint16 AsebaVMShouldDropPacket (AsebaVMState *vm, uint16 source, const uint8 *data)
 Return non-zero if VM will ignore the packet, 0 otherwise.
 

Detailed Description

Implementation of standard natives functions for Aseba Virtual Machine.

Implementation of Aseba Virtual Machine.