I see you've stumbled on to yet another idiotic aspect of PAL8.
Try having conditional assembly and your line is truncated at an arbitrary point and by luck what IS seen happens to be syntactically without reported errors, but not what you wanted!
Here is a partial explanation. I say partial because there is somehow an anomaly in the restriction. [Meaning it is not quite consistent to its own limitations.
All of the other assemblers in all PDP-8 systems all the way back to present day all do assembly [on a fundamental level] proceed as follows:
Read the input file until you find the end of the statement [either the end of the line OR a semi-colon. Nothing fancy, just straight-forward.
PAL8 DOES NOT WORK THAT WAY!!!
Go read the source code if you want to do your own due dilligence.
PAL8 reads the source code into a buffer within PAL8. The source code is processed until the end of the line always.
THEN the source code is read OUT OF THE BUFFER. If a semi-colon is encountered, you can have multiple statements.
However, any characters that didn't make it into that internal buffer are THROWN AWAY. There is a hard truncation [well, see below]. But before the line is parsed, the input fileis advanced to after the end of the line [CR, LF is ignored]
Note that this method is pathetic, amateurish and just plain wrong.
I have a theory as to WHY this was done [which leads perhaps to why the anomaly; see even further below]
I think the original fool who "wrote": this turkey had no idea how it worked when he "lifted" it from some other system [There are various theories here; perhaps he was someone who got a D+ in some college course and should have admitted it wasn't for him, or he just wanted to get it over with. This is unimportant it's his "legacy" to us.
I can tell you a few historical facts:
1) Richard Lary needed a lot of help to get the original PS/8 out in a somewhat functional way past the virtually non-functional demo the suits insisted be used, and in the process alienated the other four best PDP-8 programmers there ever were.
2) I have the dubious distinction of being the fifth person to turn him down and he agreed with my reasoning to develop his far superior R-L Monitor System. P?S/8 is the result of literally thousands of man hours of work past that point.
However, I did agree to USE it and be one of a bunch of people providing (negat9ve) feedback. The name of that early group was "the software buffer". Some people may even find some of these early documents. I am certain some have been found under a more formal name. Bill Cattey can provide some of that info, etc.
I found MANY things wrong with it that precluded my ability to use it at all. For example, before they fixed the memory sizing bugs, I couldn't even run it on our 8K PDP-8/L because the illogic decided the machine was always 32K. At first they laughed at me because they couldn't reproduce the bug, but eventually they agreed I was correct. You cannot claim you cannot reproduce the problem unless you in fact try it out on the SAME COMPUTER! Eventually someone else got the identical results, and eventually there was a replacement memory sizing routine that worked correctly on all of the models. Turns out others complained about different configurations also failing for alternate reasons and once it was implemented, the new routines worked on all machines, etc.
But I did manage to get Richard Lary to work on PAL8 because of many OTHER problems that surfaced because of this bad hack of a benchwarner they hired to create it in the first place. Eventually Richie actually APOLOGIZED to me personally, saying essentially he hadn't realized just how bad it was, and very quickly he fixed a lot of things all at once to make ot "tolerable" but had to move on to other things they insisted be done, etc. And yes, he nominally made it a lot better, thus for the most part it became on a scale of 0 to 1 useful. But it still had this inept design flaw.
I believe I understand the reason why this clod did what he did [which should an utter disregard for understanding just how the PDP-8 assembly language is all about]..
Some other assemblers did not understand the concept of horizontal tab. For PARSING purposes, it is equivalent to a space character. For PRINTING purposes, it creates part of a printout line that has the align to nearest 8 colums requirement. This is a subtle point but you have to understand this:
The actual printed output of a successful assembler aligns the output to a multiple of 8 spaces, however this is only with respect to an arbitrary starting point in the printout. All that comes before this is NOT ALIIGNED.
If you look at any output in any proper assembler, there is no specific requirement for how many columns of assembller-produced output to the left of the starting point actually is used. But then this becomes the starting point for the aligned output.
For example, in P?S/8 PAL, [as in TOPS-10 PAL10, the cross-reference option may be in effect. This means the listing output is prepended with a statement number [NOT a line number!].and other output which in fact is varied by the number of command-line options. [Brief partial explanation. A listing has some binary output thus addresses and generated values; others have the line number which changes things; PAL8 dies NOT support cross referencing at all! Instead the LISTING file of PAL8 is post-processed by CREF which is not only a time-consuming process it is quite flawed. For example, of you use commentary by the form of unassembled failing conditionals, commonly done, CREF cross-references the comments as individual words, instead of just ignoring all of it. It doesn't check to see there is no associated binary lines at the left margin, etc. and of course, you see LINE numbers and not STATEMENT numbers. To add insult to injury, CREF numbers in 13-bit arithmetic, thus you get line 1 through 8191, and then it doesn't quite start over again, it starts over at 4096 so for longer assemblies, the cross-reference output is inherently anomalous. In any case, P?S/8 PAL numbers to statement number 99999 merely because we felt to allow even longer assemblies was unlikely and would cause the printout of every line to be always one column wider. To date, this has been a wise decision, but there are assemblies longer than what feeble CREF can handle. In fact, CREF cannot fully CREF the source code of P?S/8 PAL ironically! You have to use the so-called "mammoth" option and the symbol table has been optimized [symbol name balancing" to favor the CREF internal rule of pass 1 only does statements below LGNNNN and pass 2 does LGNNNN and symbols sorting higher. Several times over the active development lifetime, symbols were arbitrarily renamed to help out CREF, etc. But eventually that also didn't work and the only way is to also NOT cross-reference literals. Fortunately, literals are only used for once-only initialization code thus, this is merely pathetic, but not serious.]
Thus, the correct method is to output whatever is prepended to the leftside of output lines, and that establishes an offset value. Using the offset value, as a HT character is encountered, the proper column to the nearest multiple of 8 spaces is calculated, and the correct number of spaces is printed accordingly.
But in PAL8, as HT is encountered in the source line, the correct number of spaces is put into the internal parsing buffer! Yes, this means that it is ALWAYS true that the actual source line is not parsed for assembly, but rather a derivative of it with extra space characters!. This in turn makes the effectiveness of this internal buffer even lower. [Thus, the truncation point is made even more prematurely for wide-line input.
I cannot fathom any worse a method for a clod to come up with to misunderstand and ruin the assembly process, but there is a small "flaw" in my reasoning:
It has to be slightly worse than I describe. Why?
Because there is an anomaly I can't account for. I leave it to someone else to get disgusted reading the PAL8 source code to experience first-hand all I have said already, and then still be motivated to find the additional problem:
I tend to write code with as wide a comment as I possibly can. [I'm sure none of you are surprised.] The more commentary the better. This was taught to me by Ed Yourdon who was a schoolmate. [He's the guy who scared everybody about the Japanese taking over the software community and also Y2K, not one of his better moments. But feel free to Google him.]
One thing I have learned over the years. If you are so foolhardy to thing you don't need deep commentary on your own code, it will never work. You'll have to perpetually rewrite it from scratch because NO ONE can remember what their code did later. the time frame might vary, but you are delusional if you believe you can figure out your own uncommented code later. [Newbies haven't been programming long enough to even know when ";later" starts. I can tell you from experience I worked on a single project for about six months [with two others] and I could not just read the code words to understand what I wrote a few months earlier when I had to go back and review what I had done to then-presently write some additional code that had to reference it. The comments saved my ass. [Sometimes, years later, I look at the code and say, how does this work, refer to my former self's comments and say, that's a great piece of code. I honestly don't remember writing it, But the point is the comments make the code self-sufficient regardless of who has to maintain it. Good programmers learn this with age. Bat ones are doing something else, like flipping burgers.
Back to the specifics
Off the top of my head, this is the correct number, you can derive it if you want to know [the number is not what is important, the concept of the specifics of the limitation are]. If you write a line consisting of the following: Start the line with a / and then an HT and then free-form text without HT until you get to the magic number [which means that some comments will exactly fill the line to the limit, some won't, but none will ever be wider] then in the PAL8 output you will see every intended character. If you go past the magic limit column, it will be [harmlessly in this case] truncated [ruining the commentary].
That said, if the line is a code statement [which starts with the address and perhaps the code word in octal] then the input is truncated TWO COLUMNS to the right. [It's probably due to some fortuitous bug and the length of the parse buffer has a safety margin of some columns normally not having the real source line characters transferred into].
Thus, when you are trying to figure out how you must adjust your input so PAL8 can handle it, remember you are on a fool's errand caused by the incompetence of another fool who was not properly supervised.
This is why I am anticipating the removal from my own methods of having to require the P?S/8 source files be completely PAL8 compatible. In the very early days, this was required because we simply didn't have enough access to PAL10. It was a semi-reasonable road trip to the nearest PDP-19 installation, but was clearly impractical when OS/8 became tolerable [yet hated constantly].
However, with the arrival of the quite nice fully functional SIMH [it was years ago just a useless toy by any standard] the situation has changed. I can assemble with P?S/8 PAL while performing source editing in the host [Windows] environment. When I finish all of the legal difficulties and I can release PEPS to the PD, I strongly suggest you abandon working on any PDP-8 work on the PiDP-8 and develop any and all programs on PEPS and then bring back the compatible device images to the PiDP-8 to run them; It's a far easier environment to write code in [and a lot more fun]. [And of course, I do not believe in less is more; nice to have both to achieve the best of both words, etc.] If anyone has checked out what I have done with PEPS with regards to FOCAL, 1969 [available on ibiblio,org] you can get an appreciation for just how much more can be done in that environment, etc.
In any case, I now only use PAL8 when I believe it will still be necessary for the present; i have to revamp some ugly kludged mechanisms I need to generate P?S/8 from itself. Currently it depends on OS/8 in two ways, the first of which is arbitrary and can be just jettisoned; the second will take some effort, and there will be transitional phase where i write some support that actually helps OS/8 users as a side-effect.]. This will also allow me to take advantage of the super-set features of P?S/8 PAL which have come up in other projects [such as conditional literals and additional assembler directives, etc.].
A side issue: The PAL language is strictly upper-case. P?S/8 OS8CON automatically upper-cases the input so can assemble this program without change. [OS/8 PAL8 still won't be able to unless you rewrite the data lines, which is unreasonable since they are fine in ALL other assemblers.]
cjl