bqt
Veteran Member
Wait until the snow... It’s just too hot outside...
It is quite interesting what you have done. The implication being that the constant itself may be stored as text until it is actually required?
This would be unusual for a compiler...
I would expect that the compiler should have performed some form of semantic check on the source rather than just a syntax check so that an out-of-bounds check on a constant should have been flagged by the compiler rather than leave it to the runtime library.
Darn it, you’ve got me hooked now. Unfortunately, I have had to shut the machine down as we have now got a storm hit us!
Too hot, followed by thunder, lightening and rain...
Dave
Actually, it's not stored in text, but it is complicated. First of all, integers are 24 bit. (Obvious, if you look at the range.)
Second, it's actually done in sortof FPP mode. The parsing/processing of integers goes through mostly the same code path as floating points. The FPP essentially just expects the exponent to be 0 when doing DP, and does actually detect overflows.
And no, there is no overflow checking in the input stage of the compiler. It just collects the data. However, since this actually goes the same way as FP, it also does not wrap, as you could possibly otherwise have expected.
I haven't touched any of this code in close to 30 years. Gah! Anyway, the sources can be seen at ftp://ftp.update.uu.se/pub/pdp8/os8/fiv. The relevant bits and pieces can be seen in F412K.PA or F416K.PA, depending you your preferences. The 16K version was done by me, since I didn't really see much of a point of having it tailored to fit in a 12K machine. Once it went above 8K, I figured I might as well assume 16K.
(And I only did various hacking on it, I was not at all involved in the original development. In addition to the expansion to 16K to allow for a larger symbol table, I also hacked in so that .AND. and so on could also be applied to integers, and not only logicals. I was trying at the time to port DUNGEON to the PDP-8, but I gave up at some point... ).
Oh yeah, http://www.bitsavers.org/pdf/dec/pdp8/os8/DEC-S8-LFSSA-A-D_F4swSupp.pdf is also very useful to look at.
Last edited: