• Please review our updated Terms and Rules here

Two new TP adventures

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
922
Location
Heerlen, NL
I have been a TP fan since 1985. So one day I started to think about writing my own Pascal compiler, one that should be able to handle at least TP3, TP4 and UCSD Pascal. Another goal: it only outputs macros, macros that can be handled by my own assembler. This assembler is able to handle 6800, 6502, 65816, 8088, Z80 and 8080. So if you have the right macros, the same program could run on various machines. OK, in reality it is a bit more complicated: a 6502 executable meant for the Apple 2][ most probably won't run on a C64 and vice versa. And writing those macros will be a looooooot of work.

Second adventure: with some help I was able to disassemble TP3. I used the result to create a BP alike version: it takes a Pascal file as input and outputs a COM file.

All above is freeware. If interested in the sources, info or whatever, just email me.
 

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
922
Location
Heerlen, NL
What did you write the compiler in? What is a "BP alike" version?
I am writing it in Free Pascal Compiler but pure for convenience: more lines on the screen. I check from time to time if it compiles and runs in Borland Pascal 7. And if things work out, I will scale down to TP6, TP5.5, TP5, etc. as far down as possible. But at the moment the first main goal that the program should be able to compile itself. The second main goal: the compiled output should run as well as the version outputted by BP7.

Sorry, I meant BPC, the comand-line version.
 

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
922
Location
Heerlen, NL
An update:

Busy with a renovation of some rooms of my house so I don't have that much time available. At this moment I'm busy with floating point numbers (FP). You find a lot of information about FP on internet but the moment that you ask: "But how does a computer handle FP in machine language?" then it becomes very silent. Partly I found a solution to covert a string like "12.3456" but I still have to find a way convert a number with large exponents into FP.
Converting FP into ASCII again is even more difficult. "0.11" is 0.75 in decimal and can be calculated like this: 0.11 = 1/2 + 1/4 = 0.75. Yes, very nice explanation and really understandable by humans. But no explanation how a computer does it. I found a way by looking at the source code of the BASIC of the Commodore 64. And while writing the previous sentence I just remembered I probably have another source: the UCR library, used by the book Art of Assembly. We'll see.....
 
Top