home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
norge.freeshell.org (192.94.73.8)
/
192.94.73.8.tar
/
192.94.73.8
/
pub
/
computers
/
cpm
/
alphatronic
/
PASCALZ4.ZIP
/
D3
/
URELOP.SRC
< prev
Wrap
Text File
|
1999-04-05
|
1KB
|
67 lines
;UNSTRUCTURED RELATIVE OPERATORS
;
NAME URELOP
ENTRY .ILE,.ILT,.IGE,.IGT,.MTRUE,.FALSE,.MTRU1
;
;UNSTRUCTURED RELOPS
;HL<OP>DE
;
CMPINT: MACRO CARRY ;SUBTRACT DE FROM HL AFTER INITIALIZING CARRY
XRA A ;CLEAR ACCUMULATOR
IF CARRY
STC
ENDIF
DSBC D
ENDMAC
;GREATER THAN OR EQUAL TO
.IGE: MOV A,H ;TEST FOR LIKE SIGNS
XRA D
JM GDIFF ;NO!
CMPINT 0 ;COMPARE INTEGERS
CMC ;CARRY WAS CLEAR IF HL >= DE
RET
;LESS THAN OR EQUAL TO
.ILE: MOV A,H ;TEST FOR LIKE SIGNS
XRA D
JM LDIFF ;NO!
CMPINT 1 ;COMPARE INTEGERS
RET ;CARRY IS SET IF HL <= DE
;GREATER THAN
.IGT: MOV A,H ;TEST FOR LIKE SIGNS
XRA D
JM GDIFF ;NO!
CMPINT 1 ;COMPARE INTEGERS
CMC ;CARRY WAS CLEAR IF HL > DE
RET
;LESS THAN
.ILT: MOV A,H ;TEST FOR LIKE SIGNS
XRA D
JM LDIFF ;NO!
CMPINT 0 ;COMPARE INTEGERS
RET ;CARRY IS SET IF HL < DE
; SIGNS DIFFERENT ON A > OR >= TEST
GDIFF: MOV H,D ;REVERSE THE NEXT TEST
; SIGNS DIFFERENT ON A < OR <= TEST
LDIFF: XRA A ;CLEAR ACC
SLAR H ;SET CARRY IF HL < 0
RET
.MTRUE: XRA A ;CONDITION IS TRUE, CLEAR A, SET CARRY
STC
RET
.MTRU1 POP D
POP H
JR .MTRUE
.FALSE: XRA A ;CONDITION IS FALSE, CLEAR A, RESET CARRY
RET