home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / commodore-scene-files / Coverdisks / CDU / V4D02.D64 / runv1.4.asm < prev    next >
Encoding:
Assembly Source File  |  2019-04-13  |  3.2 KB  |  111 lines

  1. e
  2. _*********************************************************
  3. _*                                                       *
  4. _*       module name : RUN.ASM                           *
  5. _*                                                       *
  6. _*                Maintenance log                        *
  7. _*                ---------------                        *
  8. _*                                                       *
  9. _*   date      time                     action           *
  10. _*   ----      ----                     ------           *
  11. _* 24/02/89    00:30               initial coding        *
  12. _* 28/03/89    22:35               update message no.    *
  13. _* 12/05/89    16:30    updated 0 - 1 prg running logic  *
  14. _* 19/05/89    20:20    major update to the execution    *
  15. _*                      of the first program             *
  16. _* 18/06/89    19:00    place info straight on stack     *
  17. _* 05/07/89    22:00    page 0 and 1 now in any ram blk  *
  18. _*********************************************************
  19.  
  20.  
  21. _*********************************************************
  22. _*                                                       *
  23. _*       routine : RUN - starts a program executing      *
  24. _*                                                       *
  25. _*   entry                                               *
  26. _*   -----                                               *
  27. _*   CHARBUFF - command buffer with command and name     *
  28. _*   Y        - pointer in character buffer              *
  29. _*.......................................................*
  30. _*   used                                                *
  31. _*   ----                                                *
  32. _*   A,Y                                                 *
  33. _*.......................................................*
  34. _*   exit                                                *
  35. _*   ----                                                *
  36. _*   none                                                *
  37. _*********************************************************
  38.  
  39. run    equ *
  40.     £ readname        _ get name of program
  41.     £ locname        _ locate name in table
  42.     ä runit        _ if found, run it
  43.  
  44. _ program not found, display message
  45.  
  46.     ¥ #2
  47.     ¢ dispmess    
  48.  
  49. runit    equ *
  50.     ƒ #flag
  51.     ¥ #prgrun        _ set program to running in table
  52.     » [tabpntr],y
  53.  
  54. _ special entry from the loader routine
  55.  
  56. loadrun    equ *        _ loader has already set the flag
  57.     ÿ progrun
  58.     ¥ progrun
  59.     æ #1
  60.     à specprog
  61.     ¢ notspec
  62.  
  63. _ We have one program running, so this is the program we return to.
  64.  
  65. specprog    equ *
  66.     ¥ tabpntr
  67.     » current
  68.     ¥ tabpntr+1
  69.     » current+1     _ set this program to the current on
  70. _
  71. _ The Program interrupted was the looping program which runs with the system
  72. _ stack.  
  73. _
  74.  
  75. _
  76. _ Put new information on the saved stack information, so as to simulate  
  77. _ the program we want to run had been interrupted                        
  78. _
  79.  
  80. runcurr    equ *
  81.     ƒ #oneram            _ point to prg's stack
  82.     ¥ [current],y
  83.     » savep1h            _ changed the saved address of
  84.     ƒ #oneoff            _ interrupted stack address
  85.     ¥ [current],y
  86.     » savep1l
  87.     ƒ #regsp
  88.     ¥ [tabpntr],y
  89.     » savestk
  90.     
  91.     
  92. _ set page 0 for NMI return routine. Note that Page 1 has already been set
  93. _ By the loader when the program is first loaded.
  94. _
  95.  
  96.  
  97.     ƒ #zeroram
  98.     ¥ [current],y
  99.     » savep0h
  100.     ƒ #zerooff
  101.     ¥ [current],y
  102.     » savep0l
  103.  
  104.  
  105. notspec    equ *
  106.     ¬
  107.  
  108.     IEND
  109.  
  110.