PDP-11 for the UKNC

The UKNC is a Russian home computer.

Intended for educational purposes, it's CPUs are a direct copy of the PDP-11 processor.
The UKNC actually uses Two PDP-11 processors, one for the main CPU, one for the 'Peripheral processor'... the CPU runs the main code... the PP handles Keyboard, Disk and graphics - though the main CPU can directly access 2 of the 3 graphics bitplanes (It can't access all 3





Cpu KM181VM2 (PDP-11 Compatible)
Main: 8mhz    PP: 6.25mhz
Ram Main: 64k    PP: 32k
Vram 2k
Resolution up to 640x288 @ 8 colors
Sprites
Tilemap
Colors 4 (2 bitplane) or 8 (4 bitplane) from a palette of 15
Sound chip


Emulator

UKNC BTL - Best (or only) Emulator for the UKNC

ChibiAkumas Tutorials


Useful Documentation

Ansi Escape Codes (VT100 Terminal)

Video Ports

Function
From CPU
From PPU
Select Address
177640 177010
Write Plane 0 (Blue)
(impossible) 177012
Write Plane 1 (Green)
176642 177014
Write Plane 2 (Red)
176643 177015

CPU RAM

From To Purpose
0 157777 RAM
160000 177777 IO


PPU RAM

From To Purpose
0 77777 RAM
100000 117777 RAM Window
120000 176777 ROM
177000 177777 IO

UKNC Color Palette

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F

UKNC CPU Ports

60 CH0 IN Interrupt Channel 0
64 CH0 OUT Interrupt Channel 0
460 CH1 IN Interrupt Channel 1
464 CH1 OUT Interrupt Channel 1
474 CH2 OUT Interrupt Channel 2
176000 Windows Register
176000 Window A register
176001 Window B register
176640 Bitplanes address register (RA)
176642 Write Plane 1 (Green) (RD)
176643 Write Plane 2 (Red) (RD)
176660 C1 in STATUS Channel 1
176662 C1 in DATA Channel 1
176664 C1 out STATUS Channel 1
176666 C1 out DATA Channel 1
176674 C2 out STATUS Channel 2
176676 C2 out DATA Channel 2
177560 C0 Console in STATUS Channel 0
177562 C0 Console in DATA Channel 0
177564 C0 Console out STATUS Channel 0
177566 C0 Console out DATA Channel 0

UKNC PP Ports
300 Keyboard interrupt vector
304 Programmable timer interrupt
310 External event interrupt
314 ;RESET on CPU bus interrupt
320 CH0 IN Interrupt Channel 0
324 CH0 OUT Interrupt Channel 1
330 CH1 IN Interrupt Channel 1
334 CH1 OUT Interrupt Channel 2
340 CH2 IN Interrupt Channel 2
177010 Bitplanes address register (RA)
177012 Write Plane 0 (Blue) (RD)
177014 Write Plane 1 (Green) (RD)
177015 Write Plane 2 (Red) (RD)
177016 PPU dots color
177020 PPU bitplanes 0/1 background color
177022 PPU bitplanes 1/2 background color
177024 PPU dots octet
177026 PPU bitplanes mask register
177054 Window (100000-117777)
177060 C0 in DATA Channel 0
177062 C1 in DATA Channel 1
177064 C1 in DATA Channel 2
177066 C0 in STATUS Channel 0
177066 C1 in STATUS Channel 1
177066 C2 in STATUS Channel 2
177070 C0 out DATA Channel 0
177072 C1 out DATA Channel 1
177076 C0 out STATUS Channel 0
177076 C1 out STATUS Channel 1
177320 Joystick "Diana", etc.
177700 Keyboard state register
177702 Keyboard data register
177710 State register
177712 Buffer register
177714 Current state register
177716 System control register - Bit 7 - Beeper

UKNC RAM and VRAM

The UKNC has 192K total split into 3 banks.

The top 32k is used for VRAM, The top 32k of Bank 0 makes up the 'Blue' bitplane, The top 32k of Bank 1 makes up the 'Green' bitplane, The top 32k of Bank 2 makes up the 'Red' bitplane.

The bottom 32k is used by one of the two CPU's

The 32k of banks 1+2 are combined to make up the 64k ram used by the Main CPU (the one that runs our program)... bytes from Bank 1 are at Even Addresses, Bytes from Bank 2 are at Odd addresses of the Main CPU ram.

The 32k of Bank 0 makes up the 32k Low area of the Peripheral Processor (PP) Sub CPU (the top 32k is rom).

There is no way to 'swap' these ram banks via bankswitching, however the CPU's can access the VRAM, and the Peripheral Processor 'PP' Sub CPU can access the Main CPU's ram via the 'RAP' device.

The RAP device is a third chip which has complete access to all the memory, we select an address with one port, then write data with the other two or three (depending on CPU - the SUB PP CPU can access all 3, the main CPU can access only 2)... this is how we typically write to VRAM.

It is also possible to re-configure the SLTAB line table, and move the visible RAM into an area the CPU's can directly access, however this will reduce the RAM available for other purposes.


Physical addresses and RAP ports

CPU RAP Address select port: 176640
PP  RAP Address select port : 177012


Physical Addresses

Bank 0
Blue VRAM
Bank 1
Green VRAM
Bank 2
Red VRAM
Used for VRAM
by default
177777 177777 177777
...... ...... ......
100001 100001 100001
100000 100000 100000
Used for RAM
by default
077777 077777 077777
...... ...... ......
000001 000001 000001
000000 000000 000000
RAP MAIN CPU Port 
 Impossible 
   176642   
   176643   
RAP PP CPU Port 177012 177014 177015


Main CPU Memory assignment

Bytes from Banks 1+2 make alternate bytes of CPU ram

Main CPU Address RAM
Even Add
RAM
Odd Addr
177776/177777 077777 077777
............. ...... ......
100002/100003 040001 040001
100000/100001 040000 040000
077776/077777 037777 037777
............. ...... ......
000002/000003 000001 000001
000000/000001 000000 000000


Sub CPU PP Memory assignment

Low 32k uses Bank 0 RAM (both odd and even), High 32k uses ROM (both odd and even)

Sub CPU
PP address
ROM
(Odd and Even)
RAM
(Odd and Even)
177776/177777 077776/077777
............. .............
100002/100003 000002/000003
100000/100001 000000/000001
077776/077777
077776/077777
.............
.............
000002/000003
000002/000003
000000/000001
000000/000001

UKNC SLTAB entries

*** Thanks to aberrant_hacker for this information on the UKNC!... he's working on a port of ChibiAkumas to the UKNC... check it out here! ***

The STAB is the line definition table, it starts at address 270, each line has two words, the first is the VRAM address of that line, the second is a pointer to the next line, and a few options... more options can be configured using a 4 word SLTAB definition.

There are 3 types of record, one uses 2 words per record, the other two use 4 words... what record is next is defined by the L and S bits of the previous line.

312 (1..312) lines is SECAM half-frame
309 (1..309) SLTAB records in total (lines 4..312 of SECAM's half-frame)
  scanlines   1..19  are not visible due to the vertical blanking interval
  scanlines  20..307 are visible (lines 23-310 of SECAM's half-frame)
  scanlines 308..309 are not visible due to the vertical blanking interval


F E D C B A 9 8 7 6 5 4 3 2 1 0
2 word
record
V V V V V V V V V V V V V V V V    V=Vram Address
A A A A A A A A A A A A A S L C    C=Toggle Cursor on/off    L=Length of next record (2/4 words)   
   S= 4-word selector (Options/Palette) / 2-word address bit 2    A=Address bits 3-15



F E D C B A 9 8 7 6 5 4 3 2 1 0
4 word
record

Options
- C C C C C C C G G G T Y R G B    YRGB=Cursor color & Brightness / T=Type (Char/Graphic) / G=Graphic Cursor pos / C=Cursor pos
- - - - - - - - - - S S - R G B    RGB= Line Brightness S=Scale (640/320/160/80)
V V V V V V V V V V V V V V V V    V=Vram Address
A A A A A A A A A A A A A S L C    C=Toggle Cursor on/off    L=Length of next record (2/4 words)   
   S= 4-word selector (Options/Palette) / 2-word address bit 2    A=Address bits 3-15



F E D C B A 9 8 7 6 5 4 3 2 1 0
4 word
record

palette
Y R G B Y R G B Y R G B Y R G B    Palette bit combos %011 %010 %001 %001
Y R G B Y R G B Y R G B Y R G B    Palette bit combos %111 %110 %101 %100
V V V V V V V V V V V V V V V V    V=Vram Address
A A A A A A A A A A A A A S L C    C=Toggle Cursor on/off    L=Length of next record (2/4 words)   
   S= 4-word selector (Options/Palette) / 2-word address bit 2    A=Address bits 3-15




 

View Options
Default Dark
Simple (Hide this menu)
Print Mode (white background)

Top Menu
***Main Menu***
Youtube channel
Forum
AkuSprite Editor
Dec/Bin/Hex/Oct/Ascii Table

Z80 Content
***Z80 Tutorial List***
Learn Z80 Assembly
Hello World
Advanced Series
Multiplatform Series
Platform Specific Series
ChibiAkumas Series
Grime Z80
Z80 Downloads
Z80 Cheatsheet
Sources.7z
DevTools kit
Z80 Platforms
Amstrad CPC
Elan Enterprise
Gameboy & Gameboy Color
Master System & GameGear
MSX & MSX2
Sam Coupe
TI-83
ZX Spectrum
Spectrum NEXT
Camputers Lynx

6502 Content
***6502 Tutorial List***
Learn 6502 Assembly
Advanced Series
Platform Specific Series
Hello World Series
Grime 6502
6502 Downloads
6502 Cheatsheet
Sources.7z
DevTools kit
6502 Platforms
Apple IIe
Atari 800 and 5200
Atari Lynx
BBC Micro
Commodore 64
Commander x16
Super Nintendo (SNES)
Nintendo NES / Famicom
PC Engine (Turbografx-16)
Vic 20

68000 Content
***68000 Tutorial List***
Learn 68000 Assembly
Hello World Series
Platform Specific Series
Grime 68000
68000 Downloads
68000 Cheatsheet
Sources.7z
DevTools kit
68000 Platforms
Amiga 500
Atari ST
Neo Geo
Sega Genesis / Mega Drive
Sinclair QL
X68000 (Sharp x68k)

8086 Content
Learn 8086 Assembly
Platform Specific Series
Hello World Series
8086 Downloads
8086 Cheatsheet
Sources.7z
DevTools kit
8086 Platforms
Wonderswan
MsDos

ARM Content
Learn ARM Assembly
Platform Specific Series
ARM Downloads
ARM Cheatsheet
Sources.7z
DevTools kit
ARM Platforms
Gameboy Advance
Nintendo DS
Risc Os

Risc-V Content
Learn Risc-V Assembly
Risc-V Downloads
Risc-V Cheatsheet
Sources.7z
DevTools kit

PDP-11 Content
Learn PDP-11 Assembly
PDP-11 Downloads
PDP-11 Cheatsheet
Sources.7z
DevTools kit

TMS9900 Content
Learn TMS9900 Assembly
TMS9900 Downloads
TMS9900 Cheatsheet
Sources.7z
DevTools kit
TMS9900 Platforms
Ti 99

6809 Content
Learn 6809 Assembly
6809 Downloads
6809/6309 Cheatsheet
Sources.7z
DevTools kit
6809 Platforms
Dragon 32/Tandy Coco
Fujitsu FM7
TRS-80 Coco 3
Vectrex

My Game projects
Chibi Aliens
Chibi Akumas

Work in Progress
Learn 65816 Assembly
Learn eZ80 Assembly

Misc bits
Ruby programming









Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
Hardware Sprites on the PC Engine / Turbografix

Lesson YQuest10 - Hardware sprites on the Genesis

6809 Lesson 5 - More Maths - Logical Ops, Bit shifts and more

x68000 Hardware Sprites

Joypad & Pen on the GBA / NDS ... Key reading on Risc OS

C64 Hardware Sprites - 6502 ASM Lesson YQuest14

SNES Hardware sprites - 6502 ASM YQuest13

Vector drawing on the Vectrex

Graphics on the Fujitsu FM7

CPC ASM: Tape loading on the Amstrad CPC (5K subs special)

68000 YQuest7 - Atari ST Specific code

Making Sound with the AY-3-8910 on the Vectrex and FM7


Gaming + more:

Emily The Strange (DS) - Live full playthrough

$150 calculator: Unboxing the Ti-84 Plus CE (eZ80 cpu)























































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
Hardware Sprites on the PC Engine / Turbografix

Lesson YQuest10 - Hardware sprites on the Genesis

6809 Lesson 5 - More Maths - Logical Ops, Bit shifts and more

x68000 Hardware Sprites

Joypad & Pen on the GBA / NDS ... Key reading on Risc OS

C64 Hardware Sprites - 6502 ASM Lesson YQuest14

SNES Hardware sprites - 6502 ASM YQuest13

Vector drawing on the Vectrex

Graphics on the Fujitsu FM7

CPC ASM: Tape loading on the Amstrad CPC (5K subs special)

68000 YQuest7 - Atari ST Specific code

Making Sound with the AY-3-8910 on the Vectrex and FM7


Gaming + more:

Emily The Strange (DS) - Live full playthrough

$150 calculator: Unboxing the Ti-84 Plus CE (eZ80 cpu)























































Buy my Assembly programming book
on Amazon in Print or Kindle!


Buy my Assembly programming book

Available worldwide!
Search 'ChibiAkumas' on
your local Amazon website!
Click here for more info!












































Recent New Content
Hardware Sprites on the PC Engine / Turbografix

Lesson YQuest10 - Hardware sprites on the Genesis

6809 Lesson 5 - More Maths - Logical Ops, Bit shifts and more

x68000 Hardware Sprites

Joypad & Pen on the GBA / NDS ... Key reading on Risc OS

C64 Hardware Sprites - 6502 ASM Lesson YQuest14

SNES Hardware sprites - 6502 ASM YQuest13

Vector drawing on the Vectrex

Graphics on the Fujitsu FM7

CPC ASM: Tape loading on the Amstrad CPC (5K subs special)

68000 YQuest7 - Atari ST Specific code

Making Sound with the AY-3-8910 on the Vectrex and FM7


Gaming + more:

Emily The Strange (DS) - Live full playthrough

$150 calculator: Unboxing the Ti-84 Plus CE (eZ80 cpu)