Tube Protocol

From BeebWiki
Revision as of 17:43, 11 October 2006 by Jgharston (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Client-to-Host transfers

         Input parameters                      Output parameters
OSWRCH   R1: A
OSRDCH   R2: &00                               Cy A
OSCLI    R2: &02 string &0D                    &7F or &80
OSBYTELO R2: &04 X A                           X
OSBYTEHI R2: &06 X Y A                         Cy Y X
OSWORD   R2: &08 A in_length block out_length  block
OSWORD0  R2: &0A block                         &FF or &7F string &0D
OSARGS   R2: &0C Y block A                     A block
OSBGET   R2: &0E Y                             Cy A
OSBPUT   R2: &10 Y A                           &7F
OSFIND   R2: &12 &00 Y                         &7F
OSFIND   R2: &12 A string &0D                  A
OSFILE   R2: &14 block string &0D A            A block
OSGBPB   R2: &16 block A                       block Cy A

RESET    R1: string &00                        R2: &7F or &80

The OSFILE block transfered is the 16 bytes that do not include the filename pointer.

While waiting for output parameters to be returned any number of Host-to-Client transfers may take place. The escape state could be changed or data can be transfered. If the Host sends an error or jumps to execute code, no output block will be returned.

On return from OSCLI and RESET if &80 is returned, then code has been run, and it should be entered at the address of the last Type 4 Host-To-Client transfer.

Host-to-Client transfers

Escape R1: flag, b7=1

Event R1: &00 Y X A

Error R4: &FF R2: &00 err string &00

Transfer R4: action ID block sync R3: data

First byte in R1 or R4 generates INT in client. Transfers via R3 generate NMI in client. Control blocks are transfered high byte down to low byte. Strings and data are transfered low byte up to high byte.

Transfers Types

0 - Transfer multiple single bytes client to host

1 - Transfer multiple single bytes host to client

2 - Transfer multiple pairs of bytes client to host

3 - Transfer multiple pairs of bytes host to client

4 - Execute code on client

5 - Tube has been released, no block or sync are sent

6 - Transfer exactly 256 bytes client to host

7 - Transfer exactly 256 bytes host to client

Tube Claimant IDs

When the Tube host code is claimed to process a transaction a claimant ID must be passed in the bottom six bits of A.

  Claimant                      Claim Identity
  --------------------------------------------
  Tape                               0   &00
  DFS                                1   &01
  NFS primitives                     2   &02
  NFS                                3   &03
  ADFS                               4   &04
  TELESOFT                           5   &05
  HOSTFS                             6   &06
  VFS                                7   &07
  SRAM Utils                         8   &08
  Z80 and CP/M                       9   &09
  IEEEFS, Acacia RAMFS, user calls  15   &0F
  HADFS                             22   &16
  Language startup                  63   &3F

Jgharston 17:39, 11 October 2006 (BST)