home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
GLEN
/
BBC.ZIP
/
BBC.LIB
< prev
next >
Wrap
Text File
|
1980-01-01
|
5KB
|
324 lines
1
PSTR: JCXZ PSTRF
MOV DL,[BX
INT 21H
INC BX
LOOP PSTR
PSTRF: RET
PLNE: MOV DL,13
INT 21H
MOV DL,10
INT 21H
RET
2
PNUM: MOV BX,OFFSET SAREA
MOV SAREA,32
PUSH AX
MOV AX,CX
CMP AX,8000H
JB PNUM1
NEG AX
MOV SAREA,'-'
PNUM1: MOV CX,10000
MOV DX,0
DIV CX
OR AL,AL
JZ PNUM2
INC BX
ADD AL,48
MOV [BX,AL
PNUM2: MOV AX,DX
MOV CX,1000
CWD
DIV CX
MOV CX,OFFSET SAREA
CMP BX,CX
JNZ PNUM3
OR AL,AL
JZ PNUM4
PNUM3: INC BX
ADD AL,48
MOV [BX],AL
PNUM4: MOV AX,DX
MOV CX,100
CWD
DIV CX
MOV CX,OFFSET SAREA
CMP BX,CX
JNZ PNUM5
OR AL,AL
JZ PNUM6
PNUM5: INC BX
ADD AL,48
MOV [BX],AL
PNUM6: MOV AX,DX
MOV CX,10
CWD
DIV CX
MOV CX,OFFSET SAREA
CMP BX,CX
JNZ PNUM7
OR AL,AL
JZ PNUM8
PNUM7: INC BX
ADD AL,48
MOV [BX],AL
PNUM8: ADD DL,48
INC BX
MOV [BX],DL
MOV CX,OFFSET SAREA
SUB CX,BX
NEG CX
INC CX
MOV BX,OFFSET SAREA
POP AX
CALL PSTR
RET
3
CLS: MOV BX,Z_ZATTR
MOV BH,BL
MOV CX,0
MOV DH,24
MOV DL,79
MOV AL,0
MOV AH,7
INT 10H
MOV DX,0
MOV AH,2
INT 10H
RET
4
5
6
7
8
9
10
11
12
13
14
GETNUM: MOV SAREA,10
MOV AH,0AH
MOV DX,OFFSET SAREA
INT 21H
MOV BX,OFFSET SAREA
MOV CX,[BX]
MOV CL,CH
MOV CH,0
INC BX
INC BX
CALL ASCBIN
PUSH AX
MOV AH,2
MOV DL,13
INT 21H
MOV DL,10
INT 21H
POP AX
RET
15
GETSTR: MOV AX,0
MOV [BX],AX
PUSH BX
INC BX
INC BX
MOV DI,[BX]
MOV CX,DI
GETS1: MOV AH,7
INT 21H
CMP AL,13
JZ GETSF
CMP AL,10
JZ GETSF
CMP AL,8
JNZ GETS2
CMP DI,CX
JBE GETS1
DEC DI
MOV DL,AL
MOV AH,2
INT 21H
MOV DL,32
INT 21H
MOV DL,8
INT 21H
JMP SHORT GETS1
GETS2: MOV [DI],AL
MOV DL,AL
MOV AH,2
INT 21H
INC DI
JMP SHORT GETS1
GETSF: SUB DI,CX
POP BX
MOV [BX],DI
MOV AH,2
MOV DL,13
INT 21H
MOV DL,10
INT 21H
RET
16
SC: MOV AX,[BX]
CMP AX,[CX]
JNZ SFALSE
MOV DX,AX
INC BX
INC BX
INC CX
INC CX
MOV SI,[BX]
MOV DI,[CX]
PUSH DS
POP ES
CLD
SC1: OR DX,DX
JZ STRUE
CMPSB
JNZ SFALSE
DEC DX
JMP SHORT SC1
STRUE: MOV AX,-1
RET
SFALSE: MOV AX,0
RET
17
SC5: MOV AX,[BX]
MOV DX,[CX]
INC BX
INC BX
INC CX
INC CX
MOV SI,[BX]
MOV DI,[CX]
PUSH DS
POP ES
MOV CX,AX
SC51: JCXZ SCAT5
OR DX,DX
JZ SCAF5
CMPSB
JG SCAF5
JB SCAT5
DEC CX
DEC DX
JMP SHORT SC51
SCAF5: MOV AX,0
RET
SCAT5: MOV AX,-1
RET
18
SC4: CALL SC
XOR AX,-1
RET
MOV AH,9
INT 21H
FCLOSG: RET
FCERR DB 'Error reported in closing file',0dh,0ah,'$'
30
31
ASCBIN: MOV AX,0
INC CX
DEC BX
MOV DX,0
PUSH DX
ASCL: DEC CX
INC BX
JCXZ ASCDON
MOV DL,[BX]
CMP DL,'-'
JZ ASCL2
CMP DL,'+'
JZ ASCL3
CMP DL,'0'
JB ASCL
CMP DL,'9'
JG ASCDON
JMP SHORT ASCL4
ASCL2: POP DX
MOV DX,-1
PUSH DX
INC BX
JMP SHORT ASCL4
ASCL3: INC BX
DEC CX
JCXZ ASCDON
ASCL4: MOV DL,[BX]
CMP DL,'0'
JB ASCL3
CMP DL,'9'
JA ASCDON
PUSH CX
PUSH DX
MOV CX,10
CWD
MUL CX
POP DX
POP CX
MOV DH,0
SUB DX,48
ADD AX,DX
JMP SHORT ASCL3
ASCDON: POP DX
OR DX,DX
JZ ASCFIN
NEG AX
ASCFIN: RET
32
STR: PUSH BX
INC BX
INC BX
MOV DX,[BX]
MOV BX,DX
MOV [BX],32
MOV CX,10000
CWD
IDIV CX
CMP AH,128
JB STR2
MOV [BX],'-'
STR2: INC BX
ADD AL,48
MOV [BX],AL
MOV AX,DX
AND AX,7FFFH
MOV CX,1000
CWD
DIV CX
ADD AL,48
MOV [BX],AL
INC BX
MOV AX,DX
MOV CX,100
CWD
DIV CX
ADD AL,48
MOV [BX],AL
INC BX
MOV AX,DX
MOV CX,10
CWD
DIV CX
ADD AL,48
MOV [BX],AL
INC BX
MOV [BX],DL
POP CX
MOV DX,CX
MOV AX,BX
MOV BX,CX
INC BX
INC BX
MOV CX,[BX]
SUB AX,CX
MOV BX,DX
MOV [BX],AX
RET
33
34