home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT23 / GPLMEMRY.TXT < prev    next >
Text File  |  2006-10-19  |  2KB  |  100 lines

  1. ?
  2. TI RoundTable
  3. Category 1,  Topic 19
  4. Message 1         Wed Mar 16, 1994
  5. J.WHITE28 [Jeff White]       at 23:50 EST
  6.  
  7. Here is something Geneve programmers might have fun trying.  The following
  8. test routine runs from GPL mode but calls MDOS XOP routines.  In particular,
  9. the test routine finds the total number of free pages in the system, the
  10. number of free pages that are fast memory, and the total number of system
  11. pages by calling MDOS memory management opcode 0.
  12.  
  13. Perhaps subsequent versions of MDOS and GPL will have a GPL hook into the MDOS
  14. XOP library.  This may be easier accomplished than you might think.  Making
  15. GPL an actual MDOS task rather than another environment could facilitate much
  16. smoother transitions between the two modes of operation.
  17.  
  18. Jeff White
  19.  
  20.         DEF  START
  21.  *
  22.  *  Test MDOS XOP's with a GPL program!
  23.  *
  24.  *  by Jeffrey H. White
  25.  *
  26.  *  Copyright 1994
  27.  *
  28.  MAPPER EQU  >F110     MDOS memory mapper location
  29.  GRMRA  EQU  >9802     GROM read
  30.  GRMWA  EQU  >9C02      and write addresses
  31.  GPLDOS EQU  >1EF4     GPL/MDOS mode select bit
  32.  *
  33.  *
  34.  SEVEN  DATA 7
  35.  ERROR  BSS  2
  36.  TOTFRE BSS  2
  37.  TOTZER BSS  2
  38.  TOTINS BSS  2
  39.  WS     BSS  32
  40.  GROM   BSS  2
  41.  PAGE0  BSS  1
  42.         EVEN
  43.  *
  44.  START  BLWP @TSTXOP
  45.         RT
  46.  *
  47.  TSTXOP DATA WS        WS location is limited by XOP called
  48.         DATA STTEST
  49.  *
  50.  * First save current GROM address
  51.  *
  52.  STTEST MOVB @GRMRA,@GROM
  53.         MOVB @GRMRA,@GROM+1
  54.         DEC  @GROM
  55.  *
  56.  * Swap into MDOS mode
  57.  *
  58.         LI   R12,GPLDOS
  59.         SBO  0
  60.  *
  61.  * Now save mapper register 0
  62.  *
  63.         LI   R0,MAPPER
  64.         MOVB *R0,@PAGE0
  65.  *
  66.  * Page in physical page 0
  67.  *
  68.         SB   *R0,*R0
  69.  *
  70.  * Now the XOP is tested
  71.  *
  72.         LI   R0,0          free pages, free fast pages, total pages
  73.         XOP  @SEVEN,0
  74.         MOV  R0,R0
  75.         JEQ  ITWORK
  76.         SETO @ERROR
  77.         JMP  RESTOR
  78.  ITWORK CLR  @ERROR
  79.         MOV  R1,@TOTFRE
  80.         MOV  R2,@TOTZER
  81.         MOV  R3,@TOTINS
  82.  *
  83.  * XOP tested, restore mapper register
  84.  *
  85.  RESTOR MOVB @PAGE0,@MAPPER
  86.  *
  87.  * Re-enter GPL mode and restore GROM address
  88.  *
  89.         SBZ  0
  90.         MOVB @GROM,@GRMWA
  91.         MOVB @GROM+1,@GRMWA
  92.         RTWP
  93.         END
  94.  ------------
  95.  
  96.  
  97. Download complete.  Turn off Capture File.
  98.  
  99.  
  100.