For 400, 800 (OS A)#

ADRHEXADRNAMEDescriptionshadowOS
54017$D301PORTB STICK2 STICK3 PTRIG4 PTRIG5 PTRIG6 PTRIG7 400/800

Read or write data from the control ports (joystick ports), depending on how the data direction is set (default: 0 "read/input"). To set the direction, set Bit 2 of PBCTL to "0" and define the direction by setting the bits of PORTB (0=read, 1=write) for each input/output line. Then set Bit 2 of PBCTL to "1" again.

Example:

PACTL=PACTL && %11111011 ;set Bit 2 to 0
PORTA=%11110000          ;set Port 2 to output/write, Port 1 is input/read
PACTL=PACTL %% %00000100 ;set Bit 2 to 1

BitFunctionDescriptionJoystick directionPaddletrigger
7PA7Joystick Port 4 Pin 4RightPaddle 8 PTRIG7
6PA6Joystick Port 4 Pin 3LeftPaddle 7 PTRIG6
5PA5Joystick Port 4 Pin 2Downnot used
4PA4Joystick Port 4 Pin 1Up not used
3PA3Joystick Port 3 Pin 4RightPaddle 6 PTRIG5
2PA2Joystick Port 3 Pin 3LeftPaddle 5 PTRIG4
1PA1Joystick Port 3 Pin 2Downnot used
0PA0Joystick Port 3 Pin 1Upnot used

Joystick direction sets Bit=0 when pushed in that direction

Paddletrigger Bit=0 when pressed

For 600XL, 800XL, 1200XL#

ADRHEXADRNAMEDescriptionOS
54017$D301PORTB Memory Management XL/XE

1200XL

BitFunctionDescription
7$5000-$57FF0=Self test, 1=RAM
6not used
5not used
4not used
3LED20=off, 1=on
2LED10=off, 1=on
1not used
0$C000-$FFFF0=RAM, 1=OS-ROM

600XL/800XL

BitFunctionDescription
7$5000-$57FF0=Self test, 1=RAM
6not used
5not used
4not used
3not used
2not used
1$A000-$BFFF0=ATARI BASIC ROM, 1=RAM
0$C000-$FFFF0=RAM, 1=OS-ROM

For 130XE#

Bits 2,3,4,5 set the behavior of extended RAM which is always mapped to $4000-$7FFF area.
BitFunctionDescription
7$5000-$57FF0=Self test, 1=RAM
6not used
5ANTIC0=ANTIC has access to extended RAM, 1=ANTIC has access to main RAM
4CPU0=CPU has access to extended RAM, 1=CPU has access to main RAM
3$4000-$7FFFBank selection bit
2$4000-$7FFFBank selection bit
1$A000-$BFFF0=ATARI BASIC ROM, 1=RAM
0$C000-$FFFF0=RAM, 1=OS-ROM

Compatibility mode (only main bank enabled)

Bit 5 Bit 4 Bit 3 Bit 2 CPU accesses ANTIC accesses
VBE CPE Bank selectionBank selection
1 1 doesn't matterdoesn't matterM $4000-$7FFF M $4000-$7FFF

CPU extended RAM mode

Bit 5 Bit 4 Bit 3 Bit 2 CPU accesses ANTIC accesses
VBE CPE Bank selection Bank selection
1 0 0 0 E $0000-$3FFF M $4000-$7FFF
1 0 0 1 E $4000-$7FFF M $4000-$7FFF
1 0 1 0 E $8000-$BFFF M $4000-$7FFF
1 0 1 1 E $C000-$FFFF M $4000-$7FFF

Video (ANTIC) extended RAM mode

Bit 5 Bit 4 Bit 3 Bit 2 CPU accesses ANTIC accesses
VBE CPE Bank selectionBank selection
0 1 0 0 M $4000-$7FFF E $0000-$3FFF
0 1 0 1 M $4000-$7FFF E $4000-$7FFF
0 1 1 0 M $4000-$7FFF E $8000-$BFFF
0 1 1 1 M $4000-$7FFF E $C000-$FFFF

General extended RAM Mode

Bit 5 Bit 4 Bit 3 Bit 2 CPU accesses ANTIC accesses
VBE CPE Bank selectionBank selection
0 0 0 0 E $0000-$3FFF E $0000-$3FFF
0 0 0 1 E $4000-$7FFF E $4000-$7FFF
0 0 1 0 E $8000-$BFFF E $8000-$BFFF
0 0 1 1 E $C000-$FFFF E $C000-$FFFF

see also: Controller topics

previous: PORTA

next: PACTL