i am developing a compiler for my own defined language , i have generated 3 address code and now i am going to develop a virtual machine which can run that 3 address code. but for that i need Data Segment (where i can store all of my variables values) .i have two data types in my language (int and char) .
please give me a hint that how can i construct a data segment where i can store all of my variables (int and char both) values
thanks reading my problem
Data Segment in Compiler Construction
208 Views Asked by Haider Ali At
1
There are 1 best solutions below
Related Questions in COMPILER-CONSTRUCTION
- Reference: Crafting Interpreters. Print statement is not able to evaluate expression. Help me fix this (details below)
- Load function written in amd64 assembly into memory and call it
- I have implemented till Statements and State in Tree Walk Interpreter. I am pissed with an error
- Resolve shift/reduction conflict in grammar for expressions in PLY for calls to embedded functions
- Grammar for access to properties and calls to embedded functions
- LLVM code generation causes problems with pointer arithmetic
- what does react compiler mean actually?
- Errors on Recursive Descent Parsing Java
- Java CUP produces Shift-Reduce conflict when parsing a grammar for a C++ type language
- Three-Address-Code (TAC) and Conjunction/Disjunction
- How do I write an implicit cast for my strongly typed interpreter? (C++)
- Yacc parser not reducing specific production rules as intended
- Why is the function version tag consistently "Base" in HDF5 library?
- Sly parser, how are recursively defined types implemented?
- Does a non terminal token need an explicit definition?
Related Questions in DATA-SEGMENT
- Create clusters of data points having similar relationships in two columns
- How to handle data type conversation in python?
- Matplotlib: How can i use a column as data segmentation on matplotlib?
- CRC16 generation function - Error C195 illegal indirection
- apply heat map to the opencv rectangle
- Assembly Calculating location of variables
- Cannot set more segment Assembly
- Where the nested function's body kept?
- Is there a C function to get the size of a file's data segment?
- Impact of sticky service in an application with huge monolith code base in Android?
- What is the output of this code, array and pointers
- Memory allocation layout issues in C (64-bit)
- Memory allocation for Data segment not happening properly for each static and global(uninitialized/ initialized variable)
- Get string length at declaration in assembly x86_64 in Linux
- Identifying data segment in Win32/Win64
Related Questions in VM-IMPLEMENTATION
- MRI: Why are some methods implemented as aliases, but others duplicated?
- expected dimension but got
- Encoding a .json file for a bytecode vm
- Does Dalvik create stacks to manage threads
- How would I be able to make a register-based virtual machine code off of a Binary Tree for math interpretation
- How do virtual machines like Lua or JVM represent (and work on) larger data types?
- Why does LuaJIT bytecode put the opcode at the end instead of the front?
- Load anticipation of Application serve instances in a VM
- Why does Concurrent-Mark-Sweep (CMS) remark phase need to re-examine the thread-stacks instead of just looking at the mutator's write-queues?
- What happens exactly under the hood to Assembly `push`, `pop`, `call`, and `ret` operations?
- How to simulate a call stack in JavaScript using only a single array
- C Virtual machine Command with same opcode
- Decoding instruction of hypothetical CPU
- Optimization techniques for backtracking regex implementations
- How to fix: OP-code isn't read out correctly
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I strongly recommend to read C.Queinnec's book Lisp In Small Pieces; it explains very well a lot of things related to your questions.
While C.Queinnec's book focus apparently on Lisp-like languages, it teach you concepts which you can apply to a lot of other languages, including your own. In particular, you'll want to formalize more the denotational semantics or operational semantics of your language.
You could also at least study some VM, including Ocaml virtual machine, JVM, Parrot VM, NekoVM, LUA VM...
And you may later want to use just in time compilation techniques, notably with LLVM or libjit etc...
See also http://lambda-the-ultimate.org/
BTW, you may find much more convenient to have your language implementation reuse some existing VM.
I don't grasp why is a data segment such an issue. Your VM usually starts with some heap image, which contain both data and bytecode. A lot of languages have (at least implicitly) closures - or at least objects - mixing code and data.