Questions tagged [vm-implementation]

Design and implementation of virtual machines, interpreters, automata, Turing machines. **DO NOT** use this tag for virtualized computers (VirtualBox, VMWare, ...), unless the question address the implementation of such tools.

294 questions
1
vote
1 answer

ioper commands isub idiv order in java virtualmachine

when looking at ioper commands imul and iadd are obvious but if I have: sipush 9 sipush 3 sipush 4 the stack will look like 4 3 9 if the next one is isub do i subtract 4 from 3? or 3 from 4 cheers
saleem
  • 43
  • 6
1
vote
1 answer

Why stack-based VM? Why not queue-based VM?

As I investigated, there are 2 major ways to implement process VM: stack-based, such as JVM, CLR, etc. or register-based, such as Lua, Dalvik, etc. Register-based approach mimics the architecture of physical processors. But for the stack-based…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
1
vote
3 answers

What's machine readable code's language?

Basically, what I'm asking is what's the language that the computer understands... I have seen this post explaining a little https://www.quora.com/How-are-exe-files-created-And-what-programming-language-are-used-in-creating-them but it only refers…
1
vote
1 answer

List of shared objects are not listed under list of open files in Linux Kernel

I am trying to read the list of all open files including the shared objects of a particular program running in VM by using VMI(Virtual Machine Introspection) library. It seems that list of open files of a particular task_struct does not include all…
Anil Kumar K K
  • 1,395
  • 1
  • 16
  • 27
1
vote
1 answer

What is the relation between an interpreter and CPU?

I have read that the interpreter (VM) is a software that executes code. I have also read that the CPU executes the instructions. What is the difference between the two execution? The VM does not convert the byte code into machine code. What does it…
codingsplash
  • 4,785
  • 12
  • 51
  • 90
1
vote
0 answers

How I can read a bin file in C and save the binary values in a unsigned int in a array?

hi i built a vm in c and want to read a bin file. This bin file has a structure, I can read them and compile this. but i dont know how i can save the value as unsigned int in a array :/ The binary file has this structure: 4 Bytes -> Verify the…
Tarasov
  • 3,625
  • 19
  • 68
  • 128
1
vote
1 answer

How I get the value from the Immediate part of a 32 Bit sequence in C?

I built a virtual machine in C. And for this I have the Instruction pushc I saved the command and the value in 32 Bit. The First 8 Bit are for the command and the rest for the value. 8 Bit -> Opcode 24 Bit -> Immediate value For this I…
Tarasov
  • 3,625
  • 19
  • 68
  • 128
1
vote
1 answer

How to load different primitive datas to the operand stack

JVM has two instructions: bipush (operand value should be between Byte.MIN_VALUE and Byte.MAX_VALUE.) and sipush (operand value should be between Short.MIN_VALUE and Short.MAX_VALUE). Correspondingly, the MethodVisitor in the ASM provide the API to…
shijie xu
  • 1,975
  • 21
  • 52
1
vote
1 answer

Metaprogramming performance in Dart

When using operator overloading in Dart, are the operating functions resolved at compile time, or at runtime, or something else? In which cases will the vm or dart2js be able to bypass something like this: function add(left, right) { if…
1
vote
2 answers

ebp + 6 instead of +8 in a JIT compiler

I'm implementing a simplistic JIT compiler in a VM I'm writing for fun (mostly to learn more about language design) and I'm getting some weird behavior, maybe someone can tell me why. First I define a JIT "prototype" both for C and C++: #ifdef…
David Titarenco
  • 32,662
  • 13
  • 66
  • 111
1
vote
1 answer

How do process virtual machines implement callback support?

Preamble: This question is asked as a VM implementor, looking to support native callbacks (more specifically wndProc). For Process VMs I mean for Smalltalk, Java, Python, etc. VMs are usually very careful of what gets into the stack. This is…
melkyades
  • 1,719
  • 11
  • 20
1
vote
1 answer

Register management tips

Implementing a custom VM and I've come to use registers (these will store pointers and will be NULL when empty). But, I've come to realize that I actually have no idea how to manage register-based memory. Like, what do I do if all my registers are…
Puppy
  • 144,682
  • 38
  • 256
  • 465
1
vote
3 answers

Extends my language at runtime

I am developing a new language and I am following a traditional approach: so there is a lexer, a parser, an ast and a virtual machine that executes bytecode. When the parser encounters an operator like + then it produces an ADD virtual machine…
Marco
  • 783
  • 5
  • 21
1
vote
1 answer

how do VM's virtualize HW

Suppose I have a machine running Mac OS X, which is running VMware, which is running Ubuntu, which is running the canonical helloworld.c in a shell. What are the high-level sequence of events that occur between me pressing enter and Hello World!…
1
vote
1 answer

can we assume interpreter as a virtual machine?

I have an abstract question particularly about PHP. Since we have we have Apache/xampp/mamp and other different packages for running PHP on different OS can we assume that PHP has sort of virtual machine? (write once and runs everywhere)
Vahid Hashemi
  • 5,182
  • 10
  • 58
  • 88