Startup of the KIM-1: RESET

RESET is executed when the user presses the RESET button, and the 6502 RESET input is triggered.

RST     LDX   #$FF       ; KIM ENTRY VIA RST at $1C22
        TXS   
        STX   SPUSER
        JSR   INITS
  
        subroutine INITS and INIT1 at 1E88

       INITS   LDX   #$01       ; SET KB MODE TO ADDR
               STX   MODE        
       ;
       ; the Port A and B data direction registers are setup here
       ; Port a is all input
       ; Port B PB0-PB5 is output
       ; PB1 and PB2 are 1, other PBx 0
       ;
       INIT1   LDX   #$00        
               STX   PADD       ; FOR SIGMA USE SAD
               LDX   #$3F        
               STX   PBDD       ; FOR SIGMA USE SBDD
               LDX   #$07       ; ENABLE DATA IN    
	       STX   SBD        ; OUTPUT
               CLD
               SEI
               RTS

here code to determine baudrate, see the TTY section

START   JSR   INIT1                              
        LDA   #$01
        BIT   SAD
        BNE   TTYKB

Read here how the TTY/LED selection is made with an external switch
[/code]
fall into TTY interface

TTYKB do the LED display and keyboard scanning

[/code]