home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C128CPM / GRC128.ZIP / SXE.MAC < prev   
Encoding:
Text File  |  1991-06-15  |  3.6 KB  |  450 lines

  1. .z80
  2.  
  3. external GrFOn,GrSOn,GrFOff,SetPix,EraPix,ClrGr;
  4.  
  5. external GrOn,GrOff
  6.  
  7. external SaveWi,LoadWi
  8.  
  9. external SaveFW,LoadFW,GFtext,scrdump;
  10.  
  11. serial:    db 0,0,0,0,0,0
  12.  
  13. start: jp ftest        ;my start
  14.  
  15. next: db 0c3h            ;jump instruction
  16.  
  17.       dw 0            ;filled by loader
  18.  
  19. prev: dw 0            ;prev. module
  20.  
  21. remove: db 00h            ;00h means not remove         
  22.  
  23. nonbank: db 0            ;
  24.  
  25. name:   'RSXINTER'        ;
  26.  
  27. loader:    db 0            ;for
  28.  
  29.         db 0,0            ;loader
  30.  
  31. ftest:    ld (rbc),bc
  32.  
  33.     push af
  34.  
  35.     pop bc
  36.  
  37.     ld (raf),bc
  38.  
  39.     pop bc            ;ret addr
  40.  
  41.     ld (ret),bc
  42.  
  43.     ld a,00h
  44.  
  45.     ld bc,(first)
  46.  
  47.     cp c
  48.  
  49.     call z,stinit
  50.  
  51.     ld (rhl),hl
  52.  
  53.     ld hl,00h
  54.  
  55.     add hl,sp
  56.  
  57.     ld (userstp),hl
  58.  
  59.     ld hl,(parmstp)
  60.  
  61.     ld sp,hl
  62.  
  63.     ld hl,(ret)
  64.  
  65.     push hl
  66.  
  67.     ld hl,(raf)
  68.  
  69.     push hl
  70.  
  71.     ld hl,(rbc)
  72.  
  73.     push hl
  74.  
  75.     ld hl,00h
  76.  
  77.     add hl,sp
  78.  
  79.     ld (parmstp),hl
  80.  
  81.     ld hl,(userstp)
  82.  
  83.     ld sp,hl
  84.  
  85.     ld hl,(rhl)
  86.  
  87.     ld bc,(raf)
  88.  
  89.     push bc
  90.  
  91.     pop af
  92.  
  93.     ld bc,(rbc)    
  94.  
  95.     ld a,c
  96.  
  97.     push af
  98.  
  99.     pop bc
  100.  
  101.     ld (wert),bc
  102.  
  103.     cp 153d
  104.  
  105.     jp z,XGrFOn
  106.  
  107.     ld bc,(wert)
  108.  
  109.     push bc
  110.     
  111.     pop af
  112.  
  113.     cp 154d                ;
  114.  
  115.     jp z,XGrSOn            ;
  116.  
  117.  
  118.     ld bc,(wert)
  119.  
  120.     push bc
  121.     
  122.     pop af
  123.     
  124.     cp 155d                ;
  125.  
  126.     jp z,XGrFOff            ;
  127.  
  128.  
  129.     ld bc,(wert)
  130.  
  131.     push bc
  132.     
  133.     pop af
  134.  
  135.     cp 156d
  136.  
  137.         jp z,XSetPix
  138.  
  139.     ld bc,(wert)
  140.  
  141.     push bc
  142.     
  143.     pop af
  144.  
  145.         cp 157d
  146.  
  147.     jp z,XEraPix
  148.  
  149.     ld bc,(wert)
  150.  
  151.     push bc
  152.     
  153.     pop af
  154.  
  155.         cp 158d
  156.  
  157.     jp z,XClrGr
  158.  
  159.     ld bc,(wert)
  160.  
  161.     push bc
  162.     
  163.     pop af
  164.  
  165.     cp 159d
  166.  
  167.     jp z,XSaveWi
  168.  
  169.  
  170.     ld bc,(wert)
  171.  
  172.     push bc
  173.     
  174.     pop af
  175.  
  176.     cp 160d
  177.  
  178.     jp z,XLoadWi
  179.  
  180.  
  181.     ld bc,(wert)
  182.  
  183.     push bc
  184.     
  185.     pop af
  186.  
  187.     cp 161d
  188.  
  189.     jp z,XSaveFW
  190.  
  191.     ld bc,(wert)
  192.  
  193.     push bc
  194.     
  195.     pop af
  196.  
  197.     cp 162d
  198.  
  199.     jp z,XLoadFW
  200.  
  201.     ld bc,(wert)
  202.  
  203.     push bc
  204.     
  205.     pop af
  206.  
  207.     cp 163d
  208.  
  209.     jp z,XGFtext
  210.  
  211.     ld bc,(wert)
  212.  
  213.     push bc
  214.     
  215.     pop af
  216.  
  217.     cp 164d
  218.  
  219.     jp z,Xscrdump
  220.  
  221.     ld bc,(wert)
  222.  
  223.     push bc
  224.     
  225.     pop af
  226.  
  227.     cp 165d
  228.  
  229.     jp z,XGrOn
  230.  
  231.     ld bc,(wert)
  232.  
  233.     push bc
  234.     
  235.     pop af
  236.  
  237.     cp 166d
  238.  
  239.     jp z,XGrOff
  240.  
  241.     jp bdoscall
  242.  
  243.  
  244. XGrFOn:    call GrFOn
  245.  
  246.     jp ende
  247.  
  248. XGrSOn:    call GrSOn
  249.  
  250.     jp ende
  251.  
  252. XGrFOff: call GrFOff
  253.     
  254.     jp ende
  255.  
  256. XSetPix:    call SetPix
  257.  
  258.         jp ende
  259.  
  260. XEraPix:    call EraPix
  261.  
  262.         jp ende
  263.  
  264. XClrGr:    call ClrGr
  265.  
  266.     jp ende
  267.  
  268. XSaveWi: call SaveWi
  269.  
  270.      jp ende
  271.  
  272. XLoadWi: call LoadWi
  273.  
  274.     jp ende
  275.  
  276. XSaveFW: call SaveFW
  277.  
  278.     jp ende
  279.  
  280. XLoadFW: call LoadFW
  281.  
  282.     jp ende
  283.  
  284. XGFtext: call GFtext
  285.  
  286.     jp ende
  287.  
  288. Xscrdump: call scrdump
  289.  
  290.     jp ende
  291.  
  292. XGrOn:  call GrOn
  293.  
  294.     jp ende
  295.  
  296. XGrOff: call GrOff
  297.  
  298.     jp ende
  299.  
  300. ende:    ld (rhl),hl
  301.  
  302.     ld hl,00h
  303.  
  304.     add hl,sp
  305.  
  306.     ld (userstp),hl
  307.  
  308.     ld hl,(parmstp)
  309.  
  310.     ld sp,hl
  311.  
  312.     pop hl
  313.  
  314.     ld (rbc),hl
  315.  
  316.     pop hl
  317.  
  318.     ld (raf),hl
  319.  
  320.     pop hl
  321.  
  322.     ld (ret),hl
  323.  
  324.     ld hl,00h
  325.  
  326.     add hl,sp
  327.  
  328.     ld (parmstp),hl
  329.  
  330.     ld hl,(userstp)
  331.  
  332.     ld sp,hl
  333.  
  334.     ld hl,(ret)
  335.  
  336.     push hl
  337.  
  338.     ld hl,(raf)
  339.  
  340.     push hl
  341.  
  342.     pop af
  343.  
  344.     ld hl,(rbc)
  345.  
  346.     push hl
  347.  
  348.     pop bc
  349.  
  350.     ld hl,(rhl)
  351.  
  352.     ret
  353.  
  354.     
  355.  
  356. bdoscall: ld bc,(raf)
  357.  
  358.       push bc
  359.  
  360.       pop af
  361.  
  362.      ld bc,(rbc)
  363.  
  364.      call next
  365.  
  366.      ld (rhl),hl
  367.  
  368.     ld hl,00h
  369.  
  370.     add hl,sp
  371.  
  372.      ld (userstp),hl
  373.  
  374.     ld hl,(parmstp)
  375.  
  376.     ld sp,hl
  377.  
  378.     pop hl
  379.  
  380.     ld (rbc),hl
  381.  
  382.     pop hl
  383.  
  384.     ld (raf),hl
  385.  
  386.     pop hl
  387.  
  388.     ld (ret),hl
  389.  
  390.     ld hl,00h
  391.  
  392.     add hl,sp
  393.  
  394.     ld (parmstp),hl
  395.  
  396.     ld hl,(userstp)
  397.  
  398.     ld sp,hl
  399.  
  400.     ld hl,(ret)
  401.  
  402.     push hl
  403.  
  404.     ld hl,(rhl)
  405.  
  406.     ret
  407.  
  408.  
  409. userstp: ds 2
  410.  
  411. rhl: ds 2
  412.  
  413. wert: ds 2
  414.  
  415. ret: ds 2
  416.  
  417. rbc: ds 2
  418.  
  419. raf: ds 2
  420.  
  421. stinit:    ld (rhl),hl
  422.  
  423.     ld hl,firstsp
  424.  
  425.     ld (parmstp),hl
  426.  
  427.     ld hl,(rhl)
  428.  
  429.     push bc
  430.  
  431.     ld bc,0001h
  432.  
  433.     ld (first),bc
  434.  
  435.     pop bc
  436.  
  437.     ret
  438.  
  439. first:    ds 2,0000h
  440.  
  441. parmstp: ds 2
  442.  
  443. stack:    ds 100d
  444.  
  445. firstsp:
  446.  
  447.     end
  448.  
  449.  
  450.