Solved

386 assembler C or C++ source code needed

Posted on 2002-07-08
4
213 Views
Last Modified: 2010-04-15
I have a C++ program that would benefit by having a built in assembler. By which I mean it would take a string (or file) as input and generate machine code op-codes.

I don't need fancy linkers, it would just generate small segments of executable code, it would need to cope with simple labels (forward and backward references)

Ideally C or C++ source code which could be incorporated into my program.

I have searched for source code to no avail. Oh, it must run on Windows (Linux source code not suitable) using MS C++ compiler.

Thanks
Ian
0
Comment
Question by:icd
  • 3
4 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 7141287
>> by having a built in assembler

Why don't you just run e.g. the GNU assembler 'seamlessly' from your app? This one is also available for Win32 and is OSS, BTW.
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 7141294
Oh, and there is of course NASM that comes with source code: http://nasm.sourceforge.net/
0
 
LVL 5

Author Comment

by:icd
ID: 7141450
Interestingly I just found the NASM assembler and so far it seems to do what I want. I think I can just bring in the source code modules I need and build them into my application.

I had not thought of the GNU assembler. I will look at it but I don't want to have external exe files if I can help it which I suspect is what you are referring to.

I had just come back here to delete my question, but I see I will have to award you the points now :)
0
 
LVL 86

Expert Comment

by:jkr
ID: 7182920
Thank you! :o)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question