home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1991
/
04
/
review
/
sievetop.a
< prev
next >
Wrap
Text File
|
1991-01-04
|
4KB
|
125 lines
module sievetop
extrn InOut$WriteString
extrn InOut$Read
extrn InOut$WriteLn
extrn InOut$Write
extrn InOut$WriteCard
extrn InOut$
extrn __initm
segment _BSS(BSS,00028H) (*segment length = 02002H*)
$0:
org 01FFFH
$1:
org 00001H
$2:
org 00002H
segment _CONST(DATA,00028H) (*segment length = 00023H*)
$3:
db 048H,069H,074H,020H,061H,020H,06BH,065H
db 079H,020H,074H,06FH,020H,073H,074H,061H
db 072H,074H,020H,032H,030H,030H,030H,020H
db 049H,054H,045H,052H,041H,054H,049H,04FH
db 04EH,053H,000H
segment _CONST(DATA,00028H) (*segment length = 00008H*)
public _main:
dd $4
dw InOut$
db 0FFH,0FFH
segment _DATA(DATA,00028H) (*segment length = 00009H*)
public __initx:
dd __initm
db 000H,040H,0FFH,0FFH,000H
segment STACK(STACK,00074H) (*segment length = 04000H*)
org 04000H
segment NEAR_STACK(BSS,00028H) (*segment length = 00001H*)
public __near_stack_start:
org 00001H
segment NEAR_HEAP(BSS,00028H) (*segment length = 0FFFFH*)
public __near_heap_start:
org 0FFFFH
segment SieveTopSpeed_TEXT(CODE,00048H) (*segment length = 00034H*)
$4:
(*0000 BB 00 00*) mov bx,$3
(*0003 8C D9*) mov cx,ds
(*0005 B8 23 00*) mov ax,23H
(*0008 9A 00 00 00 00*) call far InOut$WriteString
(*000D B8 FF 1F*) mov ax,$1
(*0010 8C DB*) mov bx,ds
(*0012 9A 00 00 00 00*) call far InOut$Read
(*0017 9A 00 00 00 00*) call far InOut$WriteLn
(*001C 9A 00 00 00 00*) call far $5
(*0021 B0 07*) mov al,7
(*0023 9A 00 00 00 00*) call far InOut$Write
(*0028 A1 00 20*) mov ax,[$2]
(*002B BB 05 00*) mov bx,5
(*002E 9A 00 00 00 00*) call far InOut$WriteCard
(*0033 CB*) ret far 0
segment SieveTopSpeed_TEXT(CODE,00048H) (*segment length = 0005FH*)
$5:
(*0000 57*) push di
(*0001 56*) push si
(*0002 52*) push dx
(*0003 51*) push cx
(*0004 53*) push bx
(*0005 50*) push ax
(*0006 BB 01 00*) mov bx,1
(*0009 33 D2*) xor dx,dx
(*000B EB 1C*) jmp $9
(*000D 90*) nop
$6:
(*000E C6 84 00 00 00*) mov byte [si][$0],0
(*0013 03 F0*) add si,ax
$7:
(*0015 3B F1*) cmp si,cx
(*0017 76 F5*) jbe $6
(*0019 FF 06 00 20*) inc word [$2]
$8:
(*001D 47*) inc di
(*001E 3B F9*) cmp di,cx
(*0020 76 22*) jbe $10
(*0022 43*) inc bx
(*0023 81 FB D0 07*) cmp bx,7D0H
(*0027 77 2F*) ja $11
$9:
(*0029 89 16 00 20*) mov [$2],dx
(*002D B0 01*) mov al,1
(*002F BF 00 00*) mov di,$0
(*0032 1E*) push ds
(*0033 07*) pop es
(*0034 AA*) stosb
(*0035 8A E0*) mov ah,al
(*0037 B9 FF 0F*) mov cx,0FFFH
(*003A F3 AB*) rep ;stosw
(*003C B8 FF 1F*) mov ax,1FFFH
(*003F 8B FA*) mov di,dx
(*0041 B9 FE 1F*) mov cx,1FFEH
$10:
(*0044 80 BD 00 00 00*) cmp byte [di][$0],0
(*0049 74 D2*) je $8
(*004B 8B C7*) mov ax,di
(*004D 03 C7*) add ax,di
(*004F 05 03 00*) add ax,3
(*0052 8B F7*) mov si,di
(*0054 03 F0*) add si,ax
(*0056 EB BD*) jmp $7
$11:
(*0058 58*) pop ax
(*0059 5B*) pop bx
(*005A 59*) pop cx
(*005B 5A*) pop dx
(*005C 5E*) pop si
(*005D 5F*) pop di
(*005E CB*) ret far 0
end