home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-15 | 21.9 KB | 1,575 lines |
-
-
-
- .z80
-
- external paddre
-
- public olddma,scbpb,mode
-
- public scradd
-
- public lover,linv
-
- public xinv,xover
-
- public memstart,SWvxy,LWvxy,prep
-
- public GrOn,GrOff
-
- public sb1x1,sb1x2,sb1x3,sb1x4,sb1x5,sb1x6,sb1x7,sb1x8
-
- external injn
-
- public value,address,sadd,eadd
-
- public GrSOn,GrFOn,GrFOff,SetDot,EraDot,ClrGr;entry points
-
- public SetPix,EraPix;
-
- public wert,myzl,ldv
-
- public mfdm,ofdm,cfdm,SWFxy,LWFxy,pfrep;
-
- public b1x8,sb1x8;
-
- public flip,flop,skox,skoy,ekox,ekoy;
-
- external texta,offsa;
-
- public nextli,prbitm,crtab,prtab,convta,zeil0a;
-
- public PFIlett;
-
- public b12,b32,b33,b34,b35;
-
- public mydma
-
- ListOutPut equ 05h;
-
- esc equ 1bh;
-
-
- GrOn: call init ;
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld (scradd),de
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- call charO ;zeichen auslagern
- call graclear ;graphic mode on + clear
- call clear ;
- call color ;
- jp wiede ;hole cpu-register
-
-
- GrOff: call init ;
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld (scradd),de
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- call clear ;
- call text ;text mode on
- call charI ;characters einlesen
- jp wiede ;s.o
-
-
- PFIlett: ld a,00d
-
- ld (b12),a
-
- ld (b32),a
-
- ld (b35),a
-
- call open
-
- ld a,00h
-
- ld (b33),a
-
- ld (b34),a
-
- ld de,fcb
-
- ld c,21h
-
- call bdos
-
- ld de,(offsa) ;offsa -> de
- ;offsa div 128 -> de
- srl d
- rr e ;div 2
- srl d
- rr e ;div 4
-
- srl d
- rr e ;div 8
- srl d
- rr e ;div 16
-
- srl d
- rr e ;div 32
- srl d
- rr e ;div 64
-
- srl d
-
- rr e ;div 128d
-
- ld a,e ;low-byte -> akku
-
- ld (b33),a ;low-byte rec. no -> r0
-
- ld a,d ;high byte -> akku
-
- ld (b34),a ;high byte rec no -> r1
-
- ;r2 immer 0
-
- ld a,00h
-
- ld de,fcb ;addr fcb -> de
-
- ld c,21h ;bdos #33d
-
- call bdos ;record in DMA buffer lesen
-
- ld de,(offsa) ;offsa -> de
-
- ld d,00h ;= mod 256d
-
- ld a,e ;low byte = mod 256 -> akku
-
- and 01111111b ;mod 128 -> akku
-
- ld e,a ;zurueck in e
-
- ;de <- offsa mod 128
-
- ld hl,mydma ;
-
- ; ld hl,128d ;start DMA buffer
-
- add hl,de ;start of char
-
- ld (offsa),hl ;offsa neu gesetzt
-
- call close ;file schliessen
-
-
- ld bc,0d600h ;basis address of VDC
- ld de,(offsa) ;location in charrom
- ld hl,(texta) ;location on screen i.e. VDC
- ld a,0h ;schleienvar
- ld (myzl),a ;myzl = schleifenvar
- jp testip ;fertig ?
- againip: ld a,h ;update-address-high-byte
- ld (wert),a ;
- ld a,18d ;update-register high
- call sldv ;schreiben
- ld a,l ;update-address low-byte
- ld (wert),a ;
- ld a,19d ;update-register low
- call sldv ;schreiben
- ld a,(de) ;contents of sp.location in charrom
-
- push bc ;bc retten
- push de
- ld d,a
- ld bc,(injn)
- ld a,c
- cp 00h
- jp z,weitjn
- ld a,d
- ld c,11111111b ;invertmaske
- xor c
- ld d,a
- weitjn: ld a,d
- pop de
- pop bc ;bc holen
-
- ld (wert),a ;
- ld a,31d ;data-register
- call sldv ;
- inc de ;next byte of char. bit-map
- ld bc,80d ;offset to next line
- add hl,bc ;next screenlocation in hl
- ld bc,0d600h ;correct bc
- ld a,(myzl) ;schleifenvar
- inc a ;schleifenvar+1 !!!!!!!
- ld (myzl),a ;und speichern !!!!!!!!
- testip: cp 08d ;ready ?
- jp m,againip ;
- ret ;chiao
-
-
- zeil0a: ld e,esc
- ld c,ListOutPut
- call bdos
- ld e,"3"
- ld c,ListOutPut
- call bdos
- ld e,21d
- ld c,ListoutPut
- call bdos
- ret
-
- mode: ds 1,00h
-
- prbitm: ld e,esc
- ld c,ListOutPut
- call bdos;
- ld e,2ah
- ld c,ListOutput
- call bdos
- ld a,(mode)
- ld e,a
- ld c,ListOutPut
- call bdos;
- ld e,128d
- ld c,ListOutPut
- call bdos
- ld e,02d
- ld c,ListOutPut
- call bdos
- ret
-
- nextli: ld e,13d
- ld c,ListOutPut
- call bdos
- ld e,10d
- ld c,ListOutPut
- call bdos
- ret
-
- crtab: ld bc,0d600h
- ld hl,(paddre)
- ld ix,tab
- ld de,80d
- ld a,0h
- ld (zaehlerpx),a
- jp testpx
- againpx: ld a,h
- ld (wert),a
- ld a,18d
- call sldv
- ld a,l
- ld (wert),a
- ld a,19d
- call sldv
- ld a,31d
- call rdv
- ld (ix),a
- inc ix
- add hl,de
- ld a,(zaehlerpx)
- inc a
- ld (zaehlerpx),a
- testpx: cp 08d
- jp m,againpx
- ret
-
- prtab: ld bc,tabl
- ld (aktzeiger),bc
- ld a,0h
- ld (aktschleife),a
- jp testqx
- againqx: ld bc,(aktzeiger)
- ld a,(bc)
- ld e,a
- ld c,ListOutPut
- call bdos
- ld bc,(aktzeiger)
- inc bc
- ld (aktzeiger),bc
- ld a,(aktschleife)
- inc a
- ld (aktschleife),a
- testqx: cp 08d
- jp m,againqx
- ret
-
- convta: ld ix,tabl
- ld b,0h
- jp testpz
- againpz: ld hl,0000h
- ld de,tab
- ld c,0h
- jp testpy
- againpy: ld a,(de)
- ld l,a
- call schiebe
- sla l
- rl h
- inc c
- inc de
- testpy: ld a,c
- cp 08d
- jp m,againpy
- ld (ix),h
- inc b
- inc ix
- testpz: ld a,b
- cp 08d
- jp m,againpz
- ret
-
- schiebe: ld a,b
- ld (spsave),a
- jp testpr
- againpr: sla l
- dec b
- testpr: ld a,b
- cp 0h
- jp nz,againpr
- ld a,(spsave)
- ld b,a
- ret
-
- SetPix:
- ld (rbc),bc
- ld (rhl),hl
- pop hl
- ld (sxret),hl
- ld l,e
- ld h,d
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (flip),bc
- inc hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (flop),bc
- ld bc,(rbc)
- ld hl,(rhl)
-
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call SetDot
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(sxret)
- push hl
- ld hl,(rhl)
- ret
-
-
- ; pop hl ;returnaddr.
- ; pop de ;y-Koordin.
- ; pop bc ;x-Koordin.
- ; ld (flop),de ;
- ; ld (flip),bc ;
- ; push hl ;returnaddr.
- ; call SetDot ;
- ; ret ;
- ;
- ;
-
-
- EraPix:
- ld (rbc),bc
- ld (rhl),hl
- pop hl
- ld (sxret),hl
- ld l,e
- ld h,d
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (flip),bc
- inc hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- ld (flop),bc
- ld bc,(rbc)
- ld hl,(rhl)
-
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- call EraDot
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- ld (rhl),hl
- ld hl,(sxret)
- push hl
- ld hl,(rhl)
- ret
-
-
- ; pop hl ;returnaddr.
- ; pop de ;y-Koordin.
- ; pop bc ;x-Koordin.
- ; ld (flop),de ;
- ; ld (flip),bc ;
- ; push hl ;returnaddr.
- ; call EraDot ;
- ; ret ;
-
-
-
-
- init: di ;no interrupts
- ld (memory),hl ;register in speicher
- pop hl ;hole ruecksprungaddresse
- ld (ret),hl ;ruecksprungaddresse in speicher
- ld hl,(memory) ;alter wert hl in register
- push bc ;rette cpu-register
- push de ;
- push hl ;
- push ix ;
- push iy ;
- push af ;
- ld bc,(ret) ;ruecksprungaddr auf top von stapel
- push bc ;
- ret ;zurueck
-
- GrSOn: call init ;
- call graclear ;
- call clear ;
- call color ;
- jp wiede ;
-
-
-
- GrFOn: call init ;
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,scbpb
- ld c,49d
- call bdos
- ld (olddma),hl
- ld de,mydma
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- call charFO ;zeichen auslagern
- call graclear ;graphic mode on + clear
- call clear ;
- call color ;
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(olddma)
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- jp wiede ;hole cpu-register
-
- GrFOff: call init ;
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,scbpb
- ld c,49d
- call bdos
- ld (olddma),hl
- ld de,mydma
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- call clear ;
- call text ;text mode on
- call charFI ;characters einlesen
- push bc
- push de
- push hl
- push ix
- push iy
- push af
- ld de,(olddma)
- ld c,26d
- call bdos
- pop af
- pop iy
- pop ix
- pop hl
- pop de
- pop bc
- jp wiede ;s.o
-
-
- SetDot: call init ;
- call trxy ;transformer programm
- call setpoint ;
- jp wiede ;s.o.
-
-
- EraDot: call init ;
- call trxy ;
- call erapoint ;
- jp wiede ;
-
-
- ClrGr: call init ;
- call clear ;
- jp wiede ;
-
-
-
- pfrep: call init
- ld bc,mydma ;
- ; ld bc,128d ;
- ld (afpos),bc ;
- ld a,00 ;
- ld (zaehler),a ;
- jp wiede ;
-
-
- SWFxy: call init ;
- call trxy ;
- call ulk ;
- jp wiede ;
-
- LWFxy: call init ;
- call trxy ;
- call luz ;
- jp wiede ;
-
-
- dmacl: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld b,00 ;
- ld iy,mydma
- ; ld iy,128d ;
- jp testk ;
- againk: ld a,00 ;
- ld (iy),a ;
- inc b ;
- inc iy ;
- testk: ld a,b ;
- cp 128d ;
- jp nz,againk ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
- wiede: pop af ;hole cpu register von stapel
- pop iy ;
- pop ix ;
- pop hl ;
- pop de ;
- pop bc ;
- ei ;interrupts wieder zugelassen
- ret ;ruecksprung in hauptprogramm
-
- bdos equ 0005h ;
-
- make: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,16h ;
- ld de,fcb ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
- make1: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,16h ;
- ld de,fcb1 ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
- mfdm: call init ;
- call make1 ;
- ld a,00 ;
- ld (sb12),a ;
- ld (sb32),a ;
- call dmacl ;
- jp wiede ;
-
-
- close: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,10h ;
- ld de,fcb ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
- close1: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,10h ;
- ld de,fcb1 ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
- cfdm: call init ;
- call wr1 ;
- call close1 ;
- jp wiede ;
-
- wr: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,15h ;
- ld de,fcb ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
- wr1: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,15h ;
- ld de,fcb1 ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
-
- rdx: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,14h ;
- ld de,fcb ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
- rdx1: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,14h ;
- ld de,fcb1 ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
- open: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,0fh ;
- ld de,fcb ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
-
-
- open1: push bc ;
- push de ;
- push hl ;
- push iy ;
- push ix ;
- ld c,0fh ;
- ld de,fcb1 ;
- call bdos ;
- pop ix ;
- pop iy ;
- pop hl ;
- pop de ;
- pop bc ;
- ret ;
-
- ofdm: call init ;
- call open1 ;
- ld a,00 ;
- ld (sb12),a ;
- ld (sb32),a ;
- call rdx1 ;
- jp wiede ;
-
-
- ldv: out (c),a ;
- call schl1 ;
- inc bc ;
- ld a,(wert) ;
- out (c),a ;
- call schl1 ;
- dec bc ;
- ret ;
-
-
- sldv: out (c),a ;
- nop
- nop
- nop
- nop ;
- inc bc ;
- ld a,(wert) ;
- out (c),a ;
- nop
- nop
- nop
- nop
- dec bc ;
- ret ;
-
-
- ldv1: out (c),a ;
- call schl2 ;
- inc bc ;
- ld a,(wert) ;
- out (c),a ;
- call schl2 ;
- dec bc ;
- ret ;
-
-
-
- sldv1: out (c),a ;
- nop
- nop
- nop
- nop
- inc bc ;
- ld a,(wert) ;
- out (c),a ;
- nop
- nop
- nop
- nop
- dec bc ;
- ret ;
-
- rdv: out (c),a ;
- call schl1 ;
- inc bc ;
- in a,(c) ;
- dec bc ;
- ret ;
-
-
- srdv: out (c),a ;
- nop
- nop
- nop
- nop
- inc bc ;
- in a,(c) ;
- dec bc ;
- ret ;
-
-
- schl1: ld a,20d ;
- wait1: dec a ;
- jp nz,wait1 ;
- ret ;
-
-
- schl3: ld a,1d ;
- wait3: dec a ;
- jp nz,wait3 ;
- ret ;
-
-
- schl2: ld a,55d ;
- wait2: dec a ;
- jp nz,wait2 ;
- ret ;
-
-
- schl4: ld a,1d ;
- wait4: dec a ;
- jp nz,wait4 ;
- ret ;
-
- charFO: call make ;make file
- ld a,00d ;
- ld (b12),a ;ex null setzen
- ld (b32),a ;byte 32 null
- ld (zaehler),a ;zaehler initialisieren
- ld de,2000h ;start address of VDC-char-ram
- ld hl,8192d ;zaehler
- ld iy,mydma
- ; ld iy,128d ;array-start-address
- ld bc,0d600h ;start of VDC-chip
-
-
- jp test3 ;fertig? <while schleife>
-
- again3: ld a,d ;update-high-register
- ld (wert),a ;
- ld a,18d ;
- call ldv ; +-+-^
- ld a,e ;
- ld (wert),a ;
- ld a,19d ;
- call ldv ; +-+-^
- ld a,31d ;
- call rdv ;
- ld (iy),a ;
- ld a,(zaehler) ;
- cp 127d ;
- jp nz,nob ;
- call wr ;
- ld a,00d ;
- ld iy,mydma-1
- ; ld iy,127d ;
- jp goon ;
- nob: inc a ;
- goon: ld (zaehler),a ;
- inc de ;next address in char-ram of VDC
- inc iy ;next address in array charrom
- dec hl ;zaehler-1
- test3: ld a,00 ;
- cp h ;h=0?
- jp nz,again3 ;!=0 nicht fertig -> weiter
- cp l ;h=0 and l=0 ?
- jp nz,again3 ;nein -> noch eine schleife
- call close ;
- ret ;zurueck zu charO charI
-
-
-
-
-
- charFI: call open ;
- ld a,00d ;
- ld (b12),a ;ex auf null stzen
- ld (b32),a ;cr auf null to read file from rec.0
- ld (zaehler),a ;zaehler initialisieren
- ld de,2000h ;start address of VDC-char-ram
- ld hl,8192d ;zaehler
- ld iy,mydma
- ; ld iy,128d ;array-start-address
- ld bc,0d600h ;start of VDC-chip
-
- call rdx ;
- jp test4 ;fertig? <while schleife>
- again4: ld a,d ;update-high-register
- ld (wert),a ;
- ld a,18d ;
- call ldv ; +-+-^
- ld a,e ;
- ld (wert),a ;
- ld a,19d ;
- call ldv ; +-+-^
- ld a,(iy) ;
- ld (wert),a ;
- ld a,31d ;
- call ldv ; +-+-^
- ld a,(zaehler) ;
- cp 127d ;
- jp nz,nob1 ;
- call rdx ;
- ld iy,mydma-1 ;
- ; ld iy,127d ;
- ld a,00d ;
- jp goon1 ;
- nob1: inc a ;
- goon1: ld (zaehler),a ;
- inc de ;next address in char-ram of VDC
- inc iy ;next address in array charrom
- dec hl ;zaehler-1
- test4: ld a,00 ;
- cp h ;h=0?
- jp nz,again4 ;!=0 nicht fertig -> weiter
- cp l ;h=0 and l=0 ?
- jp nz,again4 ;nein -> noch eine schleife
- call close ;
- ret ;
-
-
- graclear: ld bc,0d600h ;start address of VDC
-
- ld a,25d ;
- call rdv ;
- ld (reg25),a ;
- and 0fh ;unteren 4 bits
- or 128d ;
- ld (wert),a ;
- ld a,25d ;graphic modus on
- call ldv1 ; +-+-^
- ret ;
-
-
- clear: ld bc,0d600h ;
- ld a,64d ;
- ld e,a ;
- again9: ld a,e ;
- ld (wert),a ;
- ld a,18d ;
- call ldv1 ; +-+-^
- ld a,00 ;
- ld (wert),a ;
- ld a,31d ;
- call ldv1 ; +-+-^
- ld a,30d ;
- call ldv1 ; +-+-^
- dec e ;
- jp p,again9 ;
- ret ;
-
-
- text: ld bc,0d600h ;start VDC-chip
- ld a,(save) ;
- ld (wert),a ;
- ld a,26d ;
- call ldv ; +-+-^
- ld a,(reg25) ;
- ld (wert),a ;
- ld a,25d ;
- call ldv1 ; +-+-^
- ret ;
-
-
-
- setpoint: ld bc,0d600h ;start of VDC-chip in RAM
-
-
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;update-high-register
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,31d ;
- call srdv ;
- ld d,a ;
- ld a,(value) ;
- or d ;
- ld d,a ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,d ;
- ld (wert),a ;
- ld a,31d ;
- call sldv ;
- ld a,18d ;
- call srdv ;
- ret ;
-
-
-
-
- erapoint: ld bc,0d600h ;start of VDC-chip in RAM
-
-
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;update-high-register
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,31d ;
- call srdv ;
- ld d,a ;
- ld a,(value) ;
- xor 0ffh ;
- and d ;
- ld d,a ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,d ;
- ld (wert),a ;
- ld a,31d ;
- call sldv ;
- ld a,18d ;
- call srdv ;
- ret ;
-
-
-
-
-
-
-
- color: ld bc,0d600h ;
- ld a,26d ;
- call rdv ;
- ld (save),a ;
- ld a,240d ;
- ld (wert),a ;
- ld a,26d ;
- call ldv ; +-+-^
- ret ;
-
-
-
-
- ulk: ld bc,0d600h ;
- ld iy,(afpos) ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv1 ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv1 ;
- ld a,31d ;
- call srdv ;
- ld (iy),a ;
- ld a,(zaehler) ;
- cp 127d ;
- jp nz,nob9 ;
- call wr1 ;
- ld a,00 ;
- ld iy,mydma-1
- ; ld iy,127 ;
- jp goon9 ;
- nob9: inc a ;
- goon9: ld (zaehler),a ;
- inc iy ;
- ld (afpos),iy ;
- ret ;
-
-
- luz: ld bc,0d600h ;
- ld iy,(afpos) ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv1 ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv1 ;
- ld a,(iy) ;
- ld (wert),a ;
-
- ld a,(linv)
- cp 00h
- jr z,noinv
- push bc
- ld c,11111111b
- ld a,(wert)
- xor c
- ld (wert),a
- pop bc
- noinv: ld a,(lover)
- cp 00h
- jr z,dover
- push de
- ld a,31d
- call srdv
- ld e,a
- ld a,(wert)
- or e
- ld (spvalue),a
- ld a,(address+1)
- ld (wert),a
- ld a,18d
- call sldv1
- ld a,(address)
- ld (wert),a
- ld a,19d
- call sldv1
- ld a,(spvalue)
- ld (wert),a
- pop de
-
- dover: ld a,31d
-
- call sldv1 ;
- ld a,(zaehler) ;
- cp 127d ;
- jp nz,nob8 ;
- call rdx1 ;
- ld a,00 ;
- ld iy,mydma-1
- ; ld iy,127 ;
- jp goon8 ;
- nob8: inc a ;
- goon8: ld (zaehler),a ;
- inc iy ;
- ld (afpos),iy ;
- ret ;
-
-
-
-
- div8: pop de ;Ruechsprungaddr.
- pop bc ;flip --> bc
- srl b ;
- rr c ;div 2
- srl b
- rr c ;div 2
- srl b
- rr c ;3*(div 2) --> div 8
- push bc ;rg. --> stack
- push de ;Ruecksprungaddr.--> stack
- ret ;chiao
-
-
- iadd: pop de ;Ruecksprungaddr
- pop bc ;summ1
- pop hl ;summ2
- add hl,bc ;(sum1 + sum2) --> hl
- push hl ;erg. --> stack
- push de ;
- ret ;chiao
-
-
- imul: pop ix ;Ruecksprungaddr.
- pop bc ;Multiplikator
- ld b,08h ;
- pop de ;Multiplikand
- ld d,00h ;
- ld hl,00h ;
- mul: srl c ;LSB = 1 ?
- jr nc,noadd ;= 0 kein add
- add hl,de ;
- noadd: sla e ;e * 2
- rl d ;carry --> LSB d
- dec b ;schon 8x ?
- jp nz,mul ;nein --> nochmal
- push hl ;erg.
- push ix ;Ruecksprungaddr.
- ret ;
-
-
- prep: call init ;
- ld bc,(memstart) ;
- ld (apos),bc ;
- jp wiede ;
-
-
- SWvxy: call init ;
- call trxy ;
- call mnop ;
- jp wiede ;
-
-
- LWvxy: call init ;
- call trxy ;
- call lku ;
- jp wiede ;
-
-
-
- trxy: ld bc,(flip) ;
- push bc ;flip --> stapel
- call div8 ;(flip div 8) --> stapel
- ld bc,(flop) ;
- push bc ;flop --> stapel
- ld bc,80d ;
- push bc ;80d --> stapel
- call imul ;(flop * 80) --> stapel
- call iadd ;(flop *80)+(flip div 8) --> stapel
- pop bc ;ergebnis --> stapel
- ld (address),bc ;addres <-- ergebn.
- ld bc,(flip) ;
- ld a,c ;low-byte flip --> akku
- and 07h ;(flip mod 8)--> akku
- ld c,a ;(flip mod 8)--> c
- ld a,07h ;7 in akku
- sub c ;(7-(flip mod 8)) --> akku
- ld c,01h ;2^0 --> c
- jp testf ;expon=akku > 0 ?
- againf: dec a ;exp -1
- sla c ;2^0 *2
- testf: cp 00h ;expon = 00 ?
- jp nz,againf ;<> 0 --> 2^(i+1)
- ld b,00h ;
- ld (value),bc ;value <-- ergebnis
- ret ;chiao
-
-
- mnop: ld bc,0d600h ;
- ld iy,(apos) ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,31d ;
- call srdv ;
- ld (iy),a ;
- inc iy ;
- ld (apos),iy ;
- ret ;
-
-
- lku: ld bc,0d600h ;
- ld iy,(apos) ;
- ld a,(address+1) ;
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,(address) ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,(iy) ;
- ld (wert),a ;
-
-
- ld a,(xinv)
- cp 00h
- jr z,nxinv
- push bc
- ld c,11111111b
- ld a,(wert)
- xor c
- ld (wert),a
- pop bc
- nxinv: ld a,(xover)
- cp 00h
- jr z,dxver
- push de
- ld a,31d
- call srdv
- ld e,a
- ld a,(wert)
- or e
- ld (spvalue),a
- ld a,(address+1)
- ld (wert),a
- ld a,18d
- call sldv
- ld a,(address)
- ld (wert),a
- ld a,19d
- call sldv1
- ld a,(spvalue)
- ld (wert),a
- pop de
-
- dxver: ld a,31d
-
-
- call sldv ;
- inc iy ;
- ld (apos),iy ;
- ret ;
-
-
- charO: ld iy,(scradd) ;startadr of array
- ld de,2000h ;start address of VDC-char-ram
- ld hl,8192d ;zaehler
- ld bc,0d600h ;start of VDC-chip
-
-
- jp test1 ;fertig? <while schleife>
-
- again1: ld a,d ;update-high-register
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,e ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,31d ;
- call rdv ;
- ld (iy),a ;
- inc de ;next address in char-ram of VDC
- inc iy ;next address in array charrom
- dec hl ;zaehler-1
- test1: ld a,00 ;
- cp h ;h=0?
- jp nz,again1 ;!=0 nicht fertig -> weiter
- cp l ;h=0 and l=0 ?
- jp nz,again1 ;nein -> noch eine schleife
- ret ;zurueck zu charO charI
-
-
- charI: ld iy,(scradd) ;start of array
- ld de,2000h ;start address of VDC-char-ram
- ld hl,8192d ;zaehler
- ld bc,0d600h ;start of VDC-chip
-
- jp test2 ;fertig? <while schleife>
- again2: ld a,d ;update-high-register
- ld (wert),a ;
- ld a,18d ;
- call sldv ;
- ld a,e ;
- ld (wert),a ;
- ld a,19d ;
- call sldv ;
- ld a,(iy) ;
- ld (wert),a ;
- ld a,31d ;
- call ldv1 ;
- inc de ;next address in char-ram of VDC
- inc iy ;next address in array charrom
- dec hl ;zaehler-1
- test2: ld a,00 ;
- cp h ;h=0?
- jp nz,again2 ;!=0 nicht fertig -> weiter
- cp l ;h=0 and l=0 ?
- jp nz,again2 ;nein -> noch eine schleife
- ret ;
-
-
- zaehlerpx: ds 1
-
- tab: ds 8
-
- tabl: ds 8
-
- aktzeiger: ds 2
-
- aktschleife: ds 1
-
- spsave: ds 1
-
- apos: ds 2 ;
-
- afpos: ds 2 ;
-
- reg25: ds 1 ;
-
- zaehler: ds 1 ;
-
- zaeh1ler: ds 1 ;
-
- save: ds 1 ;register 26
-
- memory: ds 2 ;fuer 1 registerpaar
-
- ret: ds 2 ;fuer 1 ruecksprungaddresse
-
- wert: ds 1 ;
-
- fcb: db 00 ;
-
- b1x8: db "CHARACTE" ;
-
- b9x11: db "HLP" ;
-
- b12: db 00 ;
-
- b13x31: ds 19d ;
-
- b32: db 00 ;
-
- b33: ds 1,00h
-
- b34: ds 1,00h
-
- b35: db 00h
-
-
- fcb1: db 00 ;
-
- sb1x1: ds 1,'S'
-
- sb1x2: ds 1,'C'
-
- sb1x3: ds 1,'R'
-
- sb1x4: ds 1,'E'
-
- sb1x5: ds 1,'E'
-
- sb1x6: ds 1,'N'
-
- sb1x7: ds 1,'D'
-
- sb1x8: ds 1,'P'
-
- sb9x11: db "HLP" ;
-
- sb12: db 00 ;
-
- s13x31: ds 19d ;
-
- sb32: db 00 ;
-
- sb32x35: ds 3d ;
-
- myzl: defs 1 ;myzl <=8 !
-
- flip: ds 2
-
- flop: ds 2
-
- skox: ds 2
-
- skoy: ds 2
-
- ekox: ds 2
-
- ekoy: ds 2
-
- rhl: ds 2
-
- sxret: ds 2
-
- value: ds 2
-
- address: ds 2
-
- sadd: ds 2
-
- eadd: ds 2
-
- mydma: ds 128,00h
-
- scbpb: db 1,3ch
-
- dset: db 1,00h
-
- dvalue: dw 1,0000h
-
- olddma: db 2,0000h
-
- rbc: ds 2,0000h
-
- xinv: ds 1,00h
-
- xover: ds 1,00h
-
- linv: ds 1,00h
-
- lover: ds 1,00h
-
- spvalue: ds 1,00h
-
- scradd: ds 2
-
- memstart: ds 2
-
- end
-
-
-
-