home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / pascal / 7730 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.5 KB  |  51 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!email!ps1.iaee.tuwien.ac.at!sorokin
  3. From: sorokin@ps1.iaee.tuwien.ac.at (Zhenja)
  4. Subject: Extended register problem and 64k array
  5. Message-ID: <sorokin.34@ps1.iaee.tuwien.ac.at>
  6. Sender: news@email.tuwien.ac.at
  7. Nntp-Posting-Host: pc77.iaee.tuwien.ac.at
  8. Organization: Inst. for General Electrics & Electronics, TU Vienna
  9. Date: Wed, 30 Dec 1992 13:48:29 GMT
  10. Lines: 39
  11.  
  12. 1. Can I use the following trick to bypass extended register non-
  13. conservation problem by some interrupts (Novell, etc.)?
  14.   I write a separate assembler procedure of the sort
  15.  
  16. proc test386
  17.     enter 0,0
  18.     sti     ;mask interrupts
  19.  
  20.     ... operations with EAX,EBX,ECX, etc.
  21.  
  22.     cli     ;enable interrupts
  23.     leave
  24.     ret
  25. endp
  26.  
  27. and use it as external procedure in my TP program. 
  28.  
  29. What could be wrong with this?
  30.  
  31. 2. I need to have an EXACTLY 64k-long array (say, 8192 of doubles).
  32.  
  33. Type declaration will allow me to use only 8190 ($fff0 div 8) doubles.
  34. If I use MemAllocSeg function to allocate $FFFF bytes with Offset=0 and 
  35. switch off range checking then I can address the 8192nd double and it will 
  36. not jump over segment border. 
  37.  
  38. The question is: when I allocate $FFFF bytes, can it happen that the last 
  39. byte in this segment (i.e. seg(myarray):$FFFF) will then be assigned to 
  40. another variable (which will naturally crash the program)? 
  41. How can I prevent it?
  42. Is it enough to set switch "Word allign data" to ON?
  43.  
  44. Sincerely, 
  45. Sorokin Zhenya,
  46. Vienna, Austria.
  47. Sorokin Zhenya
  48. Vienna, Austria.
  49.  
  50.  
  51.