In the disassembly from Bruce Tomlin there are many "garbled" comments (Ramp on/off switched, T1 one shot enabled disabled...)
Here a corrected version:
;-----------------------------------------------------------------------
; F495 Print_Str
;
; This is the routine which does the actual printing of a string. The
; U register points to the start of the string, while $C82A contains
; the height of the character, cell, and $C82B contains the width of
; the character cell. The string is terminated with an 0x80.
;
; The string is displayed by drawing 7 horizontal rows of dots. The
; first row is drawn for each character, then the second, etc. The
; character generation table is located at ($F9D4 + $20). Only
; characters 0x20-0x6F (upper case) are defined; the lower case
; characters a-o produce special icons.
;
; ENTRY DP = $D0
; U-reg points to the start of the string
;
; EXIT: U-reg points to next byte after terminator
;
; D-reg, X-reg trashed
;-----------------------------------------------------------------------
Print_Str:
STU Vec_Str_Ptr ;Save string pointer
LDX #Char_Table-$20 ;Point to start of chargen bitmaps
LDD #$1883 ;a→AUX: b→ORB: $8x = Disable RAMP, Disable Mux, mux sel = 01 (int offsets)
CLR <VIA_port_a ;Clear D/A output
STA <VIA_aux_cntl ;Shift reg mode = 110 (shift out under system clock), T1 PB7 disabled, one shot mode
LDX #Char_Table-$20 ;Point to start of chargen bitmaps
; first entry here, ramp is disabled
; if there was a jump from below
; ramp will be enabled by next line
LF4A5:
STB <VIA_port_b ;ramp off/on set mux to channel 1
DEC <VIA_port_b ;Enable mux
LDD #$8081 ;both to ORB, both disable ram, mux sel = 0 (y int), a:→enable mux: b:→disable mux
NOP ;Wait a moment
INC <VIA_port_b ;Disable mux
STB <VIA_port_b ;Disable RAMP, set mux to channel 0, disable mux
STA <VIA_port_b ;Enable mux
TST $C800 ;I think this is a delay only
INC <VIA_port_b ;disable mux
LDA Vec_Text_Width ;Get text width
STA <VIA_port_a ;Send it to the D/A
LDD #$0100 ;both to ORB, both ENABLE RAMP, a:→ disable mux, b:→ enable mux
LDU Vec_Str_Ptr ;Point to start of text string
STA <VIA_port_b ;[4]enable RAMP, disable mux
BRA LF4CB ;[3]
; one letter is drawn (one row that is) in 18 cycles
; 13 cycles overhead
; ramp is thus active for #ofLetters*18 + 13 cycles
LF4C7:
LDA A,X ;[+5]Get bitmap from chargen table
STA <VIA_shift_reg ;[+4]rasterout of char bitmap "row" thru shift out in shift register
LF4CB:
LDA ,U+ ;[+6]Get next character
BPL LF4C7 ;[+3]Go back if not terminator
LDA #$81 ;[2]disable mux, disable ramp
STA <VIA_port_b ;[4]disable RAMP, disable mux
NEG <VIA_port_a ;Negate text width to D/A
LDA #$01 ;enable ramp, disable mux
STA <VIA_port_b ;enable RAMP, disable mux
CMPX #Char_Table_End-$20;[4]Check for last row
BEQ LF50A ;[3]Branch if last row
LEAX $50,X ;[3]Point to next chargen row
TFR U,D ;[6]Get string length
SUBD Vec_Str_Ptr ;[7]
SUBB #$02 ;[2] - 2
ASLB ;[2] * 2 calculate return "way"
BRN LF4EB ;[3]Delay a moment
LF4EB:
LDA #$81 ;[2]disable RAMP, disable mux
NOP ;[2]
DECB ;[2]
BNE LF4EB ;Delay some more in a loop
STA <VIA_port_b ;disable RAMP, disable mux
LDB Vec_Text_Height ;Get text height
STB <VIA_port_a ;Store text height in D/A [go down → later]
DEC <VIA_port_b ;Enable mux
LDD #$8101
NOP ;Wait a moment
STA <VIA_port_b ;disable RAMP, disable mux
CLR <VIA_port_a ;Clear D/A
STB <VIA_port_b ;enable RAMP, disable mux
STA <VIA_port_b ;disable RAMP, disable mux
LDB #$03 ;$0x = ENABLE RAMP?
BRA LF4A5 ;Go back for next scan line
LF50A:
LDA #$98
STA <VIA_aux_cntl ;T1→PB7 enabled
JMP Reset0Ref ;Reset the zero reference