.title make_banner ISU Print Symbiont Routine .ident /V1.0/ ; ; Author: Rodrick A ELdridge ; 104 Computer Science ; Iowa State University ; Ames, Iowa 50011 ; (515) 294-5659 ; ; Created: Summer 1986 ; ; Description: The make_banner routine will create one line of block letters. ; Subsequent calls to the make_banner routine will create ; subsequent lines. ; ; Taken together, these lines produce banner-style block letters. ; ; Format: external module make_banner - ; ; ; Arguments: text: character string ; (passed by descriptor) ; ; Character text string to print. ; ; spaces: longword ; (passed by reference) ; ; Number of leading spaces on each line. ; ; width: longword ; (passed by reference) ; ; Number of times each line is printed. ; Width must be at least 1. ; ; height: longword ; (passed by reference) ; ; Number of times to repeat each character on a ; line. Height must be at least 1. ; ; spacing: longword ; (passed by reference) ; ; Number of spaces bewteen each block character. ; Spacing should be at least 1. ; ; font: byte ; (passed by reference) ; ; Banner construction character. ; If font= 0, then use the corresponding character ; in the text string as the construction ; character. ; ; lineno: longword ; (passed by reference) ; ; Current line number. ; lineno must be from 0 to (7*height)-1. ; ; buffer: character string ; (passed by descriptor) ; ; Buffer for one line of block characters. ; The buffer must be big enough to hold the line. ; ; length: word ; (passed by reference) ; ; Resultant length of buffer. ; ; Condition values returned: ; ; ss$_normal: Sucessful completion, always returned. ; global module make_banner - - mask= - psect=make_banner const $ssdef ; system status definitions var symbols: .ascii \!"#$%&'()*+,-./0123456789:;<=>?@\ .ascii /ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`/ .ascii \abcdefghijklmnopqrstuvwxyz{|}~\ symbols_length = .-symbols ; ; each block character is 5x7 ; for example, the letter A is made up from the bits: ; ; dec hex binary character ; ; 14 0E 01110 AAA ; 17 11 10001 A A ; 17 11 10001 A A ; 17 11 10001 A A ; 31 1F 11111 AAAAA ; 17 11 10001 A A ; 17 11 10001 A A ; symbols_table: .byte 00,00,00,00,00,00,00 ; (blank) .byte 04,04,04,04,04,00,04 ; ! .byte 27,27,25,18,00,00,00 ; " .byte 10,10,31,10,31,10,10 ; # .byte 04,15,20,14,05,30,04 ; $ .byte 24,25,02,04,08,19,03 ; % .byte 12,18,06,07,18,19,12 ; & .byte 12,12,04,08,00,00,00 ; ' (quote) .byte 04,08,16,16,16,08,04 ; ( .byte 04,02,01,01,01,02,04 ; ) .byte 04,05,14,31,14,05,04 ; * .byte 04,04,04,31,04,04,04 ; + .byte 00,00,00,12,12,04,08 ; , (comma) .byte 00,00,00,31,00,00,00 ; - (minus) .byte 00,00,00,00,00,12,12 ; . .byte 00,01,02,04,08,16,00 ; / .byte 14,17,19,21,25,17,14 ; 0 .byte 04,12,04,04,04,04,14 ; 1 .byte 14,17,01,02,04,08,31 ; 2 .byte 14,17,01,02,01,17,14 ; 3 .byte 18,18,18,31,02,02,02 ; 4 .byte 31,16,28,02,01,17,14 ; 5 .byte 14,16,16,30,17,17,14 ; 6 .byte 30,01,01,02,04,08,16 ; 7 .byte 14,17,17,14,17,17,14 ; 8 .byte 14,17,17,15,01,01,14 ; 9 .byte 00,12,12,00,00,12,12 ; : .byte 12,12,00,12,12,04,08 ; ; .byte 02,04,08,16,08,04,02 ; < .byte 00,31,31,00,31,31,00 ; = .byte 08,04,02,01,02,04,08 ; > .byte 14,17,02,04,04,00,04 ; ? .byte 14,17,17,23,22,16,15 ; @ .byte 14,17,17,17,31,17,17 ; A .byte 30,17,17,30,17,17,30 ; B .byte 15,16,16,16,16,16,15 ; C .byte 30,17,17,17,17,17,30 ; D .byte 31,16,16,30,16,16,31 ; E .byte 31,16,16,30,16,16,16 ; F .byte 15,16,16,16,23,17,14 ; G .byte 17,17,17,31,17,17,17 ; H .byte 14,04,04,04,04,04,14 ; I .byte 01,01,01,01,17,17,14 ; J .byte 17,17,18,28,18,17,17 ; K .byte 16,16,16,16,16,16,31 ; L .byte 17,27,21,17,17,17,17 ; M .byte 17,17,25,21,19,17,17 ; N .byte 14,17,17,17,17,17,14 ; O .byte 30,17,17,30,16,16,16 ; P .byte 14,17,17,17,21,18,13 ; Q .byte 30,17,17,30,20,18,17 ; R .byte 15,16,16,14,01,01,30 ; S .byte 31,04,04,04,04,04,04 ; T .byte 17,17,17,17,17,17,14 ; U .byte 17,17,17,17,17,10,04 ; V .byte 17,17,17,17,21,27,17 ; W .byte 17,17,10,04,10,17,17 ; X .byte 17,17,10,04,04,04,04 ; Y .byte 31,01,02,04,08,16,31 ; Z .byte 30,16,16,16,16,16,30 ; [ .byte 00,16,08,04,02,01,00 ; \ .byte 15,01,01,01,01,01,15 ; ] .byte 04,10,17,00,00,00,00 ; ^ .byte 00,00,00,00,00,00,31 ; _ (underscore) .byte 12,12,08,04,00,00,00 ; ` (accent) .byte 14,17,17,17,31,17,17 ; a .byte 30,17,17,30,17,17,30 ; b .byte 15,16,16,16,16,16,15 ; c .byte 30,17,17,17,17,17,30 ; d .byte 31,16,16,30,16,16,31 ; e .byte 31,16,16,30,16,16,16 ; f .byte 15,16,16,16,23,17,14 ; g .byte 17,17,17,31,17,17,17 ; h .byte 14,04,04,04,04,04,14 ; i .byte 01,01,01,01,17,17,14 ; j .byte 17,17,18,28,18,17,17 ; k .byte 16,16,16,16,16,16,31 ; l .byte 17,27,21,17,17,17,17 ; m .byte 17,17,25,21,19,17,17 ; n .byte 14,17,17,17,17,17,14 ; o .byte 30,17,17,30,16,16,16 ; p .byte 14,17,17,17,21,18,13 ; q .byte 30,17,17,30,20,18,17 ; r .byte 15,16,16,14,01,01,30 ; s .byte 31,04,04,04,04,04,04 ; t .byte 17,17,17,17,17,17,14 ; u .byte 17,17,17,17,17,10,04 ; v .byte 17,17,17,17,21,27,17 ; w .byte 17,17,10,04,10,17,17 ; x .byte 17,17,10,04,04,04,04 ; y .byte 31,01,02,04,08,16,31 ; z .byte 06,08,08,16,08,08,06 ; { .byte 04,04,04,04,04,04,04 ; | .byte 12,02,02,01,02,02,12 ; } .byte 00,00,09,21,18,00,00 ; ~ begin movq @make_banner.text(ap),r6 ; r6=text length, r7=address if eql then clrl r11 goto exit end movq @make_banner.buffer(ap),r8 ; r8=buffer length, r9=address ; r11 = (((5 * width) + spacing) * length) + spaces - spacing mull3 #5,@make_banner.width(ap),r11 ; 5 * width addl @make_banner.spacing(ap),r11 ; + spacing mull r6,r11 ; * length addl @make_banner.spaces(ap),r11 ; + spaces subl @make_banner.spacing(ap),r11 ; - spacing ; compute line number divl3 @make_banner.height(ap),@make_banner.lineno(ap),r10 ; fill leading spaces with blanks movl @make_banner.spaces(ap),r2 ; leading spaces if neq then movzbl #^a/ /,r1 ; r1=blank character for r2 to=#1 by=#-1 do movb r1,(r9)+ ; move blank to buffer end end ; repeat for each character in string for r6 to=#0 by=#-1 type=W do ; get character from string and verify character is in list of ; symbols; otherwise, if not, use blank as character movzbl (r7)+,r3 ; r3=character in string locc r3,#symbols_length,symbols if neq then ; if found subl3 r0,#symbols_length,r2 incl r2 ; compute position in table else clrl r2 ; use blank position end ; find character in symbol table and ; adjust for current line number mull #7,r2 ; adjust character position movab symbols_table[r2],r4 ; to address in symbol table addl r10,r4 ; and adjust for line number ; repeat 5 times for each bit in table for r5 from=#4 to=#0 by=#-1 do ; get font character if bit is set ; or use blank if bit is not set if then ; if bit is set movzbl @make_banner.font(ap),r1 if eql then movl r3,r1 end else movzbl #^a/ /,r1 end ; form part of block character for r2 from=#1 to=@make_banner.width(ap) do movb r1,(r9)+; move character/blank to buffer end end ; adjust for spacing between characters movl @make_banner.spacing(ap),r2 if neq then movzbl #^a/ /,r1 ; r1=blank character for r2 to=#1 by=#-1 do movb r1,(r9)+; move character to buffer end end end end ; return resultant length exit: movw r11,@make_banner.length(ap) ; return length of make_banner movzbl #ss$_normal,r0 ; r0=always return ss$_normal return ; return .end