home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / CCDL151L.ZIP / MSDOS / 386 / TEST.ASM < prev   
Encoding:
Assembly Source File  |  1997-06-10  |  2.0 KB  |  126 lines

  1.         .386
  2.  
  3. _F_READ    = 1
  4. _F_WRIT = 2
  5. _F_LBUF = 8
  6.  
  7. public __argv_arr, __cmdline, __argc, _main, __pstreams, _maxfiles
  8. public __env_arr, _raise
  9.  
  10.  
  11. _TEXT        segment para public use32 'CODE'
  12. extrn __transferx:word, dos:proc, todta:proc, nametodta:proc
  13. extrn __ll_rename:proc, __ll_remove:proc
  14. extrn __ll_creat:proc, __ll_write:proc, __ll_close : proc, __ll_read:proc
  15. extrn __ll_open:proc, __ll_malloc:proc, __ll_free: proc, __ll_getenv : proc
  16. extrn __ll_spawn:proc
  17. _TEXT        ends
  18. _DATA       SEGMENT DWORD PUBLIC USE32 'DATA'
  19.                 ENDS
  20.  
  21. DGROUP group _TEXT, _DATA
  22.  
  23. _DATA       SEGMENT DWORD PUBLIC USE32 'DATA'
  24. __env_arr:    dd    0
  25. __pstreams    dd    100 DUP (?)
  26. _maxfiles    dd    0
  27. argvs        dd    ?
  28. __argv_arr    dd    DGROUP:argvs
  29. __cmdline    dd    ?
  30. __argc        dd    ?
  31. fd    dd    ?
  32. name1    db    'a.asm',0
  33. raisemsg db    'raiseing',10,13,0
  34. buffer    db    2048 DUP ('x')
  35. crlf    db    10,13,0
  36. msg1    db '\tools\bin\cl386.exe',0
  37. msg2    db    0
  38.  
  39.         ends
  40. _TEXT        segment
  41.         assume cs:DGROUP,ds:DGROUP
  42. _main:
  43.         mov al,ds:[-10]
  44.         push offset DGROUP:msg2
  45.         push offset DGROUP:msg1
  46. ;        call __ll_spawn
  47.         pop ecx
  48.         pop ecx
  49. ;        ret
  50.         mov    edx,[argvs]
  51.         call    message32
  52.         mov    edx,[__cmdline]
  53.         call    message32
  54.         push    0
  55.         push    0
  56.         call    __ll_getenv
  57.         add    esp,8
  58.         mov     ebx,eax
  59.         mov     eax,1
  60. @@lp:
  61.         pushad
  62.         push    eax
  63.         push offset DGROUP:buffer
  64.         call    __ll_getenv
  65.         add esp,8
  66.         
  67.         mov edx,offset DGROUP:buffer
  68.         call message32
  69.         mov edx,offset DGROUP:crlf
  70.         call message32
  71.         popad
  72.         inc    eax
  73.         cmp    eax,ebx
  74.         jbe    @@lp
  75.         jmp _main
  76.         ret
  77.  
  78. _raise:
  79.     mov edx,offset DGROUP:raisemsg
  80.     call message32
  81.     ret
  82. ;
  83. ; hexit
  84. ;
  85. hexit:
  86.     push eax
  87.     shr eax,16
  88.     call hexword
  89.     pop eax
  90. hexword:
  91.     push eax
  92.     shr eax,8
  93.     call hexbyte
  94.     pop eax
  95. hexbyte:
  96.     push eax
  97.     shr eax,4
  98.     call hexnib
  99.     pop eax
  100. hexnib:
  101.     and al,15
  102.     cmp al,10
  103.     jc okk
  104.     add al,7
  105. okk:
  106.     add al,'0'
  107.     mov dl,al
  108.     mov ah,2
  109.     int 21h
  110.     ret
  111. ;
  112. ; Put a message out on the console
  113. ;
  114. message32:
  115.     mov esi,edx
  116.     call nametodta
  117.     push es
  118.     mov es,[__transferx]
  119.     mov byte ptr es:[edi-1],'$'
  120.     pop es
  121.     mov ah,9
  122.     call dos
  123.     ret
  124. _TEXT        ends
  125.  
  126.                 END