Both user interfaces of course allow to start a user program.
On the keyboard the GO key is used to start the program (line 138, via a JMP to GOEXEC), on the TTY CLI the G command handler at line 292.
0072 00EF PCL .BLOCK 1 ; PROGRAM CNT LOW
0073 00F0 PCH .BLOCK 1 ; PROGRAM CNT HI
0074 00F1 PREG .BLOCK 1 ; CURRENT STATUS REG
0075 00F2 SPUSER .BLOCK 1 ; CURRENT STACK POINTER
0076 00F3 ACC .BLOCK 1 ; ACCUMULATOR
0077 00F4 YREG .BLOCK 1 ; Y INDEX
0078 00F5 XREG .BLOCK 1 ; X INDEX
GOEXEC LDX SPUSER At 1Dc8, LINE 841
TXS
LDA POINTH ; PROGRAM RUNS FROM
PHA ; OPEN CELL ADDRESS
LDA POINTL
PHA
LDA PREG
PHA
LDX XREG ; RESTORE REGS
LDY YREG
LDA ACC
RTI
Program counter, Stack pointer SP, Process register PS, X, Y, ACC are initialized from the zeropage locations and the RTI transfers the CPU execution.
The RTI (return from Interrupt) restores all registers from the stack, including the Program counter.
The user program starts at the current selected address (in POINTL, POINTH).
While this way of starting a program has the advantage that the program may start with user supplied values for the CPU registers, there is no guarantee that these zeropage locations contain meningfull values. In fact, after a RESET the contents of RAM and therefore these start values are random. That can create a malfunction program if it does not itself initialize registers.
And not all do, like Microsoft Basic: the decimal flag is not cleared via CLD. And the program crashes if by chance the CPU is in decimal mode.
So before using the G command it is good practice to clear location 00F1, the Processor Status register to clear the decimal flag and 00F2, the stack pointer to FF.
A well behaving program should initialize stack and do a CLD just to be sure.
Returning to the KIM monitor can be done with a JMP START (1C4F).