Compiling C++ code (BASIC Interpreter) into ARM assembly [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm writing a basic command line operating system for the raspberry pi, much like those on computers from the 70's and early 80's. I have made the basic text input / output with assembly and would like to incorporate a BASIC interpreter into my code. I was thinking of writing my own version of BASIC and an interpreter in C++/Java (maybe not, since it's compiled into bytecode) then compiling it into ARM assembly for the raspberry pi, is this possible?
P.S I considered writing it in assembly, but figured that would be too complicated for my abilities.

Yes, it's possible since once you have a C++ compiler for your taget platform. You can use any language you want/need to, including Java since once all needed tools to compile/interpret are available in the target platform. You can do in assembly too. But do you really need/want to? it's really a lot of job without no much fun.

Related

What piece of hardware or software on a computer/microcontroller determines what code you can write (and not write)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 11 months ago.
Improve this question
So I am writing code for a microcontroller (using Arduino IDE), which I do not have a ton of experience doing. This question popped into my head when I was wondering which 'parts' of C++ I could use in my code that would flash onto this NRF52840 microcontroller. Basically, I am wondering: What on that board determines the code I must write for it?
I understand saying "what code can I write/not write" is broad, but its because I dont know what to say instead. A few guesses I have for substitutes for this would be: certain libraries? certain coding languages?, certain types of languages (interpreted vs compiled)?
Sorry if this question is too horribly stated to get an answer, but this was legit the best I could do lol.
In the case of using C++, it depends entirely upon what language features the compiler you are using supports. I suppose there might be hardware out there that is so simplistic that certain features are simply beyond the ability to implement, but I cannot tell you either what hardware that is, or what language features would be so effected.

Programatically creating and compiling from a program in C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Let's say we've got a first program called Program1.exe which contains the necessary information to create and compile another application called Program2.exe. Actually it could also load that information from a txt file or whatever.
Googling, I've found that this is "easy" to do in C#, using Visual Studio:
How to programatically build and compile another c# project from the current project
Programmatically Invoke the C# Compiler
The problem is that I'm not using (and can't use) C#, but C++. Summing it up, my question is if that I can do this same thing using C++.
I would prefer to do it without additional libraries, but if that's not possible, or if it's too hard to do, you can also recommend any library allowing it.
I think you'll probably have noticed it, but my goal is to use it under Windows so I don't care if it's not portable.
Thanks everybody.
It's trivial (if maybe a bit odd) for a C++ program to compile and run another based on code stored in a text file. Debugging that other program, however, isn't.

what C++ software do i use for accelerated c++ book [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have just bought accelerated c++ used. It wants me to do a project but i have no clue on what, does any one have a clue i searched online for a answer but nothing or at less one that would work. The program it want me to do is this
write a program that, when run, writes
this (") is a qute, and this (/) is a backslash
3 + 4;
There is no particular implementation you're supposed to use. You simply use whatever you've got. If you're on Windows you can get Visual Studio Express. If you're on linux you can use gcc, if you're on OS X you can get Xcode, etc.
Accelerated C++ is not intended for individuals new to programming; It's intended to get a programmer with experience in another language up and running in C++ quickly. You may find a different book more suited to your needs.

Lua, threads and C++ exceptions [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm planning on suggesting to my development team that we start looking at lua instead of C++ for the project we're currently working on. On that subject I have a question that I need to clear up first.
With the current SDK, we are not allowed to use C++ exceptions due to it not being safe in multithreaded applications (created with that SDK). Actually, it is allowed, just discouraged... however the program won't compile unless we pass -fno-exceptions, so... yeah...
Anyway. Since Lua runs in it's own VM and is pure C... Would exceptions in Lua be 'safe'?
If the C code that makes up the LUA interpreter is fine concerning the restrictions of your SDK then anything coded in LUA and executed with that interpreter is fine, too. But if the LUA interpreter itself is working with your unnamed SDK... that's a question that only you or the SDK vendor can answer.

questions about writing an operating system [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have some very specific questions about writing operating systems that I was hoping could get answered:
How much assembly code would I need to write to load a minimal C Kernel if I use GRUB as a boot loader?
My kernel will be written in C, It will load a command line shell that I wrote in C++, it does not make any API calls only standard library calls, will I need to rewrite the entire C++ Standard library to do so?
Can I write video, keyboard and floppy drivers in C++?
Do GCC and G++ output 16 bit real mode code?
Can I write this all using Mingw on Windows or will I have to write it on Linux?
Do I need to be in real mode in order to write directly to the video memory?
If anyone can answer my questions I will be very thankful
1: You should only need a small amount of assembly to handle the boot process and load the C code. Shouldn't be more than like 20-30 lines I think.
2-4: I haven't really used C++ with OS dev, but I think I remember reading that it takes more work to get it running somewhere. Sorry I can't be of more help.
5: You "can" do it using MinGW, but from my experience it mostly complicates things. I could never really get a Windows environment working, but I also gave up without too much effort.
EDIT: Here is a link to some example assembly. This is all I ever had to use:
http://www.jamesmolloy.co.uk/tutorial_html/2.-Genesis.html
The rest of that site is a pretty good tutorial too if you are at all interested in that kind of thing.