Search
  • daveor

Simplest Possible Program Part 2: Showing data on the panel

This is the second part of the project to develop the simplest possible program on PDP11. In a previous post I created a program to decrement a register value to zero. This post extends this program to view the current value of the register being decremented on the display panel.


Step 1: Accessing the display panel

The control panel is accessed using a specific memory address, 777 570. This is called the "Control Switches and Display Register". If you read this value, you will obtain the current value of the control switches on the panel. If you write to this value, whatever you write will be displayed on the "Data" lights on the front panel.


Step 2: Adjusting the program to display the current value

Only a very small adjustment to the program developed previously is required to display the result to the panel. Here's the amended program:

set cpu 11/70,4M
;set realcons=localhost
set realcons panel=11/70
set realcons interval=8
set realcons connected

D 1000 MOV #100, R0
D 1004 MOV R0, #177570
D 1010 DEC R0
D 1012 BPL 1004
D 1014 HALT

RESET ALL
SET CPU IDLE
D PSW 000340
D PC  001000

The only new line is the following:

D 1004 MOV R0, #177570

This line deposits in instruction into memory address 1004 to move the value of R0 into the Control Switch and Display Register. The other memory locations in the program need to be updated to accommodate this new instruction but otherwise the program is exactly the same.


Step 3: Running the program

The program is run in exactly the same way as described in the previous post on this topic. As you step through the program you will note two things;


  1. The "Data" display on the panel will contain the current value of R0 and every time you step through the decrement loop, this value will be reduced by one.

  2. The "Address" display on the panel will contain the current value of the Program Counter, in other words the address of the next instruction to be executed.

Conclusion

It was a very simple extension to the previous program to show a data value on the panel.


95 views0 comments

Recent Posts

See All

Reverse engineering PDP-11 BASIC: Part 26

This short post describes TRAP 116 and the BASIC RUN, STOP, END and RANDOMIZE commands. For context and a list of other posts on this topic, see the PDP-11 BASIC reverse engineering project page. TRAP

Reverse engineering PDP-11 BASIC: Part 25

This post describes the BASIC FOR and NEXT loop commands. For context and a list of other posts on this topic, see the PDP-11 BASIC reverse engineering project page. Introduction Loops are implemented

Reverse engineering PDP-11 BASIC: Part 24

This post describes the BASIC READ, INPUT and RESTORE commands. For context and a list of other posts on this topic, see the PDP-11 BASIC reverse engineering project page. Introduction The INPUT comma