virtualSoC  0.6.2
baskett
Vcsos.Komponent.Stack Class Reference

Public Member Functions

void Push32 (int value)
 
int Pop32 ()
 
int Peek32 ()
 
void Push (byte data)
 
byte Pop ()
 
byte Peek ()
 
override string ToString ()
 

Detailed Description

Member Function Documentation

◆ Peek()

byte Vcsos.Komponent.Stack.Peek ( )
67  {
68  return VM.Instance.Ram [VM.Instance.CurrentCore.Register.sp+1];
69  }

◆ Peek32()

int Vcsos.Komponent.Stack.Peek32 ( )
45  {
46  byte[] _l = new byte[4];
47 
48  for (int i = 0; i < 4; i++) {
49  _l[i] = VM.Instance.Ram [VM.Instance.CurrentCore.Register.sp+1+i];
50  }
51 
52  return _l.ToInt ();
53  }

◆ Pop()

byte Vcsos.Komponent.Stack.Pop ( )
60  {
61  byte b = VM.Instance.Ram [VM.Instance.CurrentCore.Register.sp+1];
62  VM.Instance.Ram [VM.Instance.CurrentCore.Register.sp + 1] = 0;
63  VM.Instance.CurrentCore.Register.sp += 1;
64  return b;
65  }

◆ Pop32()

int Vcsos.Komponent.Stack.Pop32 ( )
37  {
38  byte[] _l = new byte[4];
39  for (int i = 0; i < 4; i++)
40  _l [i] = Pop ();
41 
42  return _l.ToInt ();
43  }
byte Pop()
Definition: Stack.cs:59

◆ Push()

void Vcsos.Komponent.Stack.Push ( byte  data)
55  {
56  VM.Instance.Ram [VM.Instance.CurrentCore.Register.sp] = data;
57  VM.Instance.CurrentCore.Register.sp -= 1;
58  }

◆ Push32()

void Vcsos.Komponent.Stack.Push32 ( int  value)
29  {
30  byte[] _l = value.ToBytes ();
31  Array.Reverse (_l);
32  for (int i = 0; i < _l.Length; i++)
33  Push (_l [i]);
34  //Push (0);
35  }
void Push(byte data)
Definition: Stack.cs:54

◆ ToString()

override string Vcsos.Komponent.Stack.ToString ( )
71  {
72  return string.Format ("[Stack] Peek32: {0}", Peek32(), Peek());
73  }
byte Peek()
Definition: Stack.cs:66
int Peek32()
Definition: Stack.cs:44

The documentation for this class was generated from the following file: