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

  1.  
  2.  
  3. .z80
  4.  
  5. public texta,offsa,paddre;
  6.  
  7. ListOutput equ 05h
  8.  
  9. external mode
  10.  
  11. bdos equ 0005h
  12.  
  13. external sb1x1,sb1x2,sb1x3,sb1x4,sb1x5,sb1x6,sb1x7,sb1x8
  14.  
  15. public SaveWi,LoadWi
  16.  
  17. external memstart,prep,SWvxy,LWvxy;
  18.  
  19. external linv,lover
  20.  
  21. external xinv,xover
  22.  
  23. external mydma
  24.  
  25. external olddma,scbpb
  26.  
  27. external PFIlett;
  28.  
  29. external flip,flop,skox,skoy,ekox,ekoy;
  30.  
  31. public GFtext;
  32.  
  33. external mfdm,pfrep,SWFxy,cfdm,ofdm,LWFxy,zeil0a;
  34.  
  35. public injn
  36.  
  37. external prbitm,crtab,convta,prtab,nextli;
  38.  
  39. public SaveFW,LoadFW,scrdump;
  40.  
  41. texta: ds 2
  42.  
  43. offsa: ds 2
  44.  
  45. paddre: ds 2
  46.  
  47. rhl:    ds 2
  48.  
  49. ret:    ds 2
  50.  
  51.  
  52.  
  53. SaveWi:
  54.  
  55.     ld (rde),de
  56.     ld (rhl),hl
  57.     pop hl
  58.     ld (ret),hl
  59.     ld h,d
  60.     ld l,e
  61.     ld e,(hl)
  62.     inc hl
  63.     ld d,(hl)
  64.     ld (skox),de
  65.     inc hl
  66.     ld e,(hl)
  67.     inc hl
  68.     ld d,(hl)
  69.     ld (skoy),de
  70.     inc hl
  71.     ld e,(hl)
  72.     inc hl
  73.     ld d,(hl)
  74.     ld (ekox),de
  75.     inc hl
  76.     ld e,(hl)
  77.     inc hl
  78.     ld d,(hl)
  79.     ld (ekoy),de
  80.     inc hl
  81.     ld e,(hl)
  82.     inc hl
  83.     ld d,(hl)
  84.     ld (memstart),de
  85.     ld de,(rde)
  86.     ld hl,(rhl)
  87.  
  88.  
  89.  
  90.  
  91.     push bc
  92.     push de
  93.     push hl
  94.     push ix
  95.     push iy
  96.     push af
  97.     call prep
  98.     ld bc,(skoy)
  99.     ld (flop),bc
  100.     ld b,c
  101.     ld de,(ekoy)
  102.     ld c,e
  103.     jp test1
  104. schl1:    ld de,(skox)        ;flip -> de
  105.     ld (flip),de
  106.     ld hl,(ekox)        ;ekox -> hl
  107.     jp test2
  108. schl2:    ld hl,(ekox)
  109.     call SWvxy
  110.     ld iy,08d
  111.     add iy,de
  112.     ld (flip),iy        ;flip udaten
  113.     push iy
  114.     pop de
  115. test2:  ld a,h
  116.     cp d
  117.     jp m,weit
  118.     jp nz,schl2
  119.     ld a,l
  120.     cp e
  121.     jp m,weit
  122.     jp schl2
  123. weit:    inc b
  124.     ld ix,(flop)
  125.     inc ix 
  126.     ld (flop),ix        ;und zurueckspeichern
  127. test1:  ld a,c
  128.     cp b
  129.     jp m,wt1
  130.     jp schl1
  131. wt1:    pop af
  132.     pop iy
  133.     pop ix
  134.     pop hl
  135.     pop de
  136.     pop bc
  137.     ld (rhl),hl
  138.     ld hl,(ret)
  139.     push hl
  140.     ld hl,(rhl)
  141.     ret
  142.  
  143.  
  144.  
  145. LoadWi: ld (rde),de
  146.     ld (rhl),hl
  147.     pop hl
  148.     ld (ret),hl
  149.     ld h,d
  150.     ld l,e
  151.     ld e,(hl)
  152.     inc hl
  153.     ld d,(hl)
  154.     ld (skox),de
  155.     inc hl
  156.     ld e,(hl)
  157.     inc hl
  158.     ld d,(hl)
  159.     ld (skoy),de
  160.     inc hl
  161.     ld e,(hl)
  162.     inc hl
  163.     ld d,(hl)
  164.     ld (ekox),de
  165.     inc hl
  166.     ld e,(hl)
  167.     inc hl
  168.     ld d,(hl)
  169.     ld (ekoy),de
  170.     inc hl
  171.     ld e,(hl)
  172.     inc hl
  173.     ld d,(hl)
  174.     ld (memstart),de
  175.     inc hl
  176.     push af
  177.     ld a,(hl)
  178.     ld (xinv),a
  179.     inc hl
  180.     ld a,(hl)
  181.     ld (xover),a
  182.     pop af
  183.     ld de,(rde)
  184.     ld hl,(rhl)
  185.  
  186.  
  187.  
  188.     push bc
  189.     push de
  190.     push hl
  191.     push ix
  192.     push iy
  193.     push af
  194.     call prep
  195.     ld bc,(skoy)
  196.     ld (flop),bc
  197.     ld b,c
  198.     ld de,(ekoy)
  199.     ld c,e
  200.     jp test5
  201. schl5:    ld de,(skox)        ;flip -> de
  202.     ld (flip),de
  203.     ld hl,(ekox)        ;ekox -> hl
  204.     jp test6
  205. schl6:    ld hl,(ekox)
  206.     call LWvxy
  207.     ld iy,08d
  208.     add iy,de
  209.     ld (flip),iy        ;flip udaten
  210.     push iy
  211.     pop de
  212. test6:  ld a,h
  213.     cp d
  214.     jp m,weit3
  215.     jp nz,schl6
  216.     ld a,l
  217.     cp e
  218.     jp m,weit3
  219.     jp schl6
  220. weit3:    inc b 
  221.     ld ix,(flop)        ;und zurueckspeichern
  222.     inc ix
  223.     ld (flop),ix
  224. test5:  ld a,c
  225.     cp b
  226.     jp m,wt3
  227.     jp schl5
  228. wt3:    pop af
  229.     pop iy
  230.     pop ix
  231.     pop hl
  232.     pop de
  233.     pop bc
  234.     ld (rhl),hl
  235.     ld hl,(ret)
  236.     push hl
  237.     ld hl,(rhl)
  238.     ret
  239.  
  240.  
  241.  
  242. SaveFW:    push bc
  243.     push de
  244.     push hl
  245.     push ix
  246.     push iy
  247.     push af
  248.     ld de,scbpb
  249.     ld c,49d
  250.     call bdos
  251.     ld (olddma),hl
  252.     ld de,mydma
  253.     ld c,26d
  254.     call bdos
  255.     pop af
  256.     pop iy
  257.     pop ix
  258.     pop hl
  259.     pop de
  260.     pop bc    
  261.          ld (rde),de
  262.      ld (rhl),hl
  263.      pop hl        ;ret-addr
  264.      ld (ret),hl
  265.      ld h,d
  266.     ld l,e
  267.      ld e,(hl)    ;xstart addr.
  268.     inc hl        ;high byte
  269.     ld d,(hl)    ;
  270.     ld (skox),de
  271.     inc hl        ;addr+1
  272.     ld e,(hl)    ;
  273.     inc hl
  274.     ld d,(hl)
  275.     ld (skoy),de
  276.  
  277.     inc hl
  278.     ld e,(hl)
  279.     inc hl
  280.     ld d,(hl)
  281.     ld (ekox),de
  282.     inc hl
  283.     ld e,(hl)
  284.     inc hl
  285.     ld d,(hl)
  286.     ld (ekoy),de
  287.  
  288.  
  289.     push af
  290.     inc hl
  291.     ld a,(hl)
  292.     ld (sb1x1),a
  293.     inc hl
  294.     ld a,(hl)
  295.     ld (sb1x2),a
  296.     inc hl
  297.     ld a,(hl)
  298.     ld (sb1x3),a
  299.     inc hl
  300.     ld a,(hl)
  301.     ld (sb1x4),a
  302.     inc hl
  303.     ld a,(hl)
  304.     ld (sb1x5),a
  305.     inc hl
  306.     ld a,(hl)
  307.     ld (sb1x6),a
  308.     inc hl
  309.     ld a,(hl)
  310.     ld (sb1x7),a
  311.     inc hl
  312.     ld a,(hl)
  313.     ld (sb1x8),a    
  314.     pop af
  315.  
  316.     ld hl,(rhl)
  317.     ld de,(rde)    
  318.     push bc
  319.     push de
  320.     push hl
  321.     push ix
  322.     push iy
  323.     push af
  324.     call mfdm
  325.     call pfrep
  326.     ld bc,(skoy)
  327.     ld (flop),bc
  328.     ld b,c
  329.     ld de,(ekoy)
  330.     ld c,e
  331.     jp test3
  332. schl3:    ld de,(skox)        ;flip -> de
  333.     ld (flip),de
  334.     ld hl,(ekox)        ;ekox -> hl
  335.     jp test4
  336. schl4:    ld hl,(ekox)
  337.     call SWFxy
  338.     ld iy,08d
  339.     add iy,de
  340.     ld (flip),iy        ;flip udaten
  341.     push iy
  342.     pop de
  343. test4:  ld a,h
  344.     cp d
  345.     jp m,weit1
  346.     jp nz,schl4
  347.     ld a,l
  348.     cp e
  349.     jp m,weit1
  350.     jp schl4
  351. weit1:    inc b 
  352.     ld ix,(flop)        ;alten wert laden
  353.     inc ix            ;um 1 erhoehen
  354.     ld (flop),ix        ;und zurueckspeichern
  355. test3:  ld a,c
  356.     cp b
  357.     jp m,weit2
  358.     jp schl3
  359. weit2:    call cfdm
  360.     pop af
  361.     pop iy
  362.     pop ix
  363.     pop hl
  364.     pop de
  365.     pop bc
  366.     ld (rhl),hl
  367.     ld hl,(ret)
  368.     push hl
  369.     ld hl,(rhl)
  370.     push bc
  371.     push de
  372.     push hl
  373.     push ix
  374.     push iy
  375.     push af
  376.     ld de,(olddma)
  377.     ld c,26d
  378.     call bdos
  379.     pop af
  380.     pop iy
  381.     pop ix
  382.     pop hl
  383.     pop de
  384.     pop bc
  385.     ret    
  386.  
  387.  
  388.  
  389. LoadFW:    push bc
  390.     push de
  391.     push hl
  392.     push ix
  393.     push iy
  394.     push af
  395.     ld de,scbpb
  396.     ld c,49d
  397.     call bdos
  398.     ld (olddma),hl
  399.     ld de,mydma
  400.     ld c,26d
  401.     call bdos
  402.     pop af
  403.     pop iy
  404.     pop ix
  405.     pop hl
  406.     pop de
  407.     pop bc    
  408.      ld (rde),de
  409.      ld (rhl),hl
  410.      pop hl        ;ret-addr
  411.      ld (ret),hl
  412.      ld l,e
  413.     ld h,d
  414.      ld e,(hl)    ;xstart addr.
  415.     inc hl        ;high byte
  416.     ld d,(hl)    ;
  417.     ld (skox),de
  418.     inc hl        ;addr+1
  419.     ld e,(hl)    ;
  420.     inc hl
  421.     ld d,(hl)    ;
  422.     ld (skoy),de
  423.  
  424.     inc hl
  425.     ld e,(hl)
  426.     inc hl
  427.     ld d,(hl)
  428.     ld (ekox),de
  429.     inc hl
  430.     ld e,(hl)
  431.     inc hl
  432.     ld d,(hl)
  433.     ld (ekoy),de
  434.  
  435.     push af
  436.     inc hl
  437.     ld a,(hl)
  438.     ld (sb1x1),a
  439.     inc hl
  440.     ld a,(hl)
  441.     ld (sb1x2),a
  442.     inc hl
  443.     ld a,(hl)
  444.     ld (sb1x3),a
  445.     inc hl
  446.     ld a,(hl)
  447.     ld (sb1x4),a
  448.     inc hl
  449.     ld a,(hl)
  450.     ld (sb1x5),a
  451.     inc hl
  452.     ld a,(hl)
  453.     ld (sb1x6),a
  454.     inc hl
  455.     ld a,(hl)
  456.     ld (sb1x7),a
  457.     inc hl
  458.     ld a,(hl)
  459.     ld (sb1x8),a    
  460.     inc hl
  461.     ld a,(hl)
  462.     ld (linv),a
  463.     inc hl
  464.     ld a,(hl)
  465.     ld (lover),a
  466.     pop af
  467.  
  468.     ld hl,(rhl)
  469.     ld de,(rde)    
  470.     push bc    
  471.     push de
  472.     push hl
  473.     push ix
  474.     push iy
  475.     push af
  476.     call ofdm
  477.     call pfrep
  478.     ld bc,(skoy)
  479.     ld (flop),bc
  480.     ld b,c
  481.     ld de,(ekoy)
  482.     ld c,e
  483.     jp test7
  484. schl7:    ld de,(skox)        ;flip -> de
  485.     ld (flip),de
  486.     ld hl,(ekox)        ;ekox -> hl
  487.     jp test8
  488. schl8:    ld hl,(ekox)
  489.     call LWFxy
  490.     ld iy,08d
  491.     add iy,de
  492.     ld (flip),iy        ;flip udaten
  493.     push iy
  494.     pop de
  495. test8:  ld a,h
  496.     cp d
  497.     jp m,weit4
  498.     jp nz,schl8
  499.     ld a,l
  500.     cp e
  501.     jp m,weit4
  502.     jp schl8
  503. weit4:    inc b 
  504.     ld ix,(flop)        ;und zurueckspeichern
  505.     inc ix
  506.     ld (flop),ix
  507. test7:  ld a,c
  508.     cp b
  509.     jp m,wt4
  510.     jp schl7
  511. wt4:    call cfdm
  512.     pop af
  513.     pop iy
  514.     pop ix
  515.     pop hl
  516.     pop de
  517.     pop bc
  518.     ld (rhl),hl
  519.     ld hl,(ret)
  520.     push hl
  521.     ld hl,(rhl)
  522.     push bc
  523.     push de
  524.     push hl
  525.     push ix
  526.     push iy
  527.     push af
  528.     ld de,(olddma)
  529.     ld c,26d
  530.     call bdos
  531.     pop af
  532.     pop iy
  533.     pop ix
  534.     pop hl
  535.     pop de
  536.     pop bc
  537.     ret
  538.  
  539.  
  540. GFtext: push bc
  541.     push de
  542.     push hl
  543.     push ix
  544.     push iy
  545.     push af
  546.     ld de,scbpb
  547.     ld c,49d
  548.     call bdos
  549.     ld (olddma),hl
  550.     ld de,mydma
  551.     ld c,26d
  552.     call bdos
  553.     pop af
  554.     pop iy
  555.     pop ix
  556.     pop hl
  557.     pop de
  558.     pop bc    
  559.     ld (rbc),bc
  560.     pop bc
  561.     ld (ret),bc
  562.     ld (rhl),hl    ;saven
  563.  
  564.     ld h,d
  565.     ld l,e
  566.  
  567.     ld c,(hl)    ;inv -> bc
  568.     inc hl
  569.     ld b,(hl)    ;
  570.     ld (injn),bc    ;
  571.     inc hl        ;addr +1
  572.     ld c,(hl)    ;
  573.     inc hl
  574.     ld b,(hl)    ;
  575.     ld (zeichs),bc    ;offset
  576.     inc hl
  577.     ld c,(hl)
  578.     inc hl
  579.     ld b,(hl)
  580.     ld (zeile),bc
  581.     inc hl
  582.     ld c,(hl)
  583.     inc hl
  584.     ld b,(hl)
  585.     ld (spalte),bc
  586.     inc hl
  587.     ld c,(hl)
  588.     inc hl
  589.     ld b,(hl)
  590.     ld (mytex),bc    ;array-addr
  591.     ld bc,(rbc)
  592.     ld hl,(rhl)
  593.     push bc
  594.     push de
  595.     push hl
  596.     push ix
  597.     push iy
  598.     push af
  599.     ld de,(zeile)        ;zeile in e
  600.     ld b,e            ;zeile in b
  601. ;** if schleife
  602.     ld a,b            ;zeile in akku
  603.     cp 0h            ;zeile < 0
  604.         jp m,endg               ;zeile < 0 -> endg
  605.         cp 25d                  ;zeile >25 ?
  606.         jp m,wg1              ;zeile < 25 -> wg1
  607.         jp z,wg1              ;zeile=25 -> wg1
  608.         jp endg                 ;sonst zeile . 25 -> endg
  609. wg1:  ld a,c                  ;spalte in akku
  610.         cp 0h                   ;spalte < 0 ?
  611.         jp m,endg               ;-> endg
  612.         cp 79d                  ;spalte > 79 ?
  613.         jp m,wg2              ;spalte < 79 -> wg2
  614.         jp z,wg2               ;spalte = 79 -> wg2
  615.         jp endg                 ;sonst: spalte . 79 -> endg
  616. wg2:  ld de,01h               ;
  617.         ld (ind1),de            ;ind1 <- 1
  618.         ld hl,(mytex)           ;addr v string
  619.         ld e,(hl)              ;string[0] -> endg
  620.     ld d,00h        ;endg -> de
  621.         ld (ind2),de            ;laenge str -> ind2
  622.         ld bc,(ind1)            ;
  623.         ld b,c                  ;ind1 (8 bit !) -> b
  624.         ld c,e                  ;ind2 (8 bit 1) -> c
  625. ;while ind1 < ind2 do
  626. ; schleife                      
  627.         jp tg1
  628. scg1:  push bc                 ;ind1,ind2 retten
  629. ;texta:=zeile * 640 +spalte
  630. ;zeile *640                     multgiplik. nach Rodnay Zacks
  631.         ld bc,640d              
  632.         ld (mpd),bc   
  633.     ld hl,(zeile)        ;
  634.     ld a,h          
  635.     ;   ld a,(zeile+1)         ;mpr-oben
  636.         ld c,a    
  637.     ld a,l              
  638.     ;   ld a,(zeile+0)            mpr - unten
  639.         ld b,16d                ;zaehler
  640.         ld de,(mpd)             ;640d -> de
  641.         ld hl,0h                
  642. multg:   srl c                   ;mpr-oben nach rechts schieben
  643.         rra                     ;mpr unten rotier. rechts
  644.         jr nc,nogadd             ;teste uebertr
  645.         add hl,de               ;mpd zu ergebnis addieren
  646. nogadd:  ex de,hl                ;vertausche de,hl
  647.         add hl,hl               ;verdoppelung schiebe mpd -> links
  648.         ex de,hl                
  649.         djnz multg               ;hl -> ergebnis
  650.         ld bc,(spalte)          
  651.         add hl,bc               ;zeile*640+spalte -> hl
  652.         ld (texta),hl           ;
  653.         pop bc                  ;ind1,ind2 holen
  654.         ld de,(mytex)           ;add v.string
  655.         ld h,0h                 ;
  656.         ld l,b                  ;ind1 -> hl
  657.         add hl,de               ;addr(mystr[ind1]) -> hl
  658.         ld a,(hl)               ;mystr[ind1] -> a
  659. ;ascii v. mystr[ind1] -> a
  660. ;= ORD(mystr[ind1]) -> a
  661. ;a*16 -> 4 bit nach links verschieben
  662.         ld d,0h                 ;
  663.         ld e,a                  ;in 16 bit register
  664.         sla e                   ;*2 7. bit -> carry
  665.         rl d                    ;carry in d schieben
  666.         sla e                   ;*4
  667.         rl d                    
  668.         sla e                   ;*8
  669.         rl d                    
  670.         sla e                   ;*16
  671.         rl d                    ;*16 -> de
  672. ;ord (mystr[ind1])*16 -> de     
  673.         ld hl,4096d             
  674.         add hl,de
  675. ;+4096d                         
  676. ;ORD(mystr[ind1])*16+4096 -> hl
  677.         ld de,0000h               ;0000h da keine basisaddr in file -> de
  678.         add hl,de               ;addr(charro)+ORD(mystr[ind1])*16+4096 -> hl
  679.     push bc            ;saven der register
  680.     push de
  681.     push hl
  682.     push af
  683. ;    ld bc,hl        ;bisher offsa (bei 00) in bc retten
  684.     ld b,h
  685.     ld c,l
  686.     ld de,(zeichs)        ;offset d. zeichensatzes in de
  687.     sla e            ;zeichoffset *2 ,da words in tabelle !
  688.     ld hl,ztabl        ;startaddresse zeichens.offsettabelle
  689.     add hl,de        ;ergibt addresse der stelle in tabelle
  690. ;    ld de,(hl)        ;inhalt der tabelle = offset nach de
  691.     ld e,(hl)
  692.     inc hl            ;addr+1 fuer high byte
  693.     ld d,(hl)
  694. ;    ld hl,bc        ;bisher offsa in hl
  695.     ld h,b
  696.     ld l,c    
  697.     add hl,de        ;mit neuen (0000,1024,2048,..7186) addieren
  698.     ld (offsa),hl        ;in offsa speichern
  699.  
  700.     ;ld de,4096d
  701.     ;add hl,de
  702.         ;ld (offsa),hl
  703.  
  704.     pop af            ;laden der registerwerte
  705.     pop hl
  706.     pop de
  707.     pop bc
  708.     push bc
  709.     push de
  710.     push hl
  711.     push ix
  712.     push iy
  713.     push af
  714.     call PFIlett
  715.     pop af
  716.     pop iy
  717.     pop ix
  718.     pop hl
  719.     pop de
  720.     pop bc             
  721.         inc b                   ;ind1 +1
  722.         push bc                 ;ind1 ,ind2 retten
  723.         ld bc,(spalte)          ;spalte -> c
  724.         ld de,(zeile)           ;zeile -. e
  725.         ld b,e                  ;zeile -> b
  726.         ld a,c                  ;spakte -> a
  727.         cp 79d                
  728.         jp nz,wg3             
  729.         inc b                   ;zeile +1
  730.         ld a,b                  ;zeile +1 -> a
  731.         jp tg2
  732. scg2:      sbc a,25d
  733. tg2:      cp 24d               
  734.         jp z,wg4              
  735.         jp m,wg4              
  736.         jp scg2
  737. wg4:      ld h,0d                 
  738.         ld l,a                  
  739.         ld (zeile),hl           ;zeile -> neu
  740. wg3:      inc c                   ;spalte +1 -> akku
  741.     ld a,c
  742.         jp tg3
  743. scg3:      sbc a,79d               
  744. tg3:      cp 78d                  
  745.         jp m,wg5              
  746.         jp z,wg5              
  747.         jp scg3
  748. wg5:      ld h,0h                 
  749.         ld l,a                  
  750.         ld (spalte),hl          
  751.         pop bc                  ;ind1 , ind2 holen
  752. tg1:  ld a,b                  ;ind1 - ind2 ?
  753.     cp c
  754.         jp m,scg1              
  755.         jp z,scg1
  756. endg:   pop af
  757.     pop iy
  758.     pop ix
  759.     pop hl
  760.     pop de
  761.     pop bc
  762.     ld (rbc),bc
  763.         ld bc,(ret)             
  764.         push bc 
  765.     ld bc,(rbc)                
  766.     push bc
  767.     push de
  768.     push hl
  769.     push ix
  770.     push iy
  771.     push af
  772.     ld de,(olddma)
  773.     ld c,26d
  774.     call bdos
  775.     pop af
  776.     pop iy
  777.     pop ix
  778.     pop hl
  779.     pop de
  780.     pop bc
  781.         ret
  782.  
  783.     
  784.  
  785. mytex: ds 2
  786.  
  787. zeile: ds 2
  788.  
  789. spalte: ds 2
  790.  
  791. ind1: ds 2
  792.  
  793. ind2: ds 2
  794.  
  795. mpd: ds 2
  796.  
  797. rbc: ds 2
  798.  
  799.  
  800. scrdump:ld (rbc),bc
  801.         pop bc
  802.         ld (ret),bc
  803.         ld (prmode),de
  804.         ld bc,(rbc)
  805.         push bc
  806.         push de
  807.         push hl
  808.         push ix
  809.         push iy
  810.         push af
  811.     call zeil0a             ;zerstoert alles
  812.     ld bc,(prmode)
  813.         ld a,c                  ;prmode -> akku
  814.     ld (mode),a
  815.     ld bc,0h                
  816.         ld (zeile),bc           ;0 -> zeile
  817.         ld a,c                  ;zeile -> akku
  818.         jp tst4                 
  819. schx4:  ld de,0h                
  820.         ld (spalte),de          
  821.         push bc                 
  822.         push de                 
  823.         push hl                 
  824.         push ix                 
  825.         push iy                 
  826.         push af                 
  827.         call prbitm             
  828.         pop af                  
  829.         pop iy                  
  830.         pop ix                  
  831.         pop hl                  
  832.         pop de                  
  833.         pop bc                  
  834.         ld b,e                  ;spalte (8 bit) -> b
  835.         jp tst5                 
  836. schx5:  push bc                 ;zeile,spalte retten
  837. ;multiplikation nach rodnay zacks
  838.         ld de,640d              
  839.         ld h,0h                 
  840.         ld l,c                  ;zeile -> hl
  841.         ld (mpr),hl             
  842. muly16: ld a,(mpr+1)            
  843.         ld c,a                  
  844.         ld a,(mpr)              
  845.         ld b,16d                
  846.         ld hl,00h
  847. multy:  srl c                   
  848.         rra                     
  849.         jr nc,noyadd            
  850.         add hl,de
  851. noyadd: ex de,hl                
  852.         add hl,hl               
  853.         ex de,hl                
  854.         djnz multy              
  855.         pop bc                  ;zeile,spalte laden
  856.         ld d,0h                 
  857.         ld e,b                  ;spalte -> de
  858.         add hl,de               
  859. ;zeile*640+spalte -> hl
  860.         ld (paddre),hl          
  861.         push bc                 
  862.         push de                 
  863.         push hl                 
  864.         push ix                 
  865.         push iy                 
  866.         push af                 
  867.         call crtab              
  868.         call convta             
  869.         call prtab              
  870.         pop af                  
  871.         pop iy                  
  872.         pop ix                  
  873.         pop hl                  
  874.         pop de                  
  875.         pop bc                  
  876.         inc b                   ;spalte + 1
  877. tst5:   ld a,b                  
  878.         cp 79d                  
  879.         jp m,schx5              
  880.         jp z,schx5              
  881.         push bc                 
  882.         push de                 
  883.         push hl                 
  884.         push ix                 
  885.         push iy                 
  886.         push af                 
  887.         call nextli             
  888.         pop af                  
  889.         pop iy                  
  890.         pop ix                  
  891.         pop hl                  
  892.         pop de                  
  893.         pop bc                  
  894.         inc c                   ;zeile + 1
  895. tst4:   ld a,c                  
  896.         cp 25d                  
  897.         jp m,schx4              
  898.         jp z,schx4 
  899.         pop af                  
  900.         pop iy                  
  901.         pop ix                  
  902.         pop hl                  
  903.         pop de                  
  904.         pop bc                  
  905.         ld (rbc),bc             
  906.         ld bc,(ret)             
  907.         push bc                 
  908.         ld bc,(rbc)             
  909.         ret
  910.  
  911. prmode: ds 2
  912.  
  913. mpr:    ds 2
  914.  
  915. zeichs: ds 2
  916.  
  917. ztabl:  dw 0000d    ;0
  918.  
  919.     dw 1024d    ;2
  920.  
  921.     dw 2048d    ;4
  922.  
  923.     dw 3072d    ;6
  924.  
  925.     dw 4096d
  926.  
  927.     dw 5120d
  928.  
  929.     dw 6144d
  930.  
  931.     dw 7168d
  932.  
  933. injn:   ds 2            
  934.  
  935. rde: ds 2
  936.                         
  937.     end
  938.  
  939.  
  940.  
  941.  
  942.