Here is the actual formula that they use written in commodore 64 assembly language.
1 *=$0801
2 .byte $0c, $08, $0a, $00, $9e, $20
3 .byte $34, $30, $39, $36, $00, $00
4 .byte $00
5 *=$1000
6 ldx #$000
7 loop lda message,x
8 and #$3f
9 sta $0400,x -> 1024
10 inx
11 cpx #$0c
12 bne loop
13 rts...