home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
lib4a86
/
lib
/
strings1.lib
< prev
next >
Wrap
Text File
|
1992-02-02
|
3KB
|
275 lines
#IF !LIB4A86
#ELSE
#IF !INTERN_LIB4A86_S
INTERN_LIB4A86_S EQU 01
JMP START
#ENDIF
#ENDIF
#IF !REPMARKER
REPMARKER EQU 00H
#ENDIF
KOMPRIMIERESTRING:
PUSH SI,DI,CX,DX
CLD
LODSB
MOV DI,SI
MOV DX,SI
OR AL,AL
JZ >L9
DEC AL
JE >L9
INC AL
MOV CL,AL
XOR CH,CH
MOV AH,REPMARKER
L0:
JCXZ >L8
LODSB
CMP AL,AH
JNZ >L01
STC
JMP >L9
L01:
DEC CL
XOR BX,BX
JCXZ >L2
L1:
CMP [SI+BX],AL
JNE >L2
INC BL
DEC CL
JCXZ >L2
JMP L1
L2:
OR BL,BL
JZ >L3
ADD SI,BX
CMP BX,1
JNE >L21
STOSB
JMP >L3
L21:
INC BL
MOV [DI],AH
INC DI
MOV [DI],BL
INC DI
L3:
STOSB
JMP L0
L8:
MOV SI,DX
MOV CX,DI
SUB CX,SI
DEC SI
MOV [SI],CL
CLC
L9:
POP DX,CX,DI,SI
RET
DEKOMPRIMIERESTRING:
PUSH DX,CX,BX,SI,DI
CLD
XOR DX,DX
LODSB
OR AL,AL
JZ >L9
XOR AH,AH
MOV CX,AX
INC DI
L0:
MOV BX,CX
MOV CL,01
LODSB
CMP AL,REPMARKER
JNZ >L1
DEC BL
JZ >L8
LODSB
CMP AL,REPMARKER
JZ >L8
DEC BL
JZ >L8
MOV CL,AL
LODSB
L1:
ADD DL,CL
REP STOSB
MOV CX,BX
JCXZ >L9
LOOP L0
JMP >L9
L8:
XOR DL,DL
STC
L9:
POP DI
MOV [DI],DL
POP SI,BX,CX,DX
RET
#IF !NUMMERZ
NUMMERZ EQU '#'
#ENDIF
#IF !MAXKONVERT
MAXKONVERT EQU 32XD
#ENDIF
FORMATIEREASCIISTRING:
PUSH CX,SI,DI
CLD
INC DI
LODSB
MOV CL,AL
XOR CH,CH
L1:
OR CL,CL
JZ >L9
LODSB
DEC CL
CMP AL,NUMMERZ
JNE >L3
STOSB
INC CH
JC >L8
L3:
CMP AL,MAXKONVERT
JB >L2
STOSB
INC CH
JC >L8
JMP L1
L2:
MOV B ES:[DI],NUMMERZ
INC DI
ADD CH,4
JC >L8
JMP >L3
L8:
MOV CH,0
L9:
POP DI
MOV ES:[DI],CH
POP SI,CX
RET
L3:
XOR AH,AH
MOV BL,100XD
DIV BL
ADD AL,'0'
STOSB
MOV AL,AH
XOR AH,AH
MOV BL,10XD
DIV BL
ADD AL,'0'
STOSB
MOV AL,AH
ADD AL,'0'
STOSB
JMP L1
DEFORMATIEREASCIISTRING:
PUSH CX,SI,DI
CLD
INC DI
LODSB
MOV CL,AL
XOR CH,CH
L0:
OR CL,CL
JZ >L9
LODSB
DEC CL
OR CL,CL
JZ >L2
CMP AL,NUMMERZ
JNE >L2
CALL INTERN_GETBYTE1
JC >L1
JMP >L2
L1:
DEC SI
LODSB
STOSB
INC CH
LODSB
DEC CL
CMP AL,NUMMERZ
JE L0
L2:
INC CH
STOSB
JMP L0
L9:
POP DI
MOV [DI],CH
POP SI,CX
RET
INTERN_GETBYTE1:
XOR BH,BH
MOV BL,[SI]
SUB BL,'0'
CMP BL,0AH
JC >L1
RET
L1:
INC SI
DEC CL
XOR BH,BH
MOV AX,BX
INC BH
L1:
OR CL,CL
JZ >L9
CMP BH,3
JE >L9
MOV DX,AX
MOV BL,[SI]
SUB BL,'0'
CMP BL,0AH
JNC >L9
INC BH
PUSH BX
MOV BH,10XD
MUL BH
POP BX
ADD AL,BL
INC SI
DEC CL
OR AH,AH
JZ L1
MOV AX,DX
DEC SI
INC CL
L9:
CLC
RET
#IF !INTERN_CMARK0
INTERN_CMARK0 EQU 01H
INTERN_CMARK1:
PUSH BP
MOV BP,SP
MOV BX,06H
SUB CH,[BP+SI]
SUB AH,[BX+SI]
DEC SP
DEC CX
INC DX
XOR AL,041H
CMP B[02820H],DH
INC BX
SUB W[BX+SI],SP
INC DX
CS AND B[BP+DI+043H],DL
DEC AX
INC BP
DEC BP
DEC BP
INC BP
PUSH DX
AND B[BP+SI],CH
SUB CH,[BP+SI]
POP DX
MOV SP,BP
POP BP
RET
#ENDIF