home *** CD-ROM | disk | FTP | other *** search
- .386
-
- _F_READ = 1
- _F_WRIT = 2
- _F_LBUF = 8
-
- public __argv_arr, __cmdline, __argc, _main, __pstreams, _maxfiles
- public __env_arr, _raise
-
-
- _TEXT segment para public use32 'CODE'
- extrn __transferx:word, dos:proc, todta:proc, nametodta:proc
- extrn __ll_rename:proc, __ll_remove:proc
- extrn __ll_creat:proc, __ll_write:proc, __ll_close : proc, __ll_read:proc
- extrn __ll_open:proc, __ll_malloc:proc, __ll_free: proc, __ll_getenv : proc
- extrn __ll_spawn:proc
- _TEXT ends
- _DATA SEGMENT DWORD PUBLIC USE32 'DATA'
- ENDS
-
- DGROUP group _TEXT, _DATA
-
- _DATA SEGMENT DWORD PUBLIC USE32 'DATA'
- __env_arr: dd 0
- __pstreams dd 100 DUP (?)
- _maxfiles dd 0
- argvs dd ?
- __argv_arr dd DGROUP:argvs
- __cmdline dd ?
- __argc dd ?
- fd dd ?
- name1 db 'a.asm',0
- raisemsg db 'raiseing',10,13,0
- buffer db 2048 DUP ('x')
- crlf db 10,13,0
- msg1 db '\tools\bin\cl386.exe',0
- msg2 db 0
-
- ends
- _TEXT segment
- assume cs:DGROUP,ds:DGROUP
- _main:
- mov al,ds:[-10]
- push offset DGROUP:msg2
- push offset DGROUP:msg1
- ; call __ll_spawn
- pop ecx
- pop ecx
- ; ret
- mov edx,[argvs]
- call message32
- mov edx,[__cmdline]
- call message32
- push 0
- push 0
- call __ll_getenv
- add esp,8
- mov ebx,eax
- mov eax,1
- @@lp:
- pushad
- push eax
- push offset DGROUP:buffer
- call __ll_getenv
- add esp,8
-
- mov edx,offset DGROUP:buffer
- call message32
- mov edx,offset DGROUP:crlf
- call message32
- popad
- inc eax
- cmp eax,ebx
- jbe @@lp
- jmp _main
- ret
-
- _raise:
- mov edx,offset DGROUP:raisemsg
- call message32
- ret
- ;
- ; hexit
- ;
- hexit:
- push eax
- shr eax,16
- call hexword
- pop eax
- hexword:
- push eax
- shr eax,8
- call hexbyte
- pop eax
- hexbyte:
- push eax
- shr eax,4
- call hexnib
- pop eax
- hexnib:
- and al,15
- cmp al,10
- jc okk
- add al,7
- okk:
- add al,'0'
- mov dl,al
- mov ah,2
- int 21h
- ret
- ;
- ; Put a message out on the console
- ;
- message32:
- mov esi,edx
- call nametodta
- push es
- mov es,[__transferx]
- mov byte ptr es:[edi-1],'$'
- pop es
- mov ah,9
- call dos
- ret
- _TEXT ends
-
- END