home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / smalltal / 2832 < prev    next >
Encoding:
Text File  |  1993-01-28  |  2.2 KB  |  59 lines

  1. Newsgroups: comp.lang.smalltalk
  2. Path: sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!gatech!swrinde!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!ticipa!ticipa.pac.sc.ti.com!tomb
  3. From: tomb@ticipa.pac.sc.ti.com (Thomas Burns)
  4. Subject: Re: HELP! 2 question...
  5. In-Reply-To: sokol@mem.kharkov.ua's message of Tue, 26 Jan 93 08: 51:06 +0200
  6. Message-ID: <TOMB.93Jan27085056@ticipa.pac.sc.ti.com>
  7. Sender: usenet@ticipa.pac.sc.ti.com (USENET News System)
  8. Organization: Texas Instruments Manufacturing Technology Center
  9. References: <AAQzDPheA3@mem.kharkov.ua>
  10. Date: Wed, 27 Jan 1993 14:50:56 GMT
  11. Lines: 46
  12.  
  13. In article <AAQzDPheA3@mem.kharkov.ua> sokol@mem.kharkov.ua (Sokolinski Dmitry I) writes:
  14.  
  15. > Dear collegues !
  16. >  1. Does anyone know how to invoke user primitive in
  17. >     Smalltalk V286 in real mode ?
  18.  
  19. Assuming that the primitive module header is defined as follows:
  20.  
  21.     PRIM_MODULE_HEADER STRUC
  22.     installEntry      DW ?   ; 0  entry point for installation routine
  23.     reserved1         DW 0   ; 2
  24.                       DW 0   ; 4
  25.     realCodeSeg       DW ?   ; 6  after loading, will contain real mode addr
  26.     primTableOffset   DW ?   ; 8  offset of table of primitive subroutines
  27.     realParmSeg       DW ?   ; A  after loading, will contain real mode addr
  28.                              ;    of virtual machine communication area.
  29.     reserved2         DW 0   ; C
  30.                       DW 0   ; E
  31.     PRIM_MODULE_HEADER ENDS
  32.  
  33. The following code, when called from within a user primitive, will
  34. execute code in real mode:
  35.  
  36.     mov cx, ds:[realCodeSeg]
  37.     mov dx, <near address of function>
  38.     mov ah, 1
  39.     int 50h
  40.  
  41. To properly access your data, the first few lines of your real mode
  42. function will need to do something like:
  43.  
  44.     push cs
  45.     pop ds
  46.  
  47. to set up the data segment.  Note that generally all registers (except
  48. AX, I believe) are trashed by the interrupt.  To save data, define
  49. some storage in the data segment for information passing between real
  50. and protected mode.
  51.  
  52. tom
  53.  
  54. --
  55. Tom Burns                       Domain:    tomb@spdc.ti.com
  56. Texas Instruments               TI MSG:    THOS
  57. P.O. Box 655012, M/S 463        Voice:     (214) 995-9707
  58. Dallas, TX   75265              FAX:       (214) 995-1916
  59.