You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Type
ChaiVM is register-based VM with one accumulator register
Instruction types (for decoding)
TODO
Basic operations
Nop
Nop
- nop)Ret
Ret
- returns from current functionMov
Mov ri, rj
- moves value from the registerri
to the registerrj
Load/Store accumulator
Lda
- loads value to accumulatorLdia [i]
- loads constant integer[i]
to accumulatorLdra [i]
- loads the registerri
to accumulatorSta
- stores value of accumulator somewhere.Star ri
- stores value of accumulator in registerri
Arithmetic
Add
Add ri
- adds the accumulator to value of the registerri
, stores result in the accumulatorAddi [i]
- adds the accumulator to value of the constant[i]
, stores result in the accumulatorSub
Sub ri
- subtracts the accumulator from the registerri
, stores result in the accumulatorSubi [i]
- subtracts the accumulator from the constant[i]
, stores result in the accumulatorMul
Mul ri
- multiplies the accumulator on the registerri
, stores result in accumulatorMuli [i]
- multiplies the accumulator on the constant[i]
, stores result in accumulatorDiv
Div ri
- divides the registerri
on the accumulator, stores result in accumulatorDivi [i]
- divides constant[i]
on the accumulator, stores result in accumulatorIntrinsics
to be continued ...
Beta Was this translation helpful? Give feedback.
All reactions