2 ; Piotr Fusik, 15.04.2002
3 ; originally by Ullrich von Bassewitz
5 ; Integer compare function - used by the compare operators
17 lda (sp),y ; Get low byte
23 lda (sp),y ; Get high byte
31 sbc sreg+1 ; Compare high byte
33 cpx sreg ; Compare low byte
35 adc #$FF ; If the C flag is set then clear the N flag
36 ora #$01 ; else set the N flag
40 eor #$FF ; Fix the N flag if overflow
41 ora #$01 ; Clear the Z flag