home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
lib4a86
/
lib
/
longint.lib
< prev
next >
Wrap
Text File
|
1992-02-06
|
2KB
|
227 lines
#IF !LIB4A86
#ELSE
#IF !INTERN_LIB4A86_S
INTERN_LIB4A86_S EQU 01
JMP START
#ENDIF
#ENDIF
#IF !INTERN_CHANGESIGN
INTERN_CHANGESIGN MACRO
NOT #1
NOT #2
ADD #2,01
ADC #1,0
#EM
#ENDIF
ABSDXAX:
OR DH,DH
JS CHANGESIGNDXAX
RET
ABSCXBX:
OR CH,CH
JS CHANGESIGNCXBX
RET
CHANGESIGNCXBX:
INTERN_CHANGESIGN CX,BX
RET
CHANGESIGNDXAX:
INTERN_CHANGESIGN DX,AX
RET
CALCLONGINTPOTENZ:
PUSH BX
OR BX,CX
POP BX
JNZ >L1
XOR DX,DX
XOR AX,AX
INC AX
RET
L1:
PUSH SI
PUSH DI
PUSH BP
MOV BP,01H
MOV SI,DX
MOV DI,AX
OR CX,CX
STC
JS >L9
L0:
SUB BX,BP
SBB CX,0
OR BX,BX
JNE >L01
OR CX,CX
JE >L9
L01:
PUSH BX
PUSH CX
MOV BX,DI
MOV CX,SI
CALL MULLONGINT
POP CX
POP BX
JMP L0
L9:
POP BP
POP DI
POP SI
RET
CMPLONGINT:
CMP DX,CX
JNE >L1
CMP AX,BX
L1:
RET
ADDLONGINT:
ADD AX,BX
ADC DX,CX
RET
SUBLONGINT:
SUB AX,BX
SBB DX,CX
RET
MODLONGINT:
PUSH CX,BX
CALL DIVLONGINT
JC >L1
MOV DX,CX
MOV AX,BX
L1:
POP BX,CX
RET
#IF !INTERN_MULLONGINT_S
INTERN_MULLONGINT_S EQU 01
MULLONGINT:
PUSH DI
PUSH SI
PUSH BP
MOV BP,SP
XOR SI,SI
OR CX,CX
JNS >L1
INTERN_CHANGESIGN CX,BX
INC SI
L1:
OR DX,DX
JNS >L1
INTERN_CHANGESIGN DX,AX
INC SI
L1:
PUSH SI
XOR DI,DI
XOR SI,SI
PUSH AX
PUSH DX
ADD AX,DX
MUL CX
MOV DI,AX
POP AX
MUL BX
ADD DI,AX
POP AX
MUL BX
ADD DX,DI
ADD AX,SI
L90:
POP SI
DEC SI
JNZ >L9
INTERN_CHANGESIGN DX,AX
L9:
MOV SP,BP
POP BP
POP SI
POP DI
RET
#ENDIF
#IF !INTERN_DIVLONGINT_S
INTERN_DIVLONGINT_S EQU 01
DIVLONGINT:
PUSH SI,DI,BP
PUSH BX
OR BX,CX
POP BX
STC
JZ >L9
XOR SI,SI
OR DX,DX
JNS >L1
INTERN_CHANGESIGN DX,AX
INC SI
L1:
OR CX,CX
JNS >L1
INTERN_CHANGESIGN CX,BX
INC SI
INC SI
L1:
PUSH SI
MOV DI,BX
MOV SI,CX
XOR BX,BX
XOR CX,CX
MOV BP,0021H
L0:
RCL BX,1
RCL CX,1
SUB BX,DI
SBB CX,SI
JNB >L1
ADD BX,DI
ADC CX,SI
L1:
CMC
RCL AX,1
RCL DX,1
DEC BP
JNZ L0
POP SI
OR SI,SI
JE >L90
CMP SI,3
JNE >L1
L0:
INTERN_CHANGESIGN CX,BX
JMP >L90
L1:
INTERN_CHANGESIGN DX,AX
CMP SI,1
JE L0
L90:
CLC
L9:
POP BP,DI,SI
RET
#ENDIF
#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