***** Extended consoleout via PC-AT BIOS for TBC *****
*** Compile with /#s option for normal line feed and scroll ***
*** Initialized at beginning of program ***

    Integer linenumy,txcolor 7
    /Byte &b8
    /Word @extcons
    /Byte &2e,&a3
#e  /Word &54
#c  /Word &154

SubRoutine extcons
    /Byte &8a,&c2,&3c,&d,&74,@30
    /Byte &3c,8,&74,@30
    /Byte &3c,&a,&74,@20
    /Byte &52,&8b,&e,2,0,&b,&c9,&75,@10
    /Byte &51,&b4,3,&b7,0,&cd,&10,&8a,&c6
    Value = linenumy: /Byte &59
10  Value linenumy: /Byte &8a,&f0,&8a,&d1
    /Byte &b4,2,&b7,0,&cd,&10,&b9,1,0
    Value txcolor: /Byte &93
    /Byte &58,&b4,9,&cd,&10
    /Byte &3c,&20,&72,@15,&c3
15  /Byte &ff,&06,2,0,&c3

20
#s  /Byte &06,&31,&c0,&8e,&e0,&bb,&84,4,&26,&8a,&37
#s  Value linenumy: /Byte &38,&f0,&72,@25
#s  /Byte &26,&8a,&57,&c6,&4a,&07,&b7,0,&33,&c9
#s  /Byte &b8,1,6,&cd,&10
    /Byte &c3

#s 25  /Byte &07,&8a,&c2
30  /Byte &cd,&29,&c3
SubEnd

SubRoutine txcls
    /Byte &06,&31,&c0,&8e,&c0,&bb,&84,4
    /Byte &26,&8a,&57,&c6,&4a
    /Byte &26,&8a,&37,&07
    /Byte &a3,2,0,&b4,6,&b7,7,&33,&c9
    /Byte &cd,&10,&33,&d2
    /Byte &eb,@locat1
SubEnd

SubRoutine locate(x,y)
    Integer x,y
    Value y
    Value = linenumy
@locat0  /Byte &8b,&56,2,&89,&16,2,0,&8a,&f0
@locat1  /Byte &b7,0,&b4,2,&cd,&10,&c3
SubEnd

SubRoutine locate_x(x)
    Integer x
    Value linenumy
    /Byte &eb,@locat0
SubEnd

SubRoutine cursor(x)
    Integer x
    If x=0 Then /Byte &b8,0,&20,&eb,@10
    If !=1 Then Value &607
10  /Byte &91,&b7,0,&b4,1,&cd,&10,&c3
SubEnd

End
