Pascal-iSh V1.0
Posted: Mon Jun 03, 2024 10:13 pm
I've put this off long enough!
Here is version 1.0 of Pascal-iSh, a p-code Pascal compiler hosted on the Commander X16 and written in Prog8.
Previous versions were posted in the WIP section and while in some sense, it is still a work in progress and probably
will be for the foreseeable future, everything is working now, at least to some degree.
The name, Pascal-iSh, is a pun. This compiler is a conversion/adaptation of Pascal-S, written by Nicklaus Wirth, back in
the 1970's for use in the classroom, by students...hence the -S. This programming system is non-standard Pascal,
hence the -iSh. That it works at all, is something that I'm happy with, that it doesn't quite work the way it's supposed
to, is something that is frustrating and attributable to my shortcomings as a programmer, but I look at this as
idiosyncrasies, these are, to my view, minor issues. Another aspect is how I have added other features/capabilities,
which do not really adhere to any ISO standards....something that matters to me, not at all. It is a single pass
compiler that relies heavily on recursion, I have seen one subroutine get to 8 levels deep. I have yet to completely
tame this in Prog8, which does not support recursion natively.
This is basically a 'can I do it?' project. If anyone finds it useful....great. I don't expect that many....any, will adopt it
as a their method of programming the X16, but some might find it interesting to 'putz' around with. It does provide
access to the X16 Kernal and thus most of the X16's capabilities. It also provides the means to insert user created m/l
routines in a manner similar to BASIC's read/data/sys methodology. Only signed integers, characters and Boolean types
are natively supported and all occupy 2 bytes in memory, this was the original design and as much as I'd like to change
it, it's beyond my capability. Real numbers are possible, but, while I have included a demo program, further
development is needed for it to be of any real use. Other user TYPES are also possible.
There is a document included in the zip file that is part 'about' and part manual. The Pascal Language is better
documented elsewhere, but I go over some of the specifics to this rendition.
The original Pascal source code is here:
http://pascal.hansotten.com/uploads/pas ... Pascal.pas
with the exception of the code for 'for loops', which was omitted, but included in a text book written by the translator
(to Turbo Pascal), as an answer to questions in the chapter on the compiler, which I managed to obtain. This version
does compile with minimal fuss, with Free Pascal, which was the only way that I was able to get any of this working, by
comparing output from it, to my version!
Here is version 1.0 of Pascal-iSh, a p-code Pascal compiler hosted on the Commander X16 and written in Prog8.
Previous versions were posted in the WIP section and while in some sense, it is still a work in progress and probably
will be for the foreseeable future, everything is working now, at least to some degree.
The name, Pascal-iSh, is a pun. This compiler is a conversion/adaptation of Pascal-S, written by Nicklaus Wirth, back in
the 1970's for use in the classroom, by students...hence the -S. This programming system is non-standard Pascal,
hence the -iSh. That it works at all, is something that I'm happy with, that it doesn't quite work the way it's supposed
to, is something that is frustrating and attributable to my shortcomings as a programmer, but I look at this as
idiosyncrasies, these are, to my view, minor issues. Another aspect is how I have added other features/capabilities,
which do not really adhere to any ISO standards....something that matters to me, not at all. It is a single pass
compiler that relies heavily on recursion, I have seen one subroutine get to 8 levels deep. I have yet to completely
tame this in Prog8, which does not support recursion natively.
This is basically a 'can I do it?' project. If anyone finds it useful....great. I don't expect that many....any, will adopt it
as a their method of programming the X16, but some might find it interesting to 'putz' around with. It does provide
access to the X16 Kernal and thus most of the X16's capabilities. It also provides the means to insert user created m/l
routines in a manner similar to BASIC's read/data/sys methodology. Only signed integers, characters and Boolean types
are natively supported and all occupy 2 bytes in memory, this was the original design and as much as I'd like to change
it, it's beyond my capability. Real numbers are possible, but, while I have included a demo program, further
development is needed for it to be of any real use. Other user TYPES are also possible.
There is a document included in the zip file that is part 'about' and part manual. The Pascal Language is better
documented elsewhere, but I go over some of the specifics to this rendition.
The original Pascal source code is here:
http://pascal.hansotten.com/uploads/pas ... Pascal.pas
with the exception of the code for 'for loops', which was omitted, but included in a text book written by the translator
(to Turbo Pascal), as an answer to questions in the chapter on the compiler, which I managed to obtain. This version
does compile with minimal fuss, with Free Pascal, which was the only way that I was able to get any of this working, by
comparing output from it, to my version!