Wanting to start sizecoding on a PDP-11 platforms like the BK-0010 and BK-0011m in this day and age can be tough, especially if you have not grown up with such a machine.
So here is a bit of help to get you started:
Theh PDP-11's registers are ALL 16 bit.
R0, R1, R2, R3, R4 R5 (Often Used to remember the return address during calls) SP (R6), PC (R7)
If an Even register number (R0,R2,R4) is used for certain commands (for example MUL)- the register and it's following will be used as a 32 bit pair when the result is returned
Assignment direction is left (source) to right (dest). Default number mode for the PDP-11 is Octal mode (base-8), but there is possible to use other modes as well
mov #777,r0 ; octal =default mov #^b101,r0 ; binary mov #^x0aa,r0 ; hexadecimal mov #'A,r0 ; ascii
Here is a rough translation for some of the PDP-11 instructions:
- MOV src,dest - move source int dest register
- CLR, CLRB - move zero into register
- INC/DEC , incb/decb
Testing and Branching
The PDP-11 has many branch conditions:
- TST - test register and update flags
- CMP - compare register
- BLT - branch if smaller (signed)
- BGT - branch if greater (signed)
- BLE - branch if smaller or equal (signed)
- BLO - branch if smaller (unsigned)
- BHI - branch if greater (unsigned)
- BLOS - branch if smaller or equal (unsigned)
- BHIS - branch if greater or equal (unsigned)
- BEQ - will branch if Z is set (Branch if EQual)
- BNE - will branch if Z is not set (Branch if Not Equal)
- BVS will branch if overflow is set
- BVC will branch if overflow is clear
- BMI will branch if the value is negative (minus - N set)
- BPL will branch if the value is positive (plus - N clear)
- BCS will Branch if Carry is Set
- BCC will Branch if Carry is Clear
- BR - this will ALWAYS branch
Learning PDP-11 Assembler
There are a couple of PDP-11 tutorials available online, but most of them are in russian. Here is a basic one:
The Electronika BK-0010 is a 16-bit PDP-11-compatible fanless Soviet home computers developed under the Electronika brand by NPO Scientific Center, the leading Soviet microcomputer design team at the time. It was also the predecessor of the more powerful UKNC and DVK micros.
Setting up your development platform for the BK-0010/BK-0011m machine works as follows:
- Assembler: https://github.com/imachug/PDPy11
- Emulator: http://sandro.pdp-11.ru
To be added.
Getting something on screen
Now to get something on screen, lets fill our colorram with a simple AND pattern, like so:
to be added
To be added.
Small demos with documented source code
- Mona Lisa for the BK-0010/11m https://www.pouet.net/prod.php?which=86820
I found resources on BK-0010 sizecoding in english to be sparse.
- Good book to start BK-0010 programming http://www.translatetheweb.com/?from=&to=en&ref=TVert&dl=en&rr=DC&a=http%3a%2f%2fgid.pdp-11.ru%2fbooks%2fprogramming_BK10.html
- BK0010 ROM, system, etc http://www.translatetheweb.com/?from=&to=en&ref=TVert&dl=en&rr=DC&a=http%3a%2f%2fgid.pdp-11.ru%2fbooks%2f00001-01.32.03.html
- BK-0011M Information https://www.translatetheweb.com/?ref=TVert&from=&to=en&a=http%3A%2F%2Fgid.pdp-11.ru%2Fbooks%2F00015-01.32.01.html
- List of PDP-11 resources (Russian) http://gid.pdp-11.ru/doclist.html