home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / iopltest.zip / iopl.asm next >
Assembly Source File  |  1995-05-19  |  1KB  |  51 lines

  1. .386
  2. R2SEG SEGMENT BYTE PUBLIC USE16 'CODE'
  3.       ASSUME  CS:R2SEG, DS:NOTHING
  4.  
  5. PUBLIC _16_TEST
  6. _16_TEST  PROC  FAR
  7. ;
  8. ; clear the interrupt flag, so no further interrupts will be accepted
  9. ;
  10.   cli
  11. ;
  12. ; save bp and fetch the pointer to the array from the stack
  13. ;
  14.   push bp
  15.   mov bp,sp
  16.   mov es,[bp+8]
  17.   mov bp,[bp+6]
  18.  
  19.   mov eax,0
  20.   mov edx,1048577       ; write 1048577 integers
  21. loop1:
  22.   mov es:[bp],ax        ; write the integer
  23.  
  24.  
  25.   mov cx,100            ; 
  26. loop0:                  ; waste some time, so the users can watch the
  27.   dec cx                ; programm working
  28.   jnz loop0             ;
  29.  
  30.   inc bp                ; increment pointer to array twice (short int means
  31.   inc bp                ;   two bytes)
  32.   jnz loop3             ; not yet end of segment?
  33.   push ax               ;   
  34.   mov ax,es             ;  otherwise take next segment
  35.   add ax,8              ;
  36.   mov es,ax             ;  Note: this relies on word alignment of the array
  37.   pop ax
  38. loop3:
  39.   inc ax                ; next integer that will be written
  40.   dec edx 
  41.   jnz loop1             ; not yet ready?
  42. end_test:
  43.   mov ax,es             ; return last segment
  44.   pop bp                
  45.   sti                   ; allow interrupts again
  46.   ret   4               ; clean up stack and return
  47. _16_TEST  ENDP
  48.  
  49. R2SEG   ENDS
  50.    END
  51.