• Please review our updated Terms and Rules here

Brushing up on PAL code

Mike_Z

Veteran Member
Joined
Dec 1, 2013
Messages
1,713
Location
Near Milwaukee Wisconsin
I know what this means
Code:
100 TAD 500
500 25
Add the accumulator with the data at address 500 and save it in the accumulator. AC=AC+25
And this means
Code:
100 TAD I 500
500 1025
1025 75
Add the accumulator with the data at the effective address of 1025 and save it in the accumulator. AC=AC+75
BUT, what does this means?
Code:
100 TAD M377
Thanks for the help, Mike
 
'M377' would be the label of an arbitrary location in memory, like:

*2200
TAD M377

*2345
M377, 0377

But because of PDP-8 architecture restrictions the label M377 must refer to a location that is either in page 0 or the same page as the referencing instruction.
 
Mike:

You can only directly address locations on the page the instruction is located or on page 0.

Code:
*0100
        TAD 500
*0500
        1025
Will not work because the TAD 500 instruction is on page 0 (locations 0000 through 0177) and would try to reference page 2 (0400 through 0577). The assembler will probably mark this as an off page reference.

Likewise with the TAD I 500. The 500 is an off page reference.

The M377 is a constant and normally M means Minus. I have seen M used as a prefix to refer to a Mask. I personally use C for positive constants and M for negative constants. If this came from the funky code beyond 7600 in the ISZ test they are comparing the character read from a buffer that was sent to the console to 0377 which is a RUBOUT character or all bits on. They seemed to use this as a string terminator in that program.

I am happy to answer any questions.

How does that old cartoon go?

Answers 10 cents.
Answers requiring thought 50 cents.
Correct answers $1.
 
The other possibility when you type TAD 500 and assemble it is that the assembler might assume you know what you are doing and encode this as
1500 which when executed will perform an indirect reference through address 0100 and add the contents of the memory location whose address is stored at address 0100 to the AC. I don't think I have ever tried feeding something like that to the assembler but I think that is what it will do. And that is not at all what you expect.

Just tried it on palbart and palbart gives this:
Code:
       *100                                                               Page 1


    1        0100   *100
    2 00100  1100          TAD 500
IR off page                   ^
    3                      $

      1 detected error
      No links generated
Hopefully PAL-8 would also generate an error.
 
Hopefully PAL-8 would also generate an error.
I think it will. The memory reference instructions have to be treated specially, because if you treat them similarly to the treatment of "SPA CLA" (wich is, inclusive OR) you'll almost always get the wrong answer.

Vince
 
I've been having some fun working on improving my coding in PAL8. Since I have not been feeling to good, I have not been in the basement using the real hardware, but upstairs in the warm using the laptop and simH. I have a quick question about simH. When I run a PAL8 program with a HALT statement, simH stops it displays something like this
Code:
HALT instruction, PC:00210 <TLS>
sim>
I have not figured out how to restart simH without closing it and restarting. How do I do this? Should I not use a HALT? Is there something that I can enter at the sim> prompt? I tried PDP8, but that didn't work, Thanks Mike
 
Mike,

Hope you feel better soon.

Try typing “help” at the prompt! You will get a list of commands...

You could try “cont” (continue) - but I don’t think this works, as it just executes the HALT again.

You could tell the program to ‘go xxx’ to start execution from address xxx.

You could also deposit the value of PC+1 into PC and then cont - e.g. for your example above:

sim>deposit pc 211
sim>cont

This assumes a valid instruction stream after the HALT of course.

Dave
 
Dave, when the HALT is done, the simH seems to jump out of the PDP8 simulation. I do not have the period prompt, but have a sim> prompt. I tried reset and go, but also comes back to the HALT instruction. I thought that reset might work, to restart the simulation, no soap, Mike
 
Yes, the HALT does a HALT and stops running (for example) OS/8.

Control returns to the SIMH executive (the 'sim>' prompt).

So, the big question is, what do you want to do after the HALT?

On a 'real' PDP-8 - the machine is halted...

You can examine and deposit from/to registers and memory - likewise with SIMH (you can examine and deposit registers and memory).

You can tell SIMH to reboot from a disk or tape or paper tape device (boot <device>).

Think in terms of what you would do with your real PDP-8/E.

Of course, if the SIMH .ini file terminates with an "exit" command, when the HALT occurs - it will exit back to your Windows prompt.

Dave
 
That's it.

Think of the PDP-8/E and what you would do - i.e. load address 7600 into the PC and RUN - and then translate that into the equivalent SIMH command.

Dave
 
I'm still working with simH and I'm making progress, but this morning the PDP8 simulation gives me an error code when it is first started. I'm unsure why this error occurs.
Code:
PDP-8 simulator V3.9-0
MONITOR ERROR 6 AT 16204 (DIRECTORY OVERFLOW)
Looking around on the web I could not find any clue why this error comes up. I re booted the computer, but that did not help. This error was not there yesterday. Mike
 
I thought of that, yet when I do a DIR, I get this
Code:
227 FILES IN 1517 BLOCKS -  423 FREE BLOCKS
Is there a file limit that maybe causing this? It appears that there is space. Mike
 
Well.... you must be correct. I moved three small files to one of the other disks and now the error code is gone and everything works as before. I apparently need to clean out the system disk and move or delete some of the files that I do not need. Mike
 
I've started to move files around, but noticed I have a bunch of .RA and .RL files that do not have corresponding .FT files. Do other programs produce the .RA and .RL files, maybe FOCAL or BASIC? Mike
 
Yes, every file device has both a maximum number of files and a maximum number of blocks limit. There are free blocks on the disk, but no free directory entries for new files to be created.

RA files are RALF assembler source files.
RL files are relocatable binary files.

I think these are generally artefacts of compiling FORTRAN programs. They are intermediate files and can be deleted after a module of source has been compiled.

I see you say there are no corresponding FORTRAN source, but try a compilation and see what gets generated.

Dave
 
Last edited:
I use FORTRAN IV quite a bit and when you compile a *.FT, if you do the long method, *.RA *.RL and *.LS files are generated. I recognize some of these files as ones I made. My disk RKB1: is mostly empty, so I moved all the RA, RL and LS files there. Apparently the max number of files on the disk is 227, at least that is what I had when the error 6 was generated. Now, after the move, the RKA0: has only 165 files. and lots of blocks. So, I should be OK and if I need those other files they are on the RKB1:
What I've been doing is writing a LEADER.PA, TRLR.PA, TITLE.PA and a PCH.PA. I was going to combine all these files into one file, but I found that DEC has a BATCH program. So I wrote a batch file and it seems to work.
Code:
$JOB BATCH PUNCH FILE
.EXECUTE LEADER.BN
.EXECUTE TITLE.BN
.EXECUTE PCH.BN
.EXECUTRE TRLR.BN
$END
Currently, I have the filename that will be punched on paper tape embedded in the TITLE and PCH code. I want to be able to pass a filename to both the TITLE and PCH programs, but have not been able to determine how that can be done. The BATCH program can include a $MSG with the message to enter the filename. The $MSG will wait for the user to enter something, That something should be in the keyboard monitor or CCL program? But how do I access that. Once I have that I can save the filename in memory for the TITLE and PCH to use. Any clues, Thanks, Mike
 
Back
Top