Category : Miscellaneous Language Source Code
Archive   : FONTOBJS.ZIP
Filename : MAKEOBJ.BAS

 
Output of file : MAKEOBJ.BAS contained in archive : FONTOBJS.ZIP
$compile exe
$lib graph-,com-,lpt-,iprint+
$STRING 8
' This program will convert 8x16 bit mapped font files to linkable ASM
' files with a subroutine bearing the same name as the original font file.
' if TASM or MASM exists in the current directory, this program will also
' shell to it and create the OBJ which you can link. Command line or
' prompted file can contain wildcards to create OBJs from an entire
' directory of font files.


if command$="" then input "Enter font filename: ",F$ else F$=Command$
if f$="" then end
f$=dir$(f$)
if f$="" then print "File does not exist.":end
dim f$(500)
x=1
f$(1)=f$
do
incr x
f$(x)=dir$
loop while len(f$(x))

for y=1 to x-1
call makeasm(f$(y))


next y

end

sub makeasm(f$)
open f$ for binary as #1
get$ 1, lof(1), a$
close #1
if instr(f$,".")=0 then f$=f$+"."
p$=left$(f$,instr(f$,".")-1)
F2$=p$ + ".ASM"

open f2$ for output as #1

PRINT #1, p$ + "SEG" + chr$(9,9) + "segment byte public"
PRINT #1, " assume cs:"+p$+"SEG, ds:"+p$+"SEG"
PRINT #1, ""
PRINT #1, p$ + chr$(9,9) + "proc far"
PRINT #1, " public " + p$
PRINT #1, ""
PRINT #1, "start:"
PRINT #1, " push bp"
PRINT #1, " push es"
PRINT #1, " push cs"
PRINT #1, " pop es"
PRINT #1, " mov ax, word ptr font"
PRINT #1, " push ax"
PRINT #1, " pop bp"
PRINT #1, " ADD bp,31"
PRINT #1, " mov ax,1100h"
PRINT #1, " mov bh,16"
PRINT #1, " mov bl,0"
PRINT #1, " mov cx,0FFh"
PRINT #1, " mov dx,0"
PRINT #1, " int 10h"
PRINT #1, " pop es"
PRINT #1, " pop bp"
PRINT #1, " retf"
PRINT #1, ""
PRINT #1, "font";


for y=1 to len(a$) \ 16
b$=mid$(a$,(y*16)-15,16)
c$=" db "
for x=1 to 15
c$=c$+str$(ascii(mid$(b$,x,1))) + ","
next x
c$=c$+str$(ascii(right$(b$,1)))
print #1, c$;
IF y > 32 and y<255 THEN PRINT #1, " ; chr " + str$(y-1) + " - " + CHR$(y-1) else print #1, ""
next y

print #1, ""
print #1, p$ + chr$(9,9) + "endp"
print #1,""
print #1,p$ + "SEG" + chr$(9,9) + "ends"
print #1, ""
print #1," end"

close #1
PRINT "Created " + F2$ + " with proc " + p$

if len(dir$("TASM.EXE")) THEN SHELL "TASM " + F2$
if len(dir$("MASM.EXE")) THEN SHELL "MASM " + F2$

END SUB


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : FONTOBJS.ZIP
Filename : MAKEOBJ.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/