Search found 7 matches

by H.G.Muller
Mon Aug 13, 2007 12:24 pm
Forum: Emulation and Simulation
Topic: Do there exist 6502 -> PC compilers ???
Replies: 8
Views: 12333

OK, thanks for the advice. Tables of addresses for JMP (abs) is not really what I would consider 'address arithmetic'. In a 'clean' program the table would be initialized with a list of labels in the code segment, and it would work even if the instruction translations would have different length as ...
by H.G.Muller
Sun Aug 12, 2007 11:51 am
Forum: Emulation and Simulation
Topic: Do there exist 6502 -> PC compilers ???
Replies: 8
Views: 12333

That was what I was afraid of. So I'll probably write my own.

I already looked into the problem, and it does not seem that hard. I don't think it would even have the complexity requiring usual compiler syntax trees and code generation from them. 6502 assembler and x86 assembler is nearly a 1:1 ...
by H.G.Muller
Thu Aug 09, 2007 9:03 pm
Forum: Emulation and Simulation
Topic: Do there exist 6502 -> PC compilers ???
Replies: 8
Views: 12333

Do there exist 6502 -> PC compilers ???

I am thinking ahead a little bit. Once I succeed in running my old (assembler-written) Chess program on the PC as a subroutine in a C program, really calling the 6502 emulator as a subroutine, I would be ready to make the next step.

The emulation will of course involve a large speed penalty, and ...
by H.G.Muller
Thu Aug 09, 2007 8:48 pm
Forum: Emulation and Simulation
Topic: Running 6502 code as a subroutine in a C program?
Replies: 11
Views: 13647

Well, so far I succeeded in bringing my old Chess program in machine-readable form (by scanning the machine code from a book with OCR), and it seems to run on an emulator I downloaded (after adapting the I/O to suite the needs of this particular emulator).

So I am in business...
by H.G.Muller
Thu Aug 02, 2007 7:25 pm
Forum: Emulation and Simulation
Topic: Running 6502 code as a subroutine in a C program?
Replies: 11
Views: 13647

OK, thanks. I downloaded the archive. I will let you know about any progress/problems.
by H.G.Muller
Tue Jul 31, 2007 1:49 pm
Forum: Emulation and Simulation
Topic: Running 6502 code as a subroutine in a C program?
Replies: 11
Views: 13647

Yes, it sounds interesting!

If I have the C source code of the core of a 6502 emulator, i.e. the part that advances the state of a byte array that represents the memory content of the emulated 6502, I could simply compile it with the rest of my program, and call it from there.

Like you remark: the ...
by H.G.Muller
Mon Jul 30, 2007 12:55 pm
Forum: Emulation and Simulation
Topic: Running 6502 code as a subroutine in a C program?
Replies: 11
Views: 13647

Running 6502 code as a subroutine in a C program?

Hi, I am new here!

Does there exist a convenient way to use routines written in 6502 assembly in modern C programs for running on a PC?

I was tinking about some general 6502 interpreter routine, available in C source, to which I could pass an array with 6502 code, which would then run that code ...