[ea71db]: elks / arch / i86 / lib / lcmpb.s Maximize Restore History

Download this file

lcmpb.s    28 lines (21 with data), 459 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! lcmpb.s
! lcmpb, lcmpub don't preserve ax
.globl lcmpb
.globl lcmpub
.text
.even
lcmpb:
lcmpub:
sub ax,(di) ! don't need to preserve ax
jne LCMP_EXIT
cmp bx,2(di)
jb LCMP_B_AND_LT ! b (below) becomes lt (less than) as well
jge LCMP_EXIT ! ge and already ae
! else make gt as well as a (above)
inc ax ! clear ov and mi, set ne for greater than
LCMP_EXIT:
ret
.even
LCMP_B_AND_LT:
dec ax ! clear ov, set mi and ne for less than
ret