/*************************************************/
/* Verwendete Abkürzungen der ersten beiden Buchstaben
/* AG
/* AZ Anzeige
/* BA Arbeitsartenauswahl
/* BL Blockierung
/* BZ Betriebszustand
/* CD Dechiffrieren
/* CH Chiffrierung
/* CK Chiffrierung Kontrollchiffrierung
/* DH Dechiffrierung
/* DR Drucken
/* EM Empfang
/* Gl Globale Variablen
/* GT Geheimtext
/* GTSPE GTX-Speicher Empfang
/* GTSPS GTX-Speicher Senden
/* KT Klartexterstellung
/* KTSPE KTXT-Speicher Empfang
/* KTSPS KTXT-Speicher Senden
/* LZS Langzeitschlüssel
/* PP Prophylaktische Prüfung
/* SC Schlüsseleingabe
/* SE Senden
/* TA Tastatur
/* TE Test
/* TP Textprozessor
/* ZG Zufallsgenerator
/* ZP
/* ZS Zeitschlüssel
/*************************************************************/
/* Aus BArch 680 Kryptologische Analyse T-316 */
/* */
/* Das STW wird nach dem Kontrollchiffrieren und Löschen des !
/* Klartextes im Klartextspeicher Senden auf 0xfb gestellt !
/* Vor dem SENDEN wird geprüft ob STW == 0xfb ist, nur dann
/* erfolgt der Übergang.
/* Geheimtextempfang und Dechiffrieren verändert STW nicht.
/* Im Dechiffrieren wird der gültige STW bespeichert.
/* Während des Dechiffrierens und Klartext im Klartextspeicher
/* ist STW == 0, nach dem Löschen des Klartextes wird STW
/* wieder gültig gemacht (? Wert)
/*
/* CH2 STW = 0x00
/* ZSE STW = 0xfb
/* KT STW = 0xfb
/* CH1 STW = 0xfb
/*************************************************************/
/*************************************************/
/* GLOBALPARAMETER
/* SPEICHERORGANISATION
/* GL.ADSP1 0x8000 ; Dopplungs-Speicher (ADD1
/* GL.KTSPS-16 0x83f0 ; Klartextspeicher 16 bit
/* GL.KTSPS 0x8400 ; Textspeicher senden
/* GL.KTSPE 0x8800 ; Textspeicher empfangen
/* GL.GTSPT 0x8c00 ; GTX-Speicher Test erstellen
/* GL.GTSPE 0x9000 ; GTX-Speicher empfangen
/* GL.SSP 0x9400 ; Schlüsselspeicher, crc-
/* GL.PWSP 0x9600 ; Passwort Speicher, 32 byte
/* GL.LCDR 0xa000 ; LCD-RAM
/* GL.ASP 0xdc00 ; Arbeitsspeicher
/* GL.HBA 0xdc00 ; Hauptbetriebsart
/* GL.GTSPS 0x5c10 ; GTX Speicher senden (Add
/* GL.STACK ASP + 0x03de ; Stack 80 byte = 0xdfde
/* GL.BG ASP + 0x03e0 ; für Bediengerät 32 byte = 0xdfe0
/* GL.ROME 0x4000 ; EPROM Speicher Ende 12 kybte
/* GL.LIN ASP+0x03de ; Merker Kontrolle Linie = 0xdfde
/* GL.KBOX ROME - 0x400 ; letztes byte für K-Box 0x3e00
/* GL.ZSADD GTSPS + 0x3d8 ; Adresse Zusatz-Additionsreihe, 984 Byte 15*64 + 24
/* GL.RAM 0x0400 ; Länge 1kbyte für RAM-
/* RAM Merkerstellen Arbeitsspeicher
/*
/* Merkstellen RAM-Test
/*
/* TEND: LCDR + 0x03fe ; Abbruchparameter RAM-Test
/* ORG ASP
/*
/* Betriebsartenmerkerstellen
/* HBA1: def SSP(0x9400) + 0x3fff ; Hauptbetriebsarten, 0xd3ff
/* = 0 : GO
/* = 1 : MIRA
/*
/* 0xdc00 GL.HBA: Länge 1 ; entspricht Hauptbetriebsart-1 im ASP
/* 0xdc01 BARE: Länge 1 ; Betriebsartenregister
/* = 0 : KT erstellen
/* = 1 : Schlüsselwechsel
/* = 2 : GT erstellen
/* = 3 : GT senden
/* = 4 : GT senden Akustikkoppler
/*
/* Merkerstellen der Alpha-Tastatur
/* 0xdc02 ALDAT: Länge 1 ; Datenübergaberegister
/* 0xdc03 ZUALF: Länge 1 ; Zustand Alpha-Tastendruck
/* bit 0: neues Zeichen war (=1)
/* bit 1: CTL "0" war (=1)
/* bit 2: INS-Mode (=1)
/* bit 3: "Überholsperre"
/*
/* 0xdc04 ALMER: Länge 8
/* 0xdc0c ALZAL: Länge 1 ; Zähler für Zeile
/* 0xdc0d ALMEA: Länge 8
/* 0xdc15 AMER: Länge 1
/* 0xdc16 BMER: Länge 1
/* 0xdc17 CMER: Länge 1
/* 0xdc18 DMER: Länge 1 ; Zähler für Durchläufe
/* 0xdc19 TAZAL: Länge 1
/*
/* Merkerstellen des Textprozessors
/* 0xdc1a ZTP: Länge 1 ; Zustand TP
/* 0xdc1b ZADR: Länge 2 ; Aktueller Zeiger
/* 0xdc1d EADR: Länge 2 ; Ende Zeiger
/* 0xdc1f AADRT: Länge 2 ; Anfangsadresse Textspeicher
/* 0xdc21 EADRT: Länge 2 ; Endadresse Textspeicher
/* 0xdc23 TPME1: Länge 1 ; Formatierung Schlüssel 1;
/* 0xdc24 TPME2: Länge 1 ; Formatierung Schlüssel 2;
/*
/* Merkerstellen Anzeigesteuerung
/*
/* 0xdc25 ZUANZ: Länge 1 ; Zustandsanzeige
/* 0xdc26 ZUAN2: Länge 1 ; Merkerstelle für Bedienermeldungen
/* 0xdc27 ZUAN3: Länge 1 ; Einfügemode
/* 0xdc28 ANCSP: Länge 2 ; Merkerstelle für Cursor
/*
/* Merkerstellen für Schlüsselwechsel
/* 0xdc28 ALRC: Länge 2 ; Adresse CRC-Wert Register
/* 0xdc2a ALRC: Länge 2 ; Adresse CRC-Wert Register
/* 0xdc2b Länge 2 ; Speicherort CRC für Prüfung; Zeiger auf ...
/* Merkerstellen für KSS-Programme
/* 0xdc2c STW: Länge 1 ; Steuerwortregister
/*
/* Merkerstellen für PP-Programme
/* 0xdc2d CRCF: Länge 2 ; Nr. des Schlüssel
/*
/* 0xdc2e Länge 1 ; Steuerwort; 0xfb nach Kontrollchiffr. u. Löschen KTSPS Senden
/* 0x00 Klartext im KTSPE - beim Einschalten -Schlüsseleingabe
-wechsel, BA wechsel, bei PP, Klartexterstellung und Blockierung
/*
/* Merkstellen für Chiffrieren und Dechiffrieren
/* 0x3e00 KB0: H(KBOX) ; K-Box 0
/* KB3: KB0 + 3 ; K-Box 3
/* 0xdc2f ANZA1: Länge 2 ; Länge KT
/* 0xdc31 ANZB1: Länge 2 ; Anzahl ersteller Byte
/* 0xdc33 SPAD1: Länge 2 ; Zieladresse
/* 0xdc35 GN2: Länge 4 ; 64-bit Reg. Chiffrieren
/* 0xdc39 GN1: Länge 4 ; 64-bit Reg. Chiffrieren
/* 0xdc3d GN4: Länge 4 ; Register Mod-Venküpfung
/* 0xdc41 GN3: Länge 4 ; Reg. Mod-Verknüpfung
/* 0xdc45 ZSB: Länge 0x32 ; 50 byte Zeitschlüsselbereich; im Programm 0xdc42; Rundenschlüssel
/* 0xdc65 SB: Länge 0x32 ; 50 byte dto - 0xdc85
/* 0xdc52 S1 Länge 0x32 ; 50 byte Schlüssel; Kopie ! des Rundenschlüssels
/* 0xdc72 CRC-S1 Länge 4 ; CRC falsch richtig
/* 0xdc76 ; frei
/* 0xdc77 IV Länge 8 ; IV 64 bit
/* 0xdc7f CRCiv Länge 2 ; CRC des IV
/* 0xdc81 Länge 2 ; Zeiger auf Rundenschlüssel 1
/* 0xdc83 Länge 2 ; Zeiger auf Rundenschlüssel 2
/* 0xdc85 ANZA2: Länge 2 ; Länge KT; CRC, HL XOR DE
/* 0xdc87 ANZB2: Länge 2 ; Zeiger Zufallsfolgen
/* 0xdc89 SPAD2: Länge 2 ; Zieladresse
/* 0xdc8a ZUFAL: Länge 1 ; Zufallsbyte
/* 0xdc8b N2: Länge 1 ; Sigma-3 Grenzen: 0x17 > x < 0x67
/* 0xdc8c Länge 2 ; Gesamtlänge Zufallsfolgen
/* 0xdc8e Länge 1 ; Zähler Zufallsfolge 32 oder 8 bit
/* 0xdc8f N1: Länge 1 ; Speicher Zyklusanzahl
/* Übergabeparameter IN GL.G1: ; G1 Zufallsgenerator
/* Bit 7 = Fertig; 6 = Fehler ZF; 5 = ZF-Test */
/* Statussignal für Unterprogramm ZF:
/* ZF-Erzeugung 0x40 IN GL.G1 LAD
/* Konst.Folge 0x20 IN GL.G1 LAD
/* 0xdc90 GL.G1 Länge 1 ; Betriebsart Zufallsgenerator Rückgabe: bit 7, 6, 5
/* 0xdc93 N4: Länge 4 ; Reg. Mod-Verknüpfung
/* oxdc97 N3: Länge 4 ; Register Mod-Venküpfung
/* 0xdc9b ASPE: Länge 2 ; Speicher Zieladresse
/* 0xdc9d ZADE: Länge 2 ; Aktueller Zeiger GTE
/* 0xdc9f VORE: Länge 1 ; Vorbereitung X1.DCA
/* 0xdca0 HWKB: Länge 1 ; Höherwertiger Teil K-Box 0x3e00
/* 0xdca1 ADZS: Länge 2 ; Adresse Zeitschlüssel
/* 0xdca3 ADN1: Länge 2 ; Adresse N1
/* 0xdca5 ADN2: Länge 2 ; Adresse N2
/* 0xdca7 ARBS: Länge 6 ; Arbeitsspeicher löschen
/* 0xdca9 Länge 1 ; Arbeitsart Drucker
; Bit 0 Drucken = 1, Beendet = 0, Bit 1, Bit 2 = Sonderdruck, Bit 3 = Sonderdruck, Bit 4, Bit 5 = Sendepuffer Voll == 1, Bit 6 ÜBERHOLSPERRE BYTEBEREIT, Bit 7
/* 0xdcaa Länge 1 ; Sonderdruck Nr. 0, 1, 2, 3 - Abspann, 4 - GTX MIRA, 5 - GTX in 5er Gruppen
/* 0xdcab Länge 1 ; Zustandszeiger MIRA/GO?
/* 0xdcad VORC: Länge 1 ; Vorbereiten X2,DCA (s.u.)
/* 0xdcae HWKC: Länge 1 ; Länge - Anzahl der Zeichen für Druckprogramm, Achtung 2 Byte; s. 0x17bc
/* 0xdcaf ADS: Länge 2
/* 0xdcb1 AN1: Länge 2
/* 0xdcb3 AN2: Länge 2 ; Zeiger Adresse
/* 0xdcb5 ARBR: Länge 6
/* 0xdcb6 ASCII: Länge 1 ; Speicher konvertier Text, ASCII
/* 0xdcb9 Länge 2 ; Zeiger auf 0xdcb1
/*
/* Merkstellen für ZF-Folge Erzeugung
/* 0xdcbb ZFZ: Länge 2 ; Zeiger ZF-folge
/* 0xdcbd ZFL: Länge 1 ; Blocklänge
/* 0xdcbe ZFB: Länge 1 ; Erzeugtes Byte
/* 0xdcbf SIG3: Länge 1 ; Maskenzähler
/* 0xdcc0 ZFGA: Länge 2 ; Gesamtzähler
/* 0xdcc2 BITZ: Länge 1 ; Bitzähler
/* 0xdcc3 ZFZY: Länge 1 ; Anzahl der Zyklen
/* 0xdcc4 G1: Länge 1 ; Statussignal
/* ; bit 7 = 1 G1 Fertig
/* ; bit 6 = 1 Fehler ZF-1
/* 0xdcc5 GN5: Länge 4 ; Konstante C2
/* 0xdcc9 GN6: Länge 4 ; Konstante C1
/* 0xdccc SSR ; SENDESCHIEBEREGISTER
/* 0xdccd HSP1: Länge 4 ; Hilfsspeicher 32*0
/* 0xdcd1 HSP2: Länge 4 ; Hilfsspeicher 31*0. 32=1
/* 0xdcd5 N5: Länge 4 ; =GN5
/* 0xdcd9 N6: Länge 4 ; =GN6
/*
/* Empfangsmerkerregister
/* 0xdcdd ZUEM2: Länge 1 ; Zustand Empfangsdaten
/* ; = 0 Suchen und einlesen AA; 0x00
/* ; = 1 Einlesen IV
/* ; = 2 Einlesen CRC IV
/* ; = 3 Einlesen Datenlänge
/* ; = 4 Einlesen Daten
/* 0xdcde EMZA1: Länge 2 ; Datenlängenzähler
/* 0xdce0 EMZA2: Länge 2 ; Teildatenmengenzähler
/* 0xdce2 ZEIK1: Länge 6 ; Empfängerzeitkonstante
/* ZEIK2: DEF ZEIK 1+2 ; neue Zeitkonstanten-GL
/* ZEIK3: DEF ZEIK 1+4 ; Zeit zwischen 2 wechseln
/* 0xdce8 ZEMPF: Länge 1 ; Zustand Empfänger
/* ; bit 0 = 1 keine neueinstellung ZEIKONSTANTE
/* ; = 0 neueinstellung ZEIKO bei 0->1
/* ; 1 = 1 Empfänger arbeiet
/* ; 2 = 0 Kein Status IV
/* ; 3 = 0 kein Status Datenfolge
/* 0xdce9 FLANK: Länge 1 ; Letzte Empfangsflanke
/* ; FLANK = 1 : 0 -> 1 Flanke war vorher
/* ; 0 : 1 -> 0 Flanke war vorher
/* 0xdcea BIZAE: Länge 1 ; Bitzähler für Empfang
/* 0xdceb DBYTE: Länge 1 ; Datenbyte z.Zt. im Empfänger
/* 0xdcec ADREM: Länge 2 ; Empfängerzeiger
/* 0xdcee EAGTM: Länge 2 ; Ende Zeiger GT erstellen
/* 0xdcf0 EAGTG: Länge 2 ; aktuelle Endadresse GTE
/* 0xdcf2 EAKTE: Länge 2 ; Endadresse KTE (BA)
/*
/* Druckerregister
/* 0xdcf4 DRBA: Länge 1 ; Druckerbetriebsart
/* 0xdcf5 ZDR: Länge 1 ; Zustand Drucker
/* ; bit 0 : Drucker soll arbeiten (=1)
/* ; bit 1 : Drucker arbeitet
/* ; bit 2 : Sonderdruck
/* ; bit 3 : Sonderdruck im Sonderdruck
/* ; bit 4 : Schieberegister leer
/* ; bit 5 : Sendepuffer leer
/* ; bit 6 : Datenbereitstellung für (DRZE!) Lädt
/* 0xdcf6 ZDR2: Länge 1 ; Nr. des Sonderdruckes
/* 0xdcf7 ZDR3: Länge 1 ; Drucken, vor-nach chiffrieren, vor-nach dechiffrieren
/* 0xdcf8 DRADR: Länge 1 ; Druckeradresse für
/* 0xdcfa DRANZ: Länge 1 ; Druckeranzahl
/* 0xdcfc DRGTZ: Länge 1 ; Fünfergruppenzähler Drucken
/* 0xdcfd GRZAE: Länge 4 ; Gruppenzähler
/* 0xdd01 DRSR: Länge 1 ; Druckerschieberegister
/* 0xdd02 DRZEI: Länge 1 ; Sendepuffer
/* 0xdd03 DRSRZ: Länge 1 ; Druckerschieberegisterzähler
/* 0xdd04 Z69: Länge 1 ; Zeilenzeichenzähler
/* 0xdd05 BADR1: Länge 2 ; BildAdresse
/* 0xdd07 Länge 6
/* BANZ1: DEF BADR1+2 ; Bildanzahl 1
/* BADR2: DEF BADR1+4 ; Bildadresse
/* BANZ2: DEF BADR1+6 ; Bildanzahl
/*
/* Zwischenspeicher Auseinanderziehen
/* 0xdd0e EAAZ: Länge 2 ; Endadresse Auseinanderziehen
/* 0xdd10 SPAZ: Länge 2 ; Anfangsadresse Auseinanderziehen
/*
/* Merkregister Text erstellen
/* 0xdd12 EAKTS: Länge 2 ; Ende Zeiger Text-S erstellen
/*
/* Sendemerkerregister
/* BTANZ: DEF 0x08 ; bitanzahl pro byte
/* 0xdd14 ZSE: Länge 1 ; Zusand senden
/* ; = 1 Anfangsfolge FF
/* ; = 2 Folge AA
/* ; = 3 Datenblock
/* ; = 5 Endblock 00
/* ; = 6 Sendeabbruch
/* 0xdcc9 ; Gerät?
/* 0xdd15 ZSE1: Länge 1 ; Gerät?
/* ; = 0 Akustikoppler
/* ; = 1 MODEM
/* 0xdd16 ZUSE: Länge 1 ; Zustand sender
/* ; = 0 inaktiv
/* ; = 1 aktiv
/* 0xdd17 SEBIT: Länge 1 ; zu sendendes Bit
/* 0xdccc ; SENDESCHIEBEREGISTER
/* 0xdd18 SERE: Länge 1 ; Sendeschieberegister
/* 0xdd19 SENDL: Länge 1 ; Anzahl der Schwingungen
/* 0xdd1a SEZAE: Länge 1 ; Anzahl bytes pro testfolge
/* 0xdd1b SERES: Länge 1 ; Zähler der Bits pro
/* 0xdd1c SEADR: Länge 2 ; Sendeadresse bei datenM
/* 0xdc1e EAGTS: Länge 2 ; Sendeadresse GTX
/* 0xdd20 LGT: Länge 2 ; Länge GTX für Umwandlung
/* 0xdd22 AGT: Länge 2 ; Aktuelle Adresse GTX für Umwandlung
/*
/* ORG GTSPS
/* 0x5c10 GTX: Länge 0x0360 ; GTX + IV + crc (= 608byte)
/* Aufbau: IV 8byte, CRC-IV 2 byte; Länge CT 2byte; Geheimtext max 1024 Byte; CRC-GT 2byte
/*
/* ORG LCDR, Bildwiederholspeicher
/* 0xa000 Z1: Länge 16, 1. Zeilenadresse, 0xa00f ungenutzt
/* 0xa010 Z2: Länge 16, 2. Zeilenadresse, 0xa01f ungenutzt
/* 0xa020 Z3: Länge 16 .
/* 0xa030 Z4: Länge 16 .
/* 0xa040 Z5: Länge 16 .
/* 0xa050 Z6: Länge 16 .
/* 0xa060 Z7: Länge 16 .
/* 0xa070 Z8: Länge 16 .
/* 0xa080 Z9: Länge 16 .
/* 0xa090 Z10: Länge 16 10. Zeilen-Adresse, 0xa09f ungenutzt
/* 0xa0a0 Länge 20
/* 0xa0b4 AZ: Länge 20
/* 0xa0c8 ZZ: Länge 20
/* 0xa0dc END
Textcodierung T-316 entspricht Fs-ITA-II-CCITT-2
CPU-Frequenz ca 1,340 MHz
I/O Adressen laut VVS (BArch-679) IC U84C30, Z80 CTC
CTC 0: EQU 0x08 // Kanal 0 Zeitgeber Senden
CTC 1: EQU 0x09 // Kanal 1 Empfang (Grundzeit), EM (Bitlänge)
CTC 2: EQU 0x0a // Kanal 2 Drucken, EM (Wechsellängen)
CTC 3: EQU 0x0b // Kanal 3 Tastatur, Taktvorgabe ZG
CTC Kanal 0: Senden, Zeitgebermode, log 1 TC = 0x23 = 35 * 256 / 1,340 MHz = 6,7 ms
log 0 TC = 0x2d = 45 * 256 / 1,340 MHz in 8,6 ms
1: Empfangen (Grundzeit), EM (Bitlänge)
2: Drucken, EM (Wechsellängen)
3: Tastatur, Taktvorgabe Zufallsgenerator
I/O Control/Daten Steuerung PIO IC U84C20, Z80A PIO
PIO-0-A-D EQU 0x00 // PIO 0 Port A Daten, Tastatur MA
PIO-0-A-C EQU 0x02 // PIO 0 Port A Control
PIO-0-B-D EQU 0x01 // PIO 0 Port B Daten, Tastatur ME, ZG, OUTC
PIO-0-B-C EQU 0x03 // PIO 0 Port B Control, Steuerwort,Tastatur PIO 0 B
PIO-1-A-D EQU 0x04 // PIO 1 Port A Daten, Div. Signale
PIO-1-A-C EQU 0x06 // PIO 1 Port A Control, Steuerwort-PIO 1 A
PIO-1-B-D EQU 0x05 // PIO 1 Port B Daten, Sonderschnittstelle
PIO-1-B-C EQU 0x07 // PIO 1 Port B Control, Steuerwort, Sonderschnittstelle PIO 1 B
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Interruptvektorliste
CTC für Normalbetrieb
V CTC-1
CTC für Senden und ZG-Taktvorgabe
V CTC Kanal 2
............................................................
Signale PIO 0 Port A:
Bit 0: Tastatur-Steuerung (MA) (OUT) Spaltensteuerung
1-7: DTO (OUT)
Signale PIO 0 Port B:
Bit 0: Tastatur-Steuerung (ME)(IN) Zeilen-Lesen
1-5: DTO (IN)
6: ZG-Folge (IN)
7: Out-Control (GTX) (IN)
Signale PIO 1 Port A:
Bit 0: GTX-OUT (OUT)
1: DR-Out (OUT)
2: DRUCK-IN (IN)
3: Sperren Linie (OUT) 0-Aktiv
4: Takt ZG (OUT)
5: MODEM 105 (OUT) 1-aktiv
6: GTX (IN) (IN)
7: GTX(MOD) IN (IN)
Signale PIO 1 Port B:
Bit 0: Status Funk (IN)
1: Leser (IN) ?alt Lochstreifenleser?
2-6: DTO (IN)
7: Status Leser (OUT) ?alt Lochstreifenleser?
------------------------------------------------------------
ROM Bereich: 0x0000 - 0x3fff ROM 1 0x0 - 0x1fff; ROM 2 0x2000 - 0x3fff
RAM Bereich: 0x4000 - 0xdfff oder 0xffff RAM: (9k)
0x5c00 - 0x5fff RAM D10 SE oder TE, Senden oder Texteingabe
0x9000 - 0x93ff RAM D10 TE, Texteingabe, Empfangsspeicher
0xA000 - 0xA3FF RAM Bildwiederholspeicher D21/D22
0xDC00 - 0xdfff RAM D10 ständig verfügbar
Stack-Pointer: 0xdfff
Besonderheiten des SRAM 2 * KWH 32kbit
RAM Bereich 0x9400 - 0x97ff gestützter Speicher; 1kbyte; für Schlüssel, GTX
0x8000 - 0x8fff ungestützter Speicher; 4kByte
0x9000 - 0x93ff ungestützter Speicher; 1kByte
0xdc00 - 0xdfff ungestützter Speicher; 1kByte
0xa000 - 0xa3ff ungestützter Speicher; 1kByte; Bildwiederholspeicher LCD U224
0x5c00 - 0x5fff ungestützter Speicher; 1kByte;
Aufbau Bildwiederholspeicher:
1. Zeilenadrese 0xa000 - 0xa00e
0xa00f ungenutzt
2. Zeilenadrese 0xa010 - 0xa01e
3. Zeilenadrese 0xa020 - 0xa02e
...
10. Zeilenadrese 0xa090 - 0xa09e
------------------------------------------------------------
Call/Jump Adressen:
0x021c // Zeit 1sec
0x0221 // Zeitschleife 70ms
0x022b // ein Zeichen von der Tastatur
0x0235 // Schlüsselspeicher löschen, Bereich 0x8380 - 0x97ff
0x024a // CTC Kanal 3 Einschalten Tastatur CTC
0x0254 // Indikator Senden und Empfang (Ameisen)
0x0276 // Anzeige Meldung in A, System HALT
0x0294 // SCHLÜSSELFEHLER
0x02b8 // Schlüsselfehler > Sprung zur Schlüsseleingabe CTRL-Z
0x02df // NMI-Routine, ausgelöst durch Spannungsunterschreitung 4,90V
0x03be // Konverter Zahl -> Text, Übergabe A = Zahl, Rückgabe a = Text
0x0538 // Return Adresse 0x053e für IR Senden 0x061e
0x053e // Routine Senden, Int gesteuert
0x080e // Zufallsfolge
0x0815 // Init Zufallserzeugung
0x0848 // Ausschalten Zufallsgenerator
0x085f // Interruptroutine Zufallserzeugung
0x094a // Textprozessor
0x0d16 // Korrekturen
0x0d8a // Zustand Textprozessor, a und Z-Flag Rückgabe
0x0dc1 // Anzeigesteuerprogramm
0x0e2e // Umwandlungsprogramm für Anzeige
0x0f13 // LCD Speicher, Übergabe C Anzahl/Länge der einzuschreibenden Zeichen
0x103d // Bedienertexte Index angelegt
0x105a // Zeichengenerator Ziffern, Übergabe/Rückgabe in A
0x1062 // Einsprungpunkt in den Zeichengenerator Ziffern, Übergabe/Rückgabe in A
0x1071 // Anzeige BCD, Programm zur Fünfergruppenzählung
0x109a // Anzeige Befehls-Fehleranzeige
0x17a9 // Druckerprogramm
0x1804 // DRCON
0x1892 // Druckersteuerroutine
0x1a21 // Sonderdruck Nr. 1, 2, 3 - Abspann, 4 - GTX MIRA, 5 - GTX GO in 5er Gruppen
0x1a30 // RETI; Erlaube Interrupt, verlasse Int-Routine
0x1a33 // DRUCKPROGRAMM; INPUTS B = 0x00 AUSGABE L-BIT; B = 0x02 AUSGABE H-BIT
0x1a3b // Konverter T-316 - ASCII; Übergabe A = T316 Zeichen, Rückgabe A = ASCII Zeichen
0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
0x1b31 // CRC2-16 Schleife, Übergabe HL Wert, BC Länge, Rückgabe CRC in DE
0x1b3f // CRC2-16 mit Übergabe des Vektors, Übergabe DE-CRC Vektor, A Wert, Rückgabe DE CRC
0x1b5f // Lösche Bereich HL, Länge BC
0x1b69 // Rundenschlüssel für Feistel, Übergabe A, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
0x1c3d // Feistel vorwärts, Wurmerzeugung und chiffrieren PWD
0x1c40 // Feistel rückwärts, dechiffrieren PWD
0x1f58 // Kontroll-Dechiffrierung, Übergabe IX, Rückgabe A 0x00 OK, A 0xff Fehler
0x21f7 // Datenlesen IR Routine für Modem, Umprogrammieren PIO
0x22da // DATENLESEROUTINE; DLR: BER 0 EINLESEN DER CTC-STÄNDE
0x2328 // EINLESE UP FÜR CTC-STAND DER FLANKENABSTÄNDE
0x241b // KONTROLLE CRC DES IV
0x24a2 // UP ANZAHL ZUR BESTIMMUNG DER ANZAHL; GLEICHER BITS HINTEREINANDER; Übergabe HL, Rückgabe B, 0xdc99 Status
0x24c0 // PLAUSIBILITÄTSKONTROLLE DER ZÄHLER; ZÄHLER DARF NICHT KLEINER ALS 0X0002 UND NICHT GRÖßER ALS 0X01F0 SEIN;
// BA2 darf der Klartext nicht größer als 500 Zeichen sein - eingeschlossen CRC-16
0x2575 // Konverter Text - Zahl, Übergabe A = Text (A - P), Rückgabe A = Zahl (0x00 - 0x0f)
0x25b9 // Berechne CRC1 HL Startadresse, BC Länge, Rückgabe DE
0x27e2 // De-Kodieren Tasteneingabe-Hexzahlen; Übergabe (DE), Rückgabe A
0x27f3 // Korrektur/Einfügen in Zeile
0x289f // Prüfung CRC1, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
0x28b4 // Prüfe (HL) == 0x00
0x28ca // Prüfung Passwort
0x2961 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A; identisch mit 0x2ad7; rückwärts
0x299e // Passworteingabe
0x29c8 // Einsprung in die Passworteingabe -Textprozessor -> weiter Zusammenziehen -> Rundenschlüssel
0x2a29 // Ausgabe Zufalls-Passwort
0x2ad7 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A; identisch mit 0x2961; vorwärts
0x2d5d // Zusammenziehen (0x8400) Rückgabe DE (0xdcc6), 6 bit ASCII nach 8 bit
0x2f7f // Auseinanderziehen KT.ZA (0x8400); aus 8 Bit werden 6 Bit ASCII
0x323d // Sprung nach 0x3244, PP
0x3732 // BC = A, 0xff
0x396f // PP Prüfung aller Register des Z80
0x47cb //
============================================================
Interruptroutinen:
0x061e // Senden ISR
0x085f // Zufall ISR
0x0932 // Linie ISR
0x0a3b // Funktionstaste F3 Drucken GTX/Klartext aus Texteditor
0x0ba2 //
0x0ba3 //
0x1534 // Tastatur CTC-1 ISR
0x180c // Drucker ISR
0x21ea // Empfangen ISR Modem
0x22b4 // CTC ISR
0x22cd // Empfangen ISR Akustikkoppler
------------------------------------------------------------
/**********************************************************/
/* Startbereich CPU */
/* ORG 0x0000 */
/**********************************************************/
0000 01 76 76 ld bc, 0x7676 // Kaltstart
0003 56 ld d, (hl) // Sehr Trickreich: d = 0x01
0004 7E ld a, (hl) // a = 0x01
0005 66 ld h, (hl) // h = 0x01
0006 1C inc e // e = 0x01
0007 FB ei
// RST 0x08
0008 DF rst 0x18 // Weiter mit RST 0x18
// Einsprung ?
0009 09 add hl, bc
000a 1A ld a, (de)
000b F9 ld sp, hl
// Einsprung 0x004d
000c 58 ld e, b
000d 3F ccf
000e 76 halt // Warte auf Interrupt
000f 00 nop
// Endloss Schleife
// RST 0x10
0010 D7 rst 0x10 // Warte auf Interrupt
// Konstantenbereich?
0011 7F 7F 7F 7F 7F 7F 7F
// RST 18
0018 6F ld l, a // RST 0x18; HL = 0101
0019 EE 0F xor 0x0f // a = 0x01 xor 0x0f = 0x0e
001b E7 rst 0x20 // weiter mit RST 0x20
001c 7F 7F 7F 7F
// RST 0x20; Aufruf PP Kaltstart
0020 3E FF ld a, 0xff
0022 32 30 DC ld (0xdc30), a // Kennzeichen (0xdc30) == 0xff, Kaltstart
0025 C3 21 30 jp 0x3021 // Aufruf von PP, Kaltstart
// Konstantenbereich?
// RST 0x28
0028 EF rst 0x28 // Endlosschleife, warten auf Interrupt
0029 00 nop
002a F8 ret m
002b DA A8 DD jpc 0xdda8
002e 05 dec b
002f 09 add hl, bc
// RST 0x30
0030 F7 rst 0x30 // Endlosschleife, warten auf Interrupt
0031 DA 38 1F jpc 0x1f38
0034 E0 ret P0
0035 EF rst 28
0036 8F adc a, (hl)
0037 DA
// Ende Konstantenbereich ?
// RST 0x38; Anzeige Blockierung 5 HALT
0038 C3 DB 02 jp 0x02db // BLOCKIERUNG 5, HALT
// ???
003b 20 A3 jrnz 0xa3
003d 0B dec bc
003e 01 00 4F ld bc, 0x4f00
0031 CC 14 0D call z 0x0d14 // -> jr x0cd6
0044 44 ld b, h
0045 04 inc b
0046 5D ld e, l
0047 00 nop
0048 A4 and h
0049 0B dec bc
004a 0E C7 ld c, 0xc7
004c 02 ld (bc), a
004d 18 BD jr 0xbd // 0x000c
// ??
004f C7 RST 0
// Interrupt-Adressen; ausgelöst von PIO
0050 A3 0B // 0x0ba3
0052 A2 0B // 0x0ba2
0054 A2 0B // 0x0ba2
// Parameter?
0056 4A 1F
0058 98 C7
// Interrupt-Adressen; ausgelöst von PIO
005a 3B 0A // 0x0a3b; F3 Drucken aus Texteditor GTX/Klartext
// Parameter?
005c 01 18
005e 02 18
0060 B7 C7
0062 E5 07
0064 30 04
// NMI Löschung
0066 C3 DF 02 jp 0x02df // NMI-Routine, ausgelöst durch Spannungsunterschreitung 4,90V
// Initialisierungsprogramm
0069 F3 DI
006a 31 DE DF ld sp, 0xdfde // SP, GL.Stack
006d AF xor a // Lösche A, Z-Flag = 1, C-Flag = 0
006e ED 47 ld i, a // Highteil des I-Vektors ist 0x00xx
0070 21 D4 00 ld hl, 0x00d4 // HL, PIO Tabelle, PTAB
0073 16 07 ld d, 0x07 // Schleifenzähler, 7 Ports
0075 46 ld b, (hl) // Schleifenzähler Länge
// Schleife
0076 23 inc hl <-\ // Sende Werte (HL) 0x00d5 + "D"
0077 4E ld c, (hl) | // Port
0078 23 inc hl |
0079 ED B3 outir | // Init PIOs, b := b - 1, HL := HL + 1
007b 15 dec d | // 7 Parameterlisten; 7 Ports
007c 20 F7 jrnz 0xf7 >-/ // 0x0076 d > 0 Springe
007e ED 5E IM2 // InterruptModus 2
0080 C3 F2 00 jp 0x00f2 // Start, Selftest
0083 C8 retz
0084 C3 AC C8 jp 0xc8ac // Leiche?
// Achtung hier wurde getrickst!
// Der ersten Interrupt-Routine wurde ein JP vorgesetzt!
0087 C3 1E 06 jp 0x061e // Routine SENDEN
// Interrupt-Tabelle 1 für CTC
0088 1E 06 0x061e // SENDEN Ausgelöst vom CTC Kanal 0
008a B4 22 0x22b4 // Interrupt CTC Kanal 1 IR
008c 0C 18 0x180c // Interrupt CTC Kanal 2 Drucker IR
008e 34 15 0x1534 // Interrupt CTC Kanal 3 Tastatur CTC IR
// Interrupt-Tabelle 2 für CTC
0090 1E 06 0x061e // Senden IR, CTC Kanal 0
0092 1E 06 0x061e // Senden IR, CTC Kanal 1
0094 5F 08 0x085f // Zufall IR, CTC Lanal 2
0096 34 15 0x1534 // CTC IR, CTC Kanal 3
// Interrupt-Tabelle
0098 32 09 0x0932 // Linie IR - ausgelöst vom PIO 0 Port B
009a CD 22 0x22cd // Empfangen IR Akustikkoppler - ausgelöst vom PIO 1 Port A
009c EA 21 0x21ea // Empfangen IR Modem
//Parameter ROM Test
009e 00 00 // ROM Start 0x0000
00a0 A2 00 // ROM LÄNGE 0x00a2 (Ende 0x00a2)
00a2 2F E2 // Prüfsumme 0xe22f
00a4 B0 00 // Startadresse 0x00b0
00a6 52 1F // Länge 0x1f52 (Ende 0x2002)
00a8 BA 13 // Prüfsumme 0x13ba
00aa 00 20 // Startadresse 0x2000
00ac F6 1D // Länge 0x1df6 (Ende 0x3DF6)
00ae E0 DA // CRC 0xdae0
00b0 00 00 00 00 // Ende Datenbereich
0b04 00 80 // Startadresse RAMTEST ff0055aa
0b06 00 14 // Länge RAMTEST ff0055aa, 0x8000 - 0x9eff (Dopplungs-Speicher)
0b08 00 DC // Startadresse RAMTEST ff0055aa
0b0a 00 04 // Länge RAMTEST ff0055aa, 0xdc00 - 0xdfff, Arbeitsspeicher
0b0c 00 00 00 00 // Ende Datenbereich
00c0 00 5C // StartAdresse 0x5c00
00c2 00 04 // Länge 0x0400, 1024 byte
00c4 00 00 00 00 // Ende Datenbereich
00c8 00 80 // RAM Start 0x8000 Dopplungs-Speicher
00ca 00 10 // RAM Länge 0x1000, 4096 byte
00cc 00 DC // RAM Start 0xdc00, Arbeitsspeicher
00ce 00 04 // RAM Länge 0x0400, 1024 byte
00d0 00 00 00 00 // Ende Datenbereich
// L P D............. // Aufbau: Länge - Port - Daten
00d4 01 08 88 // DB 1, CTC Kanal 0, L(U CTC) Int-Adresse 0x0088 SENDEN
00d8 02 0B A7 31 // DB 2, CTC Kanal 3 Tastatur, EI, Zeitgeber, Vorteiler 256, neg. Flanke, Zeitkonstanten Start, Zählerkonstante 0x31 ZK (X ms), RESET
// 49 * 256 / 1340 kHz = 9,4 ms
// PIO 0 Port A
00dc 02 02 FF 00 // DB 2, PIO-0-A-C, 0xff Bit E/A, 0x00 a:0-7 alles Ausgänge
// Betriebsart 3, Bitweise, alles Ausgänge
// PIO 0 Port B
00df 05 03 98 FF FF F7 7F // DB 5, PIO-0-B-C, L(V PIO-0-B) Vektor = 0x0098, 0xCF Bit E/A, 0xff B: 0-7, 0xf7 Int freigegeben-UND-1-Auslösung,Bitmaskefolg: 0x7f Maske
// Int-Vektor 0x98; Betriebsart 3, bitweise, alles Eingänge, Int Maske Steuerwort 0xf7 = Int-Freigabe Eingänge -Und-Verknüpft -Kennzeichen des nächsten Wortes als Maske -Maske 0x7f Bit 0 bis 6
// PIO 1 Port A
0de6 03 06 9A FF C4 // DB 3, PIO-1-A-C, L(V PIO-1-A) Vektor = 0x009a, 0xff Bit E/A, 0xc4
// Int-Vektor 0x9a; Betriebsart 3 , bitweise, Eingänge bit: 2 6 7, Ausgänge bit: 0 1 3 4 5
// PIO 1 Port A Sende Daten
0deb 01 04 00 // DB 1, PIO-1-A-D, 0x00 Linie zu 105 ausschalten
// Sende alle Ausgänge 0
// PIO 1 Port B
0dee 02 07 FF 7B // DB 2, PIO-1-B-C, 0xCF Bit Mode, O I I I I 0 I I
// Betriebsart 3, Eingänge bit: 0 1 3 4 5 6 Ausgänge bit: 2 7
// IM 2 aktiv aus der Init Routine kommend
00f2 3E 14 ld a, 0x14 // LCD Display "SELFTEST"
00f4 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
00f7 DD 21 9E 00 ld ix, 0x009e // ROM Test
00fb FD 21 02 01 ld iy, 0x0102 // Kein Fehler springe zu 0x0102
00ff C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
// Kein Fehler ROM1
0102 C2 CB 02 jp 0x02cb // BLOCKIERUNG 1
0105 DD 21 F6 3D ld ix, 0x3df6 // ROM Test K-Box
0109 FD 21 10 01 ld iy, 0x0110 // Kein Fehler springe zu 0x0110
010d C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
// Kein Fehler ROM2
0110 C2 CB 02 jpnz 0x02cb // BLOCKIERUNG 1
0113 3E ED ld a, 0xed
0115 32 FE A3 ld (0xa3fe), a // RAM
0118 DD 21 C8 00 ld ix, 0x00c8 // RAM Test
011c FD 21 23 01 ld iy, 0x0123 // Kein Fehler springe zu 0x0123
0120 C3 00 26 jp 0x2600 // RAMTEST ff00ff55ffaa
// Kein Fehler RAM
0123 C2 CF 02 jpnz 0x02cf // Blockierung 2, RAM Fehler
0126 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
0129 01 FF 03 ld bc, 0x03ff // 1023 byte Textspeicher
012c CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
012f FB EI
0130 3E 40 ld a, 0x40 // ZF-Erzeugung
0132 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
0135 CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
0138 CD 15 08 call 0x0815 // Init Zufallserzeugung
013b 06 20 ld b, 0x20
013d 21 00 94 ld hl, 0x9400 // SSP Schlüsselspeicher, crc-
0140 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0141 B6 or (hl) <---\
0142 23 inc hl |
0143 10 FC djnz 0xfc >--/ // 32 Runden, (hl) 0x9420+n OR a
0145 B7 or a // a == 0x00
0146 CA B8 02 jpz 0x02b8 // Schlüsselfehler > Sprung zur Schlüsseleingabe CTRL-Z
0149 21 00 95 ld hl, 0x9500 // Schlüssel vorhanden
014c 22 01 83 ld (0x8301), hl // Zeiger auf 0x9500
014f 21 00 94 ld hl, 0x9400 // SSP Schlüsselspeicher, crc-
0152 01 20 00 ld bc, 0x0020 // Länge 0x20, 32 byte - 256 bit
0155 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
0158 FE FF cp 0xff // Schlüssel CRC falsch
015a CA B8 02 jpz 0x02b8 // Schlüsselfehler > Sprung zur Schlüsseleingabe CTRL-Z
015d CD CA 28 call 0x28ca // Prüfung Passwort
0160 21 C2 83 ld hl, 0x83c2 // Rundenschlüssel 1
0163 22 81 DC ld (0xdc81), hl // Zeiger auf 0x83c2, Rundenschlüssel 1
0166 21 E2 83 ld hl, 0x83e2 // Rundenschlüssel 2
0169 22 83 DC ld (0xdc83), hl // Zeiger auf 0x83e2, Rundenschlüssel 2
// Voreinstellung der Register
016c 21 00 DC ld hl, 0xdc00 // Arbeitsspeicher, Hauptbetriebsart-1; GL.HBA
016f 36 00 ld (hl), 0x00 // GO
0171 11 01 DC ld de, 0xdc01 // Betriebsartenregister: 0-KT erstellen/1-Schlüsselwechsel/2-GT erstellen/3-GTX senden
0174 01 64 00 ld bc, 0x0064 // Länge 100
0177 ED B0 ldir // Lösche (0xdc00 - 0xdc64) mit 0x00; GL.HBA
0179 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
017c 22 C6 DC ld (0xdcc6), hl // Zeiger auf 0x8400; GL.EAKTS
017f 21 00 8C ld hl, 0x8c00 // GeheimtextspeicherText (A-P)
0182 22 A2 DC ld (0xdca2), hl // Speicher Adresse in (0xdca2)
0185 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
0188 22 A4 DC ld (0xdca4), hl // Speicher Adresse in (0xdca4)
018b 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
018e 22 D2 DC ld (0xdcd2), hl // Zeiger auf 0x5c10 GTX Text Speicher
0191 3A FF 97 ld a, (0x97ff) // BA MIRA/GO
0194 32 00 DC ld (0xdc00), a // Arbeitsspeicher,Hauptbetriebsart-1 GO; GL.HBA
0197 06 0E ld b, 0x06 // Betriebsart
0199 FE 01 cp 0x01 // a == 1; Abfrage GO - MIRA
019b 28 09 jrz 0x09 // "Blockierung 2"
019d 06 0C ld b, 0x0c
019f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
01a0 32 00 DC ld (0xdc00), a // Arbeitsspeicher,Hauptbetriebsart-1 GO; GL.HBA
01a3 32 FF 97 ld (0x97ff), a // BA MIRA/GO
01a6 78 ld a, b // "BETRIEBSART 1", A = 0x0c
01a7 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
01aa CD 1C 02 call 0x021c // Zeit 1sec
01ad CD 1C 02 call 0x021c // Zeit 1sec
01b0 CD 48 08 call 0x0848 // Ausschalten Zufallsgenerator
01b3 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
01b6 CB 77 bit 6, a // Bit 6 Fehler Zufallsfolge
01b8 CA BE 01 jpz 0x01be // Menüprogramm
01bb C3 D3 02 jp 0x02d3 // BLOCKIERUNG 3, HALT
// Menüprogramm
01be 06 20 ld b, 0x20
01c0 21 46 94 ld hl, 0x9446 // Ende Schlüssel2
01c3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
01c4 B6 or (hl) <--\
01c5 23 inc hl |
01c6 10 FC djnz 0xfc >--/ // von 0x9446 - 0x9466, ergebnis An := An OR (HLn)
01c8 B7 or a
01c9 3E 03 ld a, 0x03
01cb 28 17 jrz 0x17 >--\ // a == 00 ?
01cd 21 02 95 ld hl, 0x9502 |
01d0 22 01 83 ld (0x8301), hl | // Zeiger auf 0x9502
01d3 21 46 94 ld hl, 0x9446 | // Schlüssel2
01d6 01 20 00 ld bc, 0x0020 | // Prüfung RAM 0x9446 bis 0x9465
01d9 CD 9F 28 call 0x289f | // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
01dc FE FF cp 0xff | // A == 0xff Fehler
01de 3E 03 ld a, 0x03 | // "BEREIT"
01e0 28 02 jrz 0x02 >---+ //
01e2 3E 20 ld a, 0x20 | // "BEREIT"
01e4 CD 9A 10 call 0x109a <--/ // Anzeige Befehls-Fehleranzeige
01e7 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
01ea 3A 02 DC ld a, (0xdc02) // Programmverteiler, ALDAT:-Datenübergaberegister Tastatur
01ed FE 90 cp 0x90 // CTRL T
01ef CA C0 2C jpz 0x2cc0 // Klartextstart
01f2 FE 81 cp 0x81 // CTRL E
01f4 CA 8C 21 jpz 0x218c // Empfangsroutine
01f7 FE 41 cp 0x41 // F1 Senden
01f9 CA 7F 03 jpz 0x037f // Senden
01fc FE 99 cp 0x99 // CTRL B
01fe CA 1D 03 jpz 0x031d // Betriebsartwechsel/Arbeitsartenwechsel
0201 FE 8F cp 0x8f // CTRL K Aufruf der PP
0203 CA 3A 06 jpz 0x063a // prophylaktische Prüfung
0205 FE 8E cp 0x8e // CRTL C
0207 CA 2F 20 jpz 0x202f // Chiffrieren
020a FE 89 cp 0x89 // CRTL D
020c CA 2E 2B jpz 0x2b2e // Dechiffrieren
0210 FE 91 cp 0x91 // CTRL Z
0212 CA 57 26 jpz 0x2657 // Programm Schlüsseleingabe
0215 FE 93 cp 0x93 // CRTL W
0217 CA 21 28 jpz 0x2821 // Programm Schlüsselwechsel
021a 18 CB jr 0xcb // 0x01e7
// Allgemeine Zeitschleife ca 1 sec
021c 01 00 00 ld bc, 0x0000
021f 18 03 jr 0x03 // 0x0224
// Zeitschleife 70ms
0221 01 00 10 ld bc, 0x1000 // 4096 Runden
0224 0D dec c
0225 20 FD jrnz 0xfd // 0x0224 C > 0 springe
0026 05 dec b
0228 20 FA jrnz 0xfa // 0x0224 B > 0 Springe
022a C9 ret
// ein Tastendruck
022b 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
022e CB 46 bit 0, (hl)
0230 28 F9 jrz 0xf9 // 0x022b, neues Zeichen?
0232 CB 86 res 0, (hl) // ja, Merker löschen
0234 C9 ret
// Speicherbereich löschen, Bereich 0x8380 - 0x97ff
0235 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
0237 CB 86 res 0, (hl) // neues Zeichen, gelöscht
0239 21 80 83 ld hl, 0x8380
023c E5 push hl // Registerwechsel
023d D1 pop de // DE = HL = 0x8380
023f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0240 13 inc de
0241 77 ld (hl), a
0242 01 7F 14 ld bc, 0x147f // Länge 5248 byte
0245 ED B0 ldir // Lösche von 0x8380 - 0x97ff mit 0x00
0247 C3 DB 02 jp 0x02db // Blockierung 5 auslösen
// CTC Kanal 3 Einschalten, Tastatur CTC
024a 3E A7 ld a, 0xa7 // EI, Zeitgeber, Vorteiler 256, neg. Flanke, Zeitkonst. Start, Zeitkonstante folgt, RESET
024c D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber
024e 3E 31 ld a, 0x31 // Zeitkonstante 49 * 256 / 1340 kHz = 9,4 ms
0250 D3 0B out (0x0b), a // CTC Kanal 3 Takt
0252 FB ei
0253 C9 ret
// Indikator Senden und Empfang (Ameisen)
0254 D5 push de
0255 E5 push hl
0256 F5 push af // Register retten
0257 3A C1 DC ld a, (0xdcc1)
025a 3C inc a
025b FE 0B cp 0x0b
025d 38 01 jr c, 0x01 >---\ // 0x0260, a >= 0x0b?
025f AF xor a | // Lösche A, Z-Flag = 1, carry-Flag = 0
0260 32 C1 DC ld (0xdcc1), a <---/ // (0xdcc1) zwischen 0x00 ... 0x0b
0263 21 0E A0 ld hl, 0xa00e // Speicher LCD
0266 11 10 00 ld de, 0x0010 // die nächsten 16 Adressen
0269 3C inc a
// Schleife A
026a 3D dec a <---\
026b 28 03 jr z, 0x03 >---\ | // 0x0270; A == 0x00?
026d 19 add hl, de | | // Speicher LCD
026e 18 FA jr 0xfa | >---/ // 0x026a
|
// Übergabe HL, DE, A Rückgabe (ÜbergabeHL) := A; POP hl-de-af
0270 EB ex de, hl <---/ // tausche Registerinhalt DE <> HL
0271 F1 pop af // wiederherstellen AF
0272 12 ld (de), a // Übergabe in LCD Speicher ablegen
0273 E1 pop hl // wiederherstellen HL
0274 D1 pop de // wiederherstellen DE
0275 C9 ret
// Anzeige Meldung in A, System HALT
0276 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
0279 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
027a D3 04 out (0x04), a // PIO-1-A-D
027c F3 DI
027d 76 HALT // Warte auf INT
// Kein Text -> Enter -> Menüprogramm
027e FB EI
027f CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
0282 3E 0F ld a, 0x0f // "KEIN TEXT"
0284 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// Einsprung kein Enter
0287 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
028a 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
028d FE 43 cp 0x43 // ENTER
028f 20 F6 jrnz 0xf6 // 0x0287 a != ENTER Springe
0291 C3 BE 01 jp 0x01be // Menüprogramm
// Schlüsselfehler
0294 FB EI
0295 3E 0D ld a, 0x0d // "SCHLUESSELFEHLER"
0297 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// Einsprung Kein Enter
029a CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
029d 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
02a0 FE 43 cp 0x43 // ENTER
02a2 20 F6 jrnz 0xf6 // 0x029a a != ENTER Springe
02a4 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
02a7 11 00 84 ld de, 0x8400 // Klartextspeicher; GL.KTSPS
02aa AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
02ab ED 52 sbc hl, de // Länge
02ad 28 06 jrz 0x06 // HL - DE == 0 Springe zu 0x26e0
02af 21 04 84 ld hl, 0x8404 // HL-DE <> == 0 0x8404 Klartextspeicher
02b2 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
// Länge == 0
02b5 C3 E0 26 jp 0x26e0
// Schlüsselfehler > Sprung zur Schlüsseleingabe CTRL-Z
02b8 FB EI
02b9 3E 0D ld a, 0x0d // "SCHLUESSELFEHLER"
02bb CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
02be CD 2B 02 call 0x022b <--\ // ein Zeichen von der Tastatur
02c1 3A 02 DC ld a, (0xdc02) | // ALDAT:-Datenübergaberegister Tastatur
02c4 FE 91 cp 0x91 | // CTRL Z
02c6 20 F6 jrnz 0xf6 >-/ // a != "CTRL Z" Springe
02c8 C3 7D 26 jp 0x267d // Einsprung Schlüsseleingabe
02cb 3E 00 ld a, 0x00 // Fehlermeldung: BLOCKIERUNG 1
02cd 18 A7 jr 0xa7 // 0x0276, Anzeige Meldung in A, System HALT
02cf 3E 0B ld a, 0x0b // Fehlermeldung: BLOCKIERUNG 2
02d1 18 A3 jr 0xa3 // 0x0276, Anzeige Meldung in A, System HALT
02d3 3E 1D ld a, 0x1d // Fehlermeldung: BLOCKIERUNG 3
02d5 18 9F jr 0x9f // 0x0276, Anzeige Meldung in A, System HALT
02d7 3E 1E ld a, 0x1e // Fehlermeldung: BLOCKIERUNG 4
02d9 18 9B jr 0x9b // 0x0276, Anzeige Meldung in A, System HALT
// Einsprung aus Lösche Text-Schlüsselspeicher 0x0235
02db 3E 1F ld a, 0x1f // Fehlermeldung: BLOCKIERUNG 5
02dd 18 97 jr 0x97 // 0x0276, Anzeige Meldung in A, System HALT
//NMI-Routine, ausgelöst durch Spannungsunterschreitung 4,90V
02df F3 DI
02e0 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
02e1 D3 04 out (0x04), a // PIO-1-A-D
02e3 06 0A ld b, 0x0a <-\
02e5 10 FE djnz 0xfe >-/ // 10x NULL ausgebeb PIO-1-A-D
02e7 21 80 83 ld hl, 0x8380
02ea 11 81 83 ld de, 0x8381
02ed 01 7F 04 ld bc, 0x047f // Länge
02f0 36 EE ld (hl), 0xee
02f2 ED B0 ldir // fülle 0x8380 - 0x87ff mit 0xee, %11101110
02f4 21 00 96 ld hl, 0x9600 // PWSP; Passwort Speicher, 32 byte
02f7 11 01 96 ld de, 0x9601
02fa 01 20 00 ld bc, 0x0020 // Länge 32 byte
02fd 36 EE ld (hl), 0xee
02ff ED B0 ldir // fülle 0x9600 - 0x961f mit 0xee, %11101110
0301 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
0304 11 01 88 ld de, 0x8801
0307 01 FF 03 ld bc, 0x03ff // Länge 1024 byte
030a 36 EE ld (hl), 0xee
030c ED B0 ldir // fülle 0x8800 - 0x8bff mit 0xee, Klartextspeicher empfangen
030e 21 00 DC ld hl, 0xdc00 // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
0311 11 01 DC ld de, 0xdc01 // Betriebsartenregister: 0-KT erstellen/1-Schlüsselwechsel/2-GT erstellen/3-GTX senden
0314 01 FF 03 ld bc, 0x03ff // Länge
0317 36 EE ld (hl), 0xee
0319 ED B0 ldir // fülle 0xdc00 - 0xdfff mit 0xee; GL.HBA
031b F3 DI // Sperre Interrupt!
031c 76 HALT // warte auf INT
// Wechsle der Betriebsart
031d 3E 0A ld a, 0x0a // "BETRIEBSARTWECHSEL"
031f CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
0322 CD 1C 02 call 0x021c // Zeit 1sec
// BA Wechsel Schleife
0325 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1 GO; GL.HBA
0328 06 0E ld b, 0x0e // "Betriebsart 2"
032a FE 01 cp 0x01 // a == 1
032c 28 09 jrz 0x09 // 0x0337; MIRA
032e AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0 HBA: GO
032f 32 00 DC ld (0xdc00), a // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
0332 32 FF 97 ld (0x97ff), a // BA MIRA/GO
0335 06 0C ld b, 0x0c // "BETRIEBSART 1"
// Einsprung MIRA
0337 78 ld a, b
0338 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// CTRL B ausgelöst
033b CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
033e 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
0341 FE 43 cp 0x43 // ENTER
0343 CA BE 01 jpz 0x01be // Menüprogramm -> Ende BA Wechsel
0346 FE 99 cp 0x99 // CTRL + B
0348 20 F1 jrnz 0xf1 // 0x033b a != 0xf1 springe
034a 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
034d EE 01 xor 0x01 // HBA GO
034f 32 00 DC ld (0xdc00), a // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
0352 32 FF 97 ld (0x97ff), a // BA MIRA/GO
// LÖSCHEN DER TEXTSPEICHER BEI WECHSEL BA
0355 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
0358 22 C6 DC ld (0xdcc6), hl // GL.EAKTS
035b 21 00 8C ld hl, 0x8c00 // GeheimtextspeicherText (A-P)
035e 22 A2 DC ld (0xdca2), hl // Speicher Adresse in (0xdca2)
0361 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
0364 22 D2 DC ld (0xdcd2), hl
0367 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
036a 01 FF 03 ld bc, 0x03ff
036d CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
0370 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
0373 01 FF 03 ld bc, 0x03ff
0376 CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
0379 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
037a 32 2E DC ld (0xdc2e), a // Steuerwort 0x00, nicht Chiffiert
037d 18 A6 jr 0xa6 // 0x0325; BA Wechsel Schleife
// Senden
// ÜBERGABEPARAMETER GL.EAGTS: AKTUELLE ENDADRESSE GT
// KONTROLLE OB GT VORHANDEN
037f 11 10 5C ld de, 0x5c10 // GTX Speicher senden (Add
0382 2A D2 DC ld hl, (0xdcd2) // GL.EAGTS
0385 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0386 ED 52 sbc hl, de // Länge > 0 Weiter ..
0388 20 03 jrnz 0x03 // 0x038d; A == 0
038a C3 7E 02 jp 0x027e // Kein Text -> Enter -> Menüprogramm
// Einsprung Länge <> 0
038d 3A 2E DC ld a, (0xdc2e) // Steuerwort - Chiff/Dechiff/Schlüsselwechsel
0390 FE FB cp 0xfb // Steuerwort nach Kontrollchiffr. u. Löschen KTXT?
0392 C2 7E 02 jpnz 0x027e // Kein Text -> Enter -> Menüprogramm
0395 21 1A 5C ld hl, 0x5c1a // Länge GTX
0398 46 ld b, (hl)
0399 23 inc hl // 0x5c1b zweites Byte
039a 4E ld c, (hl)
039b 0B dec bc
039c 0B dec bc // (0x5c1b, 0x5c1a) - 2; Länge ohne CRC
039d 21 85 DC ld hl, 0xdc85 // ANZA2: Länge 2; CRC
03a0 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
03a3 21 1C 5C ld hl, 0x5c1c // Startadresse GTX
03a6 CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
03a9 FE FF cp 0xff // Fehler CRC
03ab CA DB 02 jpz 0x02db // BLOCKIERUNG 5
// BETRIEBSARTENWAHL
03ae 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
03b1 FE 01 cp 0x01 // MIRA
03b3 C2 7A 04 jpnz 0x047a // GO
// GTX auf Anzeige MIRA
03b6 3E 13 ld a, 0x13 // "ANZEIGE GTX"
03b8 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
03bb CD 1C 02 call 0x021c // Zeit 1sec
// Umwandlung 8bit GTX in Text
// UMWANDLUNG des (-GTX-GTX IN ANZEIGBAREN TEXT
// ÜBERGABEPARAMETER: GL.EAGTS - ENDADRESSE GTX IM GT
// UMGEWANDELT. 4 BIT --> BST A-0000---> A BIS 1111 ---> P
// D.H: AUS 1 BYTE WERDEN 2 BYTE LÄNGE
// UND CRC-GT WERDEN AUSG
// GL.EAGTS WIRD AUF NEUE ENDADR
// GL.AGT - AKTUELLE GT ADRESSE
// GL.KLGT LÄNGE GT
03be 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
03c1 22 D6 DC ld (0xdcd6), hl // Zeiger auf 0x5c10
03c4 2A D2 DC ld hl, (0xdcd2) // Zeiger auf Endadresse GTX, GL.EAGTS
03c7 2B dec hl
03c8 2B dec hl
03c9 2B dec hl
03ca 2B dec hl // Endadresse - 4
03cb 22 D2 DC ld (0xdcd2), hl // neue Endadresse ablegen, ohne GTX CRC
03ce ED 5B D6 DC ld de, (0xdcd6) // Zeiger auf 0x5c10; Startadresse GTX
03d2 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
03d3 ED 52 sbc hl, de // Länge GTX ohne CRC
03d5 22 D4 DC ld (0xdcd4), hl // Speichern Länge GTX ohne CRC
03d8 11 0A 00 ld de, 0x000a
03db AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
03dc ED 52 sbc hl, de // Länge - 10
03de 44 ld b, h
03df 4D ld c, l // BC = Länge - 10
03e0 21 1C 5C ld hl, 0x5c1c // Startadresse GTX
03e3 11 1A 5C ld de, 0x5c1a // ohne CRC der IV
03e6 ED B0 ldir // Vor-Schieben von HL 0x5c1c nach DE 0x5c1a, BC Runden: Länge - 10
03e8 ED 4B D4 DC ld bc, (0xdcd4) // Länge GTX ohne CRC, Schleifenvariable
// Schleife BC- Textlänge, Umwandlung Zahl in Text
03ec 2A D2 DC ld hl, (0xdcd2) // Zeiger Ende GTX ohne CRC
03ef 2B dec hl // voherige Speicherzelle; Ende GTX ohne CRC - 1
03f0 ED 5B D2 DC ld de, (0xdcd2) // Zeiger Ende GTX ohne CRC
03f4 ED B8 lddr // Verschiebe von "Ende GTX-1" nach "Ende GTX", "Länge GTX-10"; --HL --DE --BC; rückwärts
03f6 ED 5B D6 DC ld de, (0xdcd6) // Zeiger auf 0x5c10; Startadresse GTX
03fa 2A D6 DC ld hl, (0xdcd6) // Zeiger auf 0x5c10; Startadresse GTX
03fd 23 inc hl // 0x5c11
03fe AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
03ff ED 6F rld // a = 0; (HL3-0) = a3-0; a = (HL7-4); (HL7-4) = (HL3-0)
0401 CD 6D 04 call 0x046d // Konvertiere Zahl -> Text, Übergabe A = Zahl, Rückgabe a = Text
0404 12 ld (de), a // de zeigt auf H-Byte
0405 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0406 ED 6F rld // a = 0; (HL3-0) = a3-0; a = (HL7-4); (HL7-4) = (HL3-0)
0408 CD 6D 04 call 0x046d // Konvertiere Zahl -> Text, Übergabe A = Zahl, Rückgabe a = Text
040b 77 ld (hl), a // hl zeigt auf Low-Byte
040c 23 inc hl // Schleife bis GTX Ende
040d 22 D6 DC ld (0xdcd6), hl // neue Adresse - nächstes Zeichen/Byte
0410 2A D2 DC ld hl, (0xdcd2)
0412 23 inc hl
0413 22 D2 DC ld (0xdcd2), hl // erhöhe Adresszeiger, nächstes Zeichen
0416 ED 4B D4 DC ld bc, (0xdcd4) // Länge
041a 0B dec bc
041b ED 43 D4 DC ld (0xdcd4), bc // Schleifenzähler
0420 79 ld a, c
0421 B0 or b
0422 20 C8 jrnz 0xc8 // 0x03ec Schleifenzähler Textlänge BC == 0
// Gewandelter GTX in Buchstabentext AA ... PP
// LÖSCHEN DER 20 STELLEN VOR GTSPS
0424 21 00 5C ld hl, 0x5c00
0427 36 00 ld (hl), 0x00
0429 11 01 5C ld de, 0x5c01
042c 01 0F 00 ld bc, 0x000f // Länge 16 byte
042f ED B0 ldir // Lösche 0x5c00 - 0x5c0f mit 0x00
0431 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0432 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck
0435 32 27 DC ld (0xdc27), a
0438 3E 02 ld a, 0x02 // AUF 2 ÄNDERN; GT-Eingabe
043a 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor
043d 3E 02 ld a, 0x02
043f 32 25 DC ld (0xdc25), a // ZUANZ: Länge 2; Zustandsanzeige
0442 3E 03 ld a, 0x03
0444 32 01 DC ld (0xdc01), a // Betriebsartenregister: 3-GTX senden
0447 3E 04 ld a, 0x04 // Zustandszeiger auf 4
0449 32 AB DC ld (0xdcab), a // Zustandszeiger MIRA/GO
044c 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
044f 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
0452 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0455 21 8F 5F ld hl, 0x5f8f
0458 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
045b 2A D2 DC ld hl, (0xdcd2) // Endadr. GTX
045e 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0461 CD 4A 09 call 0x094a // Textprozessor
// LÖSCHEN DES ANGEZEIGTEN GTX
0464 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
0467 22 D2 DC ld (0xdcd2), hl
046a C3 BE 01 jp 0x01be // Menüprogramm
// UNTERPROGRAMM BUCHSTABENDARSTELLUNG
// Konverter Zahl -> Text, Übergabe A = Zahl, Rückgabe a = Text
046d E5 push hl
046e D5 push de // Register retten
046f 21 B1 0D ld hl, 0x0db1 // Tabelle Buchstaben A ... P (0x00 ... 0x0f Darstellung)
0472 5F ld e, a
0473 16 00 ld d, 0x00
0475 19 add hl, de
0476 7E ld a, (hl)
0477 D1 pop de
0478 E1 pop hl // wiederherstellen Register
0479 C9 ret
// GTX auf Akustikkoppler oder Modem; ANZEIGE SENDEN
047a 3E 08 ld a, 0x08 // "SENDEN ?"
047c CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// EINSCHALTEN DER SPANNUNG V24 UND SENDEENDSTUFE
047f DB 05 in a, (0x05) // PIO-1-B-D; Sonderschnittstelle
0481 CB FF set 7, a // Setze Ausgang 7 auf 1
0483 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
0485 CD 21 02 call 0x0221 // Zeitschleife 70ms
0488 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0489 32 C9 DC ld (0xdcc9), a // Gerät 0 Akustik/1 Modem GN6: Länge 4 ; Konstante C1
048c 3E 04 ld a, 0x04
048e 32 01 DC ld (0xdc01), a // Betriebsartenregister: 4 Senden Akkustikkoppler
// KONTROLLE OB MODEM VORHANDEN
0491 DB 05 in a, (0x05) // PIO-1-B-D; Sonderschnittstelle
0493 CB 47 bit 0, a // Lese Eingang bit 0, IST LTG. 106 AKTIV?
0495 28 30 jrz 0x30 // 0x04c7; KEIN MODEM, MODEM aktivieren
0497 DB 04 in a, (0x04) // Lese Eingänge, PIO-1-A-D
0499 CB EF set 5, a // 105 AKTIV SCHALTEN
049b CB CF set 1, a // DATENLEITUNG AUF 1
049d D3 04 out (0x04), a // Setze auf bit 1 und 5 auf 1; PIO-1-A-D
049f 3E 01 ld a, 0x01
04a1 32 C9 DC ld (0xdcc9), a // Gerät MODEM; GN6: Länge 4 ; Konstante C1
04a4 CD 21 02 call 0x0221 // Zeitschleife 70ms; EINSCHWINGEN
04a7 DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
04a9 CB 47 bit 0, a // Eingang Bit 0 == 1
04ab 28 23 jrz 0x23 // 0x04d0; 106 IST AKTIV GREWORDEN
//FEHLERANZEIGE BEI DEFEKTEM MODEM
04ad DB 04 in a, (0x04) // Lese PIO-1-A-D
04af CB AF res 5, a // Schalte Bit 5 auf 0
04b1 D3 04 out (0x04), a // PIO-1-A-D
04b3 3E 15 ld a, 0x15 // "MODEM DEFEKT"
04b5 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
04b8 CD 1C 02 call 0x021c // Zeit 1sec
04bb CD 1C 02 call 0x021c // Zeit 1sec
04be DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
04c0 CB BF res 7, a // Setze Ausgang 7 auf 0
04c2 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
04c4 C3 BE 01 jp 0x01be // Menüprogramm
// KEIN MODEM, MODEM aktivieren
04c7 DB 04 in a, (0x04) // Lese PIO-1-A-D
04c9 CB EF set 5, a // Schalte Bit 5 auf 1
04cb D3 04 out (0x04), a // PIO-1A-D
04cd CD 21 02 call 0x0221 // Zeitschleife 70ms
// BEGINN des EIGENTLICHEN SENDENS, Umprogrammieren PIO 0 Port B
04d0 3E 17 ld a, 0x17 // Maskensteuerwort: INTERRUPT LINIE SPERREN
04d2 D3 03 out (0x03), a // umprogrammierung Tastatur PIO-0-B-C
04d4 3E FF ld a, 0xff // Alles Eingänge
04d6 D3 03 out (0x03), a // E/A Steuerwort Tastatur PIO-0-B
04d8 DB 04 in a, (0x04) // Lese PIO-1-A-D; AUSGABE ERLAUBEN
04da CB DF set 3, a // schalte Bit 3 auf 1
04dc D3 04 out (0x04), a // PIO-1-A-D
// EINSCHALTEN des PFEIFTONES
04de 3A C9 DC ld a, (0xdcc9) // An Gerät? Akustik/Modem ; GN6: Länge 4 ; Konstante C1
04e1 FE 01 cp 0x01 // a == 1
04e3 28 08 jrz 0x08 >-\ // 0x04ed, Modem
04e5 3E 15 ld a, 0x15 | // Akustik
04e7 D3 08 out (0x08), a | // CTC Kanal 0 DI, Zeitgeber, Vorteiler 16, pos. Flanke, Zeitkonst. Start, Zeitkonst. folgt
04e9 3E 23 ld a, 0x23 | // Zeitgebermodus Zeitkonstante TC = 0x23; 35 * 16 / 1340 kHz = 0,42 ms
04eb D3 08 out (0x08), a | // CTC Kanal 0 Zeitkonstante
//NEUPROGRAMMIERUNG DER CTC |
04ed 3E 21 ld a, 0x21 <-/ // DI, Zeitgeber, Vorteiler 256, neg. Flanke, Zeitkonst. Start Zeitkonst = 255
04ef D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber TA AZS; 255 * 256 / 1340 in kHz = 49 ms
04f1 21 90 00 ld hl, 0x0090
// VORBEREITUNG REGISTER FÜR SENDEN
04f4 7D ld a, l // a = 0x90;
04f6 D3 08 out (0x08), a // CTC Kanal 0 Interruptroutine 0x0090
04f8 3E 01 ld a, 0x01
04fa 32 CB DC ld (0xdccb), a
04fd 32 CD DC ld (0xdccd), a // Anz. der Schwingung; HSP1: Länge 4 ; Hilfsspeicher 32*0
04ff 32 CA DC ld (0xdcca), a
0502 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0503 32 CF DC ld (0xdccf), a
0506 32 C8 DC ld (0xdcc8), a
0509 32 CE DC ld (0xdcce), a // Anz. der Testfolgen
050c 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
050f 22 D0 DC ld (0xdcd0), hl // SENDEN
// SENDEN
0512 CD 3E 05 call 0x053e // Routine Senden, Int gesteuert
// KONTROLLE OB SENDEN BEENDET
0515 3A CA DC ld a, (0xcadc)
0518 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0519 20 FA jrnz 0xfa // 0x0515; A == 0
// SENDEN BEENDET; UMPROGRAMMIERUNG CTC
051b 21 88 00 ld hl, 0x0088 // Interruptvektor 0x0088; SENDEN
051e 7D ld a, l // a = 0x88;
051f D3 08 out (0x08), a // CTC Kanal 0 Interruptroutine 0x0088
0521 CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC; TA EIN
0524 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0525 D3 04 out (0x04), a // PIO-1-A-D; setze Ausgänge auf 0
0527 3E F7 ld a, 0xf7 // a = 0x7f; KONTROLLE LINIE ERLAUBEN
0529 D3 03 out (0x03), a // Steuerwort,Tastatur PIO-0-B-C
052b 3E 7F ld a, 0x7f // a = 0x7f
052d D3 03 out (0x03), a // Steuerwort,Tastatur PIO-0-B-C
// AUSSSCHALTEN DER SENDESPANNUNG
052f DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
0531 CB BF res 7, a // lösche bit 7, a
0533 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
// RÜCKSPRUNG IN ZENTRALPOSITION
0535 C3 BE 01 jp 0x01be // Menüprogramm
// Return Adresse 0x053e für IR Senden 0x061e
0538 21 3E 05 ld hl, 0x053e
053b E5 push hl // Adresse liegt jetzt auf dem Stack! für RET(SP)
053c ED 4D RETI // IR KETTE FREISCHALTEN
// Aufruf durch Int Routine Senden, CTC Interrupt
053E 3A CD DC ld a, (0xdccd) // Schleifenzähler --
0541 3D dec a
0542 32 CD DC ld (0xdccd), a // Schleifenzähler --
0545 C0 0E 08 RET NZ
// BEREITSTELLUNG EINES NEUEN SENDEBITS
0548 3A C9 DC ld a, (0xdcc9) // Gerät?; GN6: Länge 4 ; Konstante C1
054b FE 01 cp 0x01 // Modem?
054d 20 02 jrnz 0x02 // 0x0551 A != 0x01
054f 0E 09 ld c, 0x09 // MODEM NUTZT CTC Kanal 1
0551 3A CB DC ld a, (0xdccb) // AKTUELLES SENDEBIT
0554 06 95 ld b, 0x95 // CTC Kanal 1 EI, Zeitgeber, Vorteiler 16, pos. Flanke, Zeitkonst. Start, Zeitkonstante folgt
0556 16 2D ld d, 0x2d // ZEIKO FÜR 0; 45 * 16 * 1,34 MHz = 1389 Hz
0558 1E 0E ld e, 0x0e // DURCHLÄUFE BEI 0 (200 BIT)
055a 26 01 ld h, 0x01 // A == 0 dann H = 1
055c A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
055d 28 06 jrz 0x06 >-\ // 0x0565
055f 16 23 ld d, 0x23 | // ZEIKO FÜR 1; 35 * 16 * 1,34 MHz = 1786 Hz
0561 1E 12 ld e, 0x12 | // DURCHLÄUFE BEI 1
0563 26 00 ld h, 0x00 |
0565 ED 41 out (c), b <-/ // CTC Kanal 1 DI, Zeitgeber, Vorteiler 16, neg. Flanke, Externer Start
0567 ED 51 out (c), d // CTC Kanal 1 Timer 1,389/1,786 kHz
0569 DB 04 in a, (0x04) // Lese PIO-1-A-D
056b CB 87 res 0, a // setze Bit 4 auf 0
056d B4 or h // A = A or H; A war vorher 0 dann H = 1 sonst H = 0
056e D3 04 out (0x04), a // Toggle bit 0, PIO-1-A-D, UMSCHALTEN 103 -> Ausgabe SendeBit
0570 FB EI
0571 7B ld a, e
0572 32 CD DC ld (0xdccd), a // Anz. der Folgen
0575 3A CF DC ld a, (0xdccf) // Anz. der Folgen
0578 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0579 28 1D jrz 0x1d // 0x0598; NEUES BYTE
// NEUES BIT INNERHALB EINES BYTES
057b 3D dec a
057c 32 CF DC ld (0xdccf), a // Anzahl der Folgen
057f E6 FE and 0xfe
0581 28 0F jrz 0x0f // 0x0592
// SENDEN INFORMATIONSBIS
0583 3A CC DC ld a, (0xdccc) // SENDESCHIEBEREGISTER
0586 21 CB DC ld hl, 0xdccb
0589 36 00 ld (hl), 0x00 // Start-Bit?
058b 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
058c 32 CC DC ld (0xdccc), a // SENDESCHIEBEREGISTER
058f CB 16 rl (hl) // rotiere (HL), carry <- (HL.7) <- (HL.0) <- carry
0591 C9 ret
// SENDEN STOPPBITS
0592 3E 01 ld a, 0x01 // STOPPBIT
0594 32 CB DC ld (0xdccb), a
0597 C9 ret
// SENDEN EINES NEUEN BYTES
0598 3A C8 DC ld a, (0xdcc8) // Anz. d. Folgen
//AUSKOPPELUNG DER TEXTAUSGABE
059b FE 03 cp 0x03 // a == 3
059d 28 41 jrz 0x41 // 0x05e0
// BEARBEITEN DER FESTFOLGENAUSGABE
059f 3A CE DC ld a, (0xdcce)
05a2 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
05a3 20 32 jrnz 0x32 // 0x05d7
// Anfangskennung 16 * 0xff + 2 * 0xaa
// AUSGABE EINER NEUEN FOLGE VORBEREITEN
05a5 3A C8 DC ld a, (0xdcc8) // Anz. d. Folgen
05a8 3C inc a
05a9 32 C8 DC ld (0xdcc8), a // Anz. d. Folgen
05ac FE 03 cp 0x03 // a == 3 TEXTAUSGABE
05ae 28 30 jrz 0x30 // 0x05e0
05b0 06 FF ld b, 0xff // sendebyte 0xff
05b2 0E 10 ld c, 0x10 // 16 mal senden
05b4 FE 01 cp 0x01 // a == 1
05b6 28 17 jrz 0x17 // 0x05cf; AUSGABE 16 * 0xFF
05b8 06 AA ld b, 0xaa // sendebyte 0xaa
05ba 0E 02 ld c, 0x02 // 2 mal senden
05bc FE 02 cp 02 // a == 2
05be 28 0F jrz 0x0f // 0x05cf; AUSGABE 2 * 0xAA
05c0 FE 03 cp 0x03
05c2 28 1C jrz 0x1c // 0x05e0; AUSGABE GEHEIMTEXT
05c4 06 00 ld b, 0x00 // Abschlußkennung 0x0
05c6 0E 10 ld c, 0x10 // 16 mal senden
05c8 FE 05 cp 0x05 // a == 5
05ca 28 03 jrz 0x03 // 0x05cf
05cc C3 0A 06 jp 0x060a // SONST SENDEABBRUCH
//SENDEN VON FESTFOLGEN; NEUE FOLGE EINSTELLEN
05cf 21 CE DC ld hl, 0xdcce // Anz. d. Folgen
05d2 71 ld (hl), c // Anzahl der Wiederholung der Zeichen 0xff, 0xaa oder 0x00
05d3 21 CC DC ld hl, 0xdccc // SENDESCHIEBEREGISTER
05d6 70 ld (hl), b // zu sendendes Zeichen 0xff, 0xaa oder 0x00
//AUSGABE EINES FOLGENBYTES EINSTELLEN
05d7 3A CE DC ld a, (0xdcce) // Anz. d. Folgen
05da 3D dec a // - 1
05db 32 CE DC ld (0xdcce), a // Anz. d. Folgen
05de 18 1A jr 0x1a // 0x05fa, Programm Indikator Senden und Empfang (Ameisen)
// SENDEN des GEHEIMTEXTES
05e0 2A D0 DC ld hl, (0xdcd0) // aus Speicher 0x5c10
05e3 7E ld a, (hl) // ZU SENDENDE DATEN
05e4 32 CC DC ld (0xdccc), a // IN SENDESCHIEBEREGISTER
05e7 23 inc hl
05e8 22 D0 DC ld (0xdcd0), hl // nächstes Zeichen
05eb EB ex de, hl
05ec 2A D2 DC ld hl, (0xdcd2) // Endadresse
05ef A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
05f0 ED 52 sbc hl, de // Länge > 0?
05f2 20 06 jrnz 0x06 // 0x05fa, Programm Indikator Senden und Empfang (Ameisen)
// VORBEREITEN DER AUSGABE NEUER FOLGE
05f4 21 C8 DC ld hl, 0xdcc8 // Anz. d. Folgen
05f7 34 inc (hl)
05f8 18 00 jr 0x00 // 0x05fa, Programm Indikator Senden und Empfang (Ameisen)
// AUSGABE des STARTBITS
05fa AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0, STARTBIT
05fb 32 CB DC ld (0xdccb), a // Anz. d. Schwingungen
05fe 3A CC DC ld a, (0xdccc) // SENDESCHIEBEREGISTER
0601 CD 54 02 call 0x0254 // Indikator Senden und Empfang (Ameisen)
0604 3E 0A ld a, 0x0a // 10 BIT FOLGEN
0606 32 CF DC ld (0xdccf), a // Anz. d. Folgen; 8 Informations- + 2 Stopp-Schritte
0609 C9 ret
// SENDEABBRUCH
060a 3E 61 ld a, 0x61 // a = 0x61; RESET, DI, Zähler, neg. Flanke
060c D3 08 out (0x08), a // CTC Kanal 0 Zähler
060e D3 09 out (0x09), a // CTC Kanal 1 Zähler
0610 DB 04 in a, (0x04) // Lese PIO-1-A-D
0612 CB AF res 5, a // lösche Bit 5, a; 105 AUS
0614 D3 04 out (0x04), a // PIO-1-A-D
0616 CD 21 02 call 0x0221 // Zeitschleife 70ms; WARTE BIS 106 WEG IST
0619 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
061a 32 CA DC ld a, (0xdcca)
061d C9 ret
// Interruptroutine SENDEN
061e E5 push hl
061f D5 push de
0620 C5 push bc
0621 F5 push af // Register retten
0622 CD 38 05 call 0x0538 // ISEND; Return Adresse 0x053e für IR Senden; RETI
0625 F1 pop af
0626 C1 pop bc
0627 D1 pop de
0628 E1 pop hl // Register wiederherstellen
0629 FB EI // Interrupt wieder freigeben
062a C9 ret
// Aufruf der prophylaktischen Prüfung
062b 3E 17 ld a, 0x17 // "BITTE TASTE CR"
062c CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// Warten auf Tastendruck
0630 CD 2B 02 call 0x022b <-\ // ein Zeichen von der Tastatur
0633 3A 02 DC ld a, (0xdc02) | // ALDAT:-Datenübergaberegister Tastatur
0636 FE 9D cp 0x9d | // CTRL X
0638 20 F6 jrnz 0xf6 >-/ // 0x0630 A != 0x9d; warten auf Tastendruck
// PP Programm
// große PP: 1. EPROM-Test
// 2. RAM-Test (ohne LCD-Speicher)
// 3. ZG-Test
063a 3E 14 ld a, 0x14 // "SELBSTTEST"
063c CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
063f F3 DI
// ROM-Test
0640 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0641 32 2E DC ld (0xdc2e), a // Steuerwort 0x00, PP
0644 DD 21 9E 00 ld ix, 0x009e // ROM Test
0648 FD 21 4F 06 ld iy, 0x064f // Kein Fehler springe zu 0x064f
064c C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
064f C2 CB 02 jpnz 0x02cb // BLOCKIERUNG 1
0652 DD 21 F6 3D ld ix, 0x3df6 // Zeiger CRC Check K-Box
0656 FD 21 5D 06 ld iy, 0x065d // Kein Fehler springe zu 0x065d
065a C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
065d C2 76 02 jpnz 0x0276 // Anzeige Meldung in A, System HALT
0660 3E FF ld a, 0xff
0662 32 FE A3 ld (0xa3fe), a
0665 DD 21 B4 00 ld ix, 0x00b4
0669 FD 21 70 06 ld iy, 0x0670 // Kein Fehler springe zu 0x0670
069d C3 00 26 jp 0x2600 // RAMTEST ff00ff55ffaa
0670 C2 CF 02 jpnz 0x02cf // BLOCKIERUNG 2
0673 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
0376 36 01 ld (HL), 0x01
0678 01 FF 03 ld bc, 0x03ff
067b CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
067e FE FF cp 0xff
0680 C2 CB 02 jpnz 0x02cb // BLOCKIERUNG 1
0683 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
0686 36 00 ld (hl), 0x00
0688 01 FF 03 ld bc, 0x03ff
068b CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
068e FE FF cp 0xff
0690 CA CB 02 jpz 0x02cb // BLOCKIERUNG 1
0693 3E 00 ld a, 0x00 // Kontrolle Linie gespeert
0695 32 DE DF ld (0xdfde), a // Stack-Adresse
0698 3E 09 ld a, 0x09
069a D3 04 out (0x04), a // PIO-1-A-D
069c FB EI
069d 21 10 5C ld hl, 0x5c10 // Kontrolle GTSPS,SS,KTS, GTX Speicher senden (Add
06a0 36 55 ld (hl), 0x55
06a2 7E ld a, (hl)
06a3 FE 55 cp 0x55
06a5 CA D7 02 jpz 0x02d7 // BLOCKIERUNG 4
06a8 3E 18 ld a, 0x18 // "BITTE TASTE TE"
06aa CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
06ad CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
06b0 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
06b3 FE 44 cp 0x44
06b5 20 F6 jrnz 0xf6 // A != 0x44 Springe
06b7 3E 14 ld a, 0x14 // "SELBSTTEST"
06b9 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
06bb 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
06bf 36 55 ld (hl), 0x55
06c1 7E ld a, (hl)
06c2 FE 55 cp 0x55
06c4 CA D7 02 jpz 0x02d7 // BLOCKIERUNG 4
06c7 3E 00 ld a, 0x00 // Kontrolle Linie gespeert
06c9 32 DE DF ld (0xdfde), a // Stack-Adresse
06cc 3E 09 ld a, 0x09
06ce D3 04 out (0x04), a // PIO-1-A-D
06d0 CD 21 02 call 0x0221 // Zeitschleife 70ms
06d3 21 10 5C ld hl, 0x5c10 // Kontrolle GTSPS, SS, KTS, GTX Speicher senden (Add
06d6 36 55 ld (hl), 0x55
06d8 7E ld a, (hl)
06d9 FE 55 cp 0x55
06db C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
06de 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
06e1 36 55 ld (hl), 0x55
06e3 7E ld a, (hl)
06e4 FE 55 cp 0x55
06e6 C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
06e9 21 32 94 ld hl, 0x9432
06ec 36 55 ld (hl), 0x55
06ee 7E ld a, (hl)
06ef FE 55 cp 0x55
06f1 C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
//Kontrolle EPROM 2 offen; ROM Test
06f4 DD 21 9E 00 ld ix, 0x009e
06f8 FD 21 FF 06 ld iy, 0x06ff // kein Fehler springe zu 0x06ff
06fc C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
06ff C2 D7 02 jpnz 0x02d7 // Blockierung 4
0702 3E 00 ld a, 0x00
0704 D3 04 out (0x04), a // PIO-1-A-D
0706 3E 16 ld a, 0x16 // "BITTE TASTE SE"
0708 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
070b FB EI
070c CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
070f 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
0712 FE 41 cp 0x41
0714 20 F6 jrnz 0xf6 // a != 0x41 springe
0716 3E 14 ld a, 0x14 // "SELBSTTEST"
0718 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
071b 3E FF ld a, 0xff
017d 32 FE A3 ld (0xa3fe), a
0720 DD 21 C0 00 ld ix, 0x000c
0724 FD 21 2B 07 ld iy, 0x072b // Kein Fehler Springe zu 0x072b
0728 C3 00 26 jp 0x2600 // RAMTEST ff00ff55ffaa
// Einsprung aus IY = 0x072b, Zeile 0x0724; Übergabe Z-Flag
072b C2 CF 02 jpnz 0x02cf // BLOCKIERUNG 2
072e 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
0731 36 55 ld (hl), 0x55
0733 7E ld a, (hl)
0735 FE 55 cp 0x55
0737 CA D7 02 jpz 0x02d7 // BLOCKIERUNG 4
073a 21 00 94 ld hl, 0x9400 // Schlüsselspeicher, RAM-Test
073d 36 55 ld (hl), 0x55
073e 7E ld a, (hl)
073f FE 55 cp 0x55
0741 CA D7 02 jpz 0x02d7 // BLOCKIERUNG 4
0744 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
0747 36 55 ld (hl), 0x55
0749 7E ld a, (hl)
074a FE 55 cp 0x55
074c CA D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
074f 3E 0F ld a, 0x0f
0751 32 DE DF ld(0xdfde), a // Stack-Adresse
0754 3E 09 ld a, 0x09
0756 D3 04 out (0x04), a // PIO-1-A-D
0758 CD 21 02 call 0x0221 // Zeitschleife 70ms
075b 06 05 ld b, 0x05
075d 21 00 20 ld hl, 0x2000
0760 7E ld a, (hl)
0761 FE FF cp 0xff
0763 C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
0766 23 inc hl
0767 10 F7 djnz 0xf7
0769 3A DE DF ld a, (0xdfde)
076c FE 00 cp 0x00
076e C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
0771 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0772 D3 04 out (0x04), a // PIO-1-A-D
0774 3E 17 ld a, 0x17 // "BITTE TASTE CR"
0776 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
0779 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
077c 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
077f FE 9D cp 0x9d // CTRL X
0781 20 F6 jrnz 0xf6 // a != 0x9d springe
0783 3E 14 ld a, 0x14 // "SELBSTSTEST"
0785 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
0788 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
078b 36 55 ld (hl), 0x55
078d 7E ld a, (hl)
078e FE 55 cp 0x55
0790 CA D7 02 jpz 0x02d7 // BLOCKIERUNG 4
0793 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
0796 36 55 ld (hl), 0x55
0798 7E ld a, (hl)
0799 FE 55 cp 0x55
079b C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
079e 21 32 94 ld hl, 0x9432
07a1 36 55 ld (hl), 0x55
07a2 7E ld a, (hl)
07a3 FE 55 cp 0x55
07a5 C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
07a8 DD 21 9E 00 ld ix, 0x009e // ROM TE
07ac FD 21 B4 07 ld iy, 0x07b4 // MT0; Sprungadresse 0x07b4
07b1 C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
07b4 C2 D7 02 jpnz 0x02d7 // BLOCKIERUNG 4
// Kontrolle Linie gespeert
07b7 3E 00 ld a, 0x00
07b9 32 DE DF ld (0xdfde), a // Stack-Adresse
07bc 3E 09 ld a, 0x09 // Steuerwort
07bd D3 04 out (0x03), a // Steuerwort,Tastatur PIO-0-B
07c0 CD 21 02 call 0x0221 // Zeitschleife 70ms
07c3 3E 00 ld a, 0x00
07c5 D3 04 out (0x04), a // PIO-1-A-D
//IV Erzeugung
07c6 3E 20 ld a, 0x20 // Konst.Folge 0x20 IN GL.G1 LAD; G1 Zufallsgenerator
07c8 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
07cb CD 0E 08 call 0x080e // Zufallsfolge
07cf 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
07d2 CB 77 bit 6, a // Fehler Zufallsfolge
07d4 CA DB 02 jpz 0x02db // BLOCKIERUNG 5
07d7 3E 40 ld a, 0x40 // ZF-Erzeugung 0x40; erste Zufallsfolgen verwerfen, neu Initialisieren
07d9 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
07dc CD 0E 08 call 0x080e // Zufallsfolge
07df 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
07e2 CB 77 bit 6, a // Fehler Zufallsfolge
07e4 C2 D3 02 jpnz 0x02d3 // BLOCKIERUNG 3, HALT
07e7 21 0A 95 ld hl, 0x950a // Zeiger auf CRC Schlüssel1
07ea 11 00 95 ld de, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
07ed 01 02 00 ld bc, 0x0002 // Länge 2 Byte
07f0 ED B0 ldir // Kopiere (0x950a) > (0x9000) 2 byte, GTX-Speicher empfangen; GL.SPE
07f2 21 0C 95 ld hl, 0x950c // Zeiger auf CRC Schlüssel2
07f5 11 02 95 ld de, 0x9502
07f8 01 02 00 ld bc, 0x0002 // Länge 2 byte
07fb ED B0 ldir // Kopiere (0x950c) > (0x9502) 2byte
07fd 21 00 96 ld hl, 0x9600 // PWSP; Passwort Speicher, 32 byte
0800 11 01 96 ld de, 0x9601
0803 01 20 00 ld bc, 0x0020 // Länge 32 byte
0806 36 EE ld (hl), 0xee
0808 ED B0 ldir // fülle 0x9600 - 0x9620 mit 0xee, %1110 1110
080a F3 DI // Sperre Interrupt
080b C3 20 00 jp 0x0020 // RST 0x20, Aufruf PP Kaltstart
// Zufallsfolge
080e CD 15 08 call 0x0815 // Init Zufallserzeugung;
0811 CD 48 08 call 0x0848 // Ausschalten Zufallsgenerator
0814 C9 ret
/**********************************************************/
/* Zufallserzeugung */
/* Übergabeparameter IN GL.G1: Bit 7 = 1 Fertig */
/* 6 = 1 Fehler ZF */
/* 5 = 1 ZF-Test */
/* Statussignal für Unterprogramm ZF: */
/* ZF-Erzeugung 0x40 IN GL.G1 LAD */
/* Konst.Folge 0x20 IN GL.G1 LAD */
/* Bereitstellung der IV: */
/* Takt durch CTC Kanal 3 für G1 über PIO 1 Port A bit 4 */
/* PIO 0 Port B bit 7 übernimmt ZF von G1 */
/* PAP: 8bit Erzeugung = 1byte; 8 byte = 1 Block */
/* 256 Blöcke = 1 Testzyklus; bei Fehlerhafte */
/* bis max. 3 Zyklen möglich; dann Fehlermeldung */
/* aus fehlerfreiem Zyklus letzten 64 bit und CR */
/* */
/* Qualitätsbewertung: Ermittlung Sigma-3 Bereich d */
/* Maske 0x4d (nach jeder bit Erzeugung) mit D */
/* 0x16 > x < 0x68 (für einen Zyklus = */
/**********************************************************/
// Init Zufallserzeugung
0815 21 90 00 ld hl, 0x0090 // neuer Interrupt-Vektor
0818 7D ld a, l // a = 0x90
0819 D3 08 out (0x08), a // CTC Kanal 0 Interrupt 0x0090
081b DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
081d CB FF set 7, a // bit 7 = 1
081f D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle, Spanung für ZG
0821 CD 21 02 call 0x0221 // Zeitschleife 70ms
0824 21 00 80 ld hl, 0x8000 // Dopplungs-Speicher
0827 22 87 DC ld (0xdc87), hl // Zeiger Zufallsfolgen
082a 21 00 00 ld hl, 0x0000
082d 22 8C DC ld (0xdc82), hl // Gesamtanzahl pro Zyklus = 0x0000
0830 3E 1F ld a, 0x1f // 32, Zähler für Anzahl der Bits
0832 32 89 DC ld (0xdc89), a // SPAD2: Länge 2; Zieladresse
0835 32 8E DC ld (0xdc8e), a // Bit Zähler
0838 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0839 32 8F DC ld (0xdc8f), a // Speicher Zyklusanzahl
083c 32 8B DC ld (0xdc8b), a // Sigma-3 Grenzen: 0x17 > x < 0x67
083f 3E 87 ld a, 0x87 // EI, Zeitgeber, Vorteiler 16, neg. Flanke, Zeitkonstantenstart, Zeitkonstante folgt, RESET
0841 D3 0A out (0x0a), a // CTC Kanal 2
0843 3E 15 ld a, 0x15 // Zeitkonstante 21 * 256 / 1,340 = 4 ms
0845 D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
0847 C9 ret
// Ausschalten Zufallsgenerator
0848 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
084b CB 7F bit 7, a // bit 7 FERTIG, gesetzt in der Interrupt Routine
084d 28 F9 jrz 0xf9 // Schleife bis FERTIG; 0x0848
084f 21 88 00 ld hl, 0x0088 // Fertig: Vektor Normalbetrieb
0851 7D ld a, l // a = 0x88
0852 D3 08 out (0x08), a // CTC Kanal 0 Interruptroutine 0x0080
0854 DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
0856 CB BF res 7, a // bit 7 = 0, Prüfung Spannung aus
0858 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle, Spannung für ZG aus
085a CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
085e C9 ret
// Interruptroutine Zufallserzeugung
085f D9 exx // tausche alle Register
0860 08 ex af, af'
0861 DB 04 in a, (0x04) // Lese PIO-1-A-D, Takt G1; G1 Zufallsgenerator
0863 CB 67 bit 4, a // bit 4 == 0; xxx0 xxxx
0865 28 06 jrz 0x06 // ja: 0x086d
0867 CB A7 res 4, a // nein, bit 4 == 1; xxx1 xxxx; Lösche bit 4 -> xxx0 xxxx
0869 D3 04 out (0x04), a // PIO-1-A-D A, ausgabe xxx0 xxxx
086b 18 06 jr 0x06 // 0x0873, Zur Bitabfrage (1-0 Flanke)
// Takt G1 war 0
086d CB E7 set 4, a // xxx1 xxxx
086f D3 04 out (0x04), a // PIO-1-A-D A Ausgabe xxx1 xxxx
0871 18 30 jr 0x30 // 0x08a3; EXX - EI - RETI
// Einsprung Takt G1 war 1
0873 21 8A DC ld hl, 0xdc8a // Zufallsbyte Länge 1
0876 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
0879 CB 6F bit 5, a // Zufalls Test BA Bit 5
087b 20 0D jrnz 0x0d // 0x088a, nein;
087d 21 8A DC ld hl, 0xdc8a // Zufallsbyte Länge 1
0880 DB 01 in a, (0x01) // Lese PIO-0-B-D Zufallsbit an PIO/CTC Tastatur ME, ZG, OUTC
0882 CB 77 bit 6, a // bit 6 == 0; Zufallsbit
0884 28 04 jrz 0x04 >-\ // ja 0x088a
0886 CB C6 set 0, (hl) | // nein, 0xdc8a bit 0 = 1
0888 18 02 jr 0x02 | >-\ // 0x088c
| | // Einsprung wenn 0xdc90 BA Bit 5 = 1 war
088a CB 86 res 0, (hl)<-/ | // 0xdc8a bit 0 = 0
088c 7E ld a, (hl) <-/ // Zufallsfolge in a
088d FE 4D cp 0x4d // a == 0x4d; Maske Sigma-3-Bereich
088f 20 07 jrnz 0x07 // nein: 0x0898
0891 21 8B DC ld hl, 0xdc8b // ja: Sigma-3 Grenzen: 0x17 > x < 0x67
0894 34 inc (hl) // Maskenzähler + 1
0895 20 01 jrnz 0x01 // 0x0898, (HL) != 0
0897 35 dec (hl) // ja: Festhalten auf 255
// Sigma-3 Bereich <> 0x4d
0898 21 8E DC ld hl, 0xdc8e // nein:
089b 35 dec (hl) // 1. Schritt 32 bit fertig, 2.Schritt 8 bit fertig
089c 28 0A jrz 0x0a // 0x08a8, (0xdc8e) == 0
089e 21 8A DC ld hl, 0xdc8a // Zufallsbyte Länge 1
08a1 CB 26 sla (hl) // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0
// Einsprung Zufallsbit war 0
08a3 08 ex af, af' // Register zurücktauschen
08a4 D9 exx
08a5 FB ei
08a6 ED 4D reti
// 1 byte Fertig
08a8 36 08 ld (hl), 0x08 // HL = (0xdc8e) = 0x08
08aa 21 8A DC ld hl, 0xdc8a // Zufallsbyte Länge 1
08ad 7E ld a, (hl) // Erzeugtes Byte
08ae CB 26 sla (hl) // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0
08b0 2A 87 DC ld hl, (0xdc87) // Zeiger Zufallsfolgen
08b3 77 ld (hl), a // Zufallsbyte in Array ab (0x8000 + n)
08b4 23 inc hl // erhöhe Zeiger
08b5 22 87 DC ld (0xdc87), hl // speicher neuen Zeiger aufs Array; Zeiger Zufallsfolgen
08b8 2A 8C DC ld hl, (0xdc8c) // Gesamtzähler
08bb 23 inc hl // Gesamtzähler + 1
08bc 22 8C DC ld (0xdc8c), hl // Gesamtzähler
08bf 3A 89 DC ld a, (0xdc89) // SPAD2: Länge 2; Zieladresse; Startwert 0x1f
08c2 B7 add a, a // a = 2*a
08c3 28 06 jrz 0x06 // a == 0; 0x08cb
08c5 3D dec a // 32 runden
08c6 32 89 DC ld (0xdc89), a // SPAD2: Länge 2; Zieladresse
08c9 18 D8 jr 0xd8 // 0x08a3; EXX RETI
// 1 block fertig
08cb 3E 1F ld a, 0x1f // Anzahl/Lowadresse (32 Byte)
08cd 32 89 DC ld (0xdc89), a // Setze 0xdc89 wieder hoch auf 0x1f; SPAD2: Länge 2; Zieladresse
08d0 21 00 80 ld hl, 0x8000 // Dopplungs-Speicher
08d3 22 87 DC ld (0xdc87), hl // Zeiger Zufallsfolgen
08d6 2A 8C DC ld hl, (0xdc8c) // Gesamtzähler
08d9 01 00 08 ld bc, 0x0800 // Endwert 1 zyklus = 2048
08dc A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
08dd ED 42 sbc hl, bc // Länge = -1 ?, ende 1 Zyklus ?
08df 38 C2 jrc 0xc2 // 0x08a3; EXX RETI
// 1 Zyklus >= 16384 bit) Fertig
08e1 3A 8B DC ld a, (0xdc8b) // Sigma-3 Grenzen: 0x17 > x < 0x67
08e4 FE 17 cp 0x17 // Sigma-3 Grenzen: 0x17 > x
08e6 38 2A jrc 0x2a // nicht io
08e8 FE 67 cp 0x67 // Sigma-3 Grenzen: x < 0x67
08ea 30 26 jrnc 0x26 // nicht io
08ec 21 00 80 ld hl, 0x8000 // Quelle IV, Dopplungs-Speicher
08ef 11 77 DC ld de, 0xdc77 // Zieladr.
08f2 01 08 00 ld bc, 0x0008 // Blocklänge
08f5 ED B0 ldir // Kopie IV 0x8000 > 0xdc77 8 Byte, Dopplungs-Speicher
08f7 21 00 80 ld hl, 0x8000 // Startadresse 0x8000, Dopplungs-Speicher
08fa 01 08 00 ld de, 0x0008 // Länge 8yte
08fd CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
0900 21 7F DC ld hl, 0xdc7f // CRCiv Länge 2 ; CRC der IV
0903 72 ld (hl), d
0904 23 inc hl
0905 73 ld (hl), e // Prüfsumme in (0xdc7f, 0xdc80)
0906 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
0908 D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
090a 3E 80 ld a, 0x80 // bit 7 = 1 OK
090c 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
090f C3 A3 08 jp 0x08a3 // EXX - EI - RETI
// SIGMA 3 fehlerhaft
0912 3A 8F DC ld a, (0xdc8f) // Speicher Zyklusanzahl
0915 3C inc a
0916 FE 03 cp 0x03 // a == 3, Max. Zyklenanzahl erreicht
0918 28 10 jrz 0x10 // 0x092a
091a 32 8F DC ld (0xdc8f), a // Speicher Zyklusanzahl
091d 21 00 00 ld hl, 0x0000
0920 22 8C DC ld (0xdc8c), hl // Gesamtanzahl Rückgesetzt
0923 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0924 32 8B DC ld (0xdc8b), a // Sigma-3 Grenzen: 0x17 > x < 0x67
0927 C3 A3 08 jp 0x08a3 // EXX - EI - RETI
// mehr als 3 Zyklen, Fehler Zufallsgenerator
092a 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
092c D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
082e 3E C0 ld a, 0xc0 // Bit 7 & 6 = 1, Fehl
0930 18 DA jr 0xda
// Interruptroutine Linie
0932 F5 push af // rette AF
0933 3A DE DF ld a, (0xdfde) // Status Linie
0936 FE 0F cp 0x0f // a == 0x0f
0938 28 09 jrz 0x09 // 0x0943, TEST
// Linie unerlaubt gesendet
093a F1 pop af // wiederherstellen AF
093b E1 pop hl // Stack geradebiegen?
093c 21 DB 02 ld hl, 0x02db // BLOCKIERUNG 5
093f E5 push hl // rette HL
0940 FB ei
0941 ED 4D reti
// richtig erkannt
0943 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0944 32 DE DF ld (0xdfde), a // Status Linie
0947 F1 pop af // wiederherstellen AF
0948 18 F6 jr 0xf6 // 0x0940 - EI/RETI
/*************************************************/
/* Textprozessor
/* Benutzte Register 0xdc1a
/* ZTP: Zustand TP
/* Bit 0 = 0 Texteingabe; = 1 Schlüsseleingabe
/* 1 = 0 KT-Eingabe = 1 GT-Eingabe
/* 2 = 0 GT-Senden = 1 GT-Empfangen
/* ZADR: aktueller Zeiger
/* EADR: EndZeiger
/*
/* Übergabeparameter:
/* ALDAT: Alpha-Tastaturregister
/* AADRT: Anfangsadresse des Datenspeichers
/* EADRT: Endadressedes Datenspeichers
/***************************************************/
//Textprozessor
094a CD C1 0D call 0x0dc1 // ANZEIGESTEUERPROGRAMM 0 KT-Ausgabe, 1 Bedienerführung, 2 MIRA
094d 47 ld b, a // rette A
094e 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
0951 CB BF res 7, a // Lösche Bit 7
0953 FE 0F cp 0x0f // a == 0x0f
0955 28 0A jrz 0x0a // 0x0961
0957 3A 16 DC ld a, (0xdc16) // BMER: Länge 1
095a CB BF res 7, a // Lösche Bit 7
095c FE 0F cp 0x0f // a == 0x0f
095e 78 ld a, b // hole A zuruck, Zeile 0x04d
095f 20 29 jrnz 0x29 // 0x098a, KEINE TASTE SE
// Einsprung
0961 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor; 0 ... 7
0964 FE 02 cp 0x02 // a == 2; GT-Eingabe
0966 28 22 jrz 0x22 // 0x098a, BEI SENDEN SE ERLAUBEN
0968 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
096b CB 86 res 0, (hl) // bit neues Zeichen gelöscht
// Einsprung neue Taste
096d 3E 17 ld a, 0x17 // "BITTE TASTE CR"
096f CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
0972 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
0975 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
0978 FE 9D cp 0x9d // CTRL X
097a 20 F6 jrnz 0xf6 // 0x097a
097c 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
097f FE 06 cp 0x06 // GTX EMPFANGEN
0981 20 55 jrnz 0x55 // 0x09d8
0983 3E 02 ld a, 0x02
0985 32 25 DC ld (0xdc25), a // FORMATIERTE ANZEIGE BEI, ZUANZ:-Zustandsanzeige
0988 18 4E jr 0x4e // 0x09d8
// BESTÄTIGUNG TASTE CRTL ?
098a 47 ld b, a // rette A
098b 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
098e FE 02 cp 0x02 // A == 0x02; GT-Eingabe
0990 78 ld a, b // hole A zurück
0991 20 45 jrnz 0x45 // 0x09d8; TASTE CTRL NUR BEI SE FE
0993 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
0996 CB BF res 7, a // Lösche Bit 7
0998 FE 09 cp 0x09 // a == 9, CTRL
099a 28 1C jrz 0x1c // 0x09d8
099c 3A 16 DC ld a, (0xdc16) // BMER: Länge 1
099f CB BF res 7, a // Lösche Bit 7
09a1 FE 09 cp 0x09 // a == 9
09a3 78 ld a, b // hole A zurück, Zeile 0x98a
09a4 28 12 jrz 0x12 // 0x09d8
09a6 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
09a9 CB BF res 7, a // Lösche Bit 7
09ab FE 34 cp 0x34 // a = 0x34, TE
09ad 28 09 jrz 0x09 // 0x09d8
09af 3A 16 DC ld a, (0xdc16) // BMER: Länge 1
09b2 CB BF res 7, a // Lösche Bit 7
09b4 FE 34 cp 0x34 // a == 0x34, TE
09b6 20 20 jrnz 0x20 // 0x09d8
09b8 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
09bb CB 86 res 0, (hl) // bit neues Zeichen gelöscht
09bd 3E 16 ld a, 0x16 // "BITTE TASTE SE"
09bf CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
// Schleife Abfrage Taste SE
09c2 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
09c5 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
09c8 FE 41 cp 0x41 // TASTE SE
09ca 20 F6 jrnz 0xf6 // 0x09c2
09cc 3E 02 ld a, 0x02
09ce 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
09d1 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
09d4 CB 86 res 0, (hl) // bit neues Zeichen gelöscht
09d6 18 21 jr 0x21 // 0x09f9
// Einsprung aus Textprozessor
09d8 3A 1A DC ld a, 0xdc1a // ZTP:Zustand TextProzessor
09db FE 06 cp 0x06 // GT-Empfangen
09dd 20 1A jrnz 0x1a // 0x09f9
09df 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
09e2 CB BF res 7, a // Lösche Bit 7
09e4 FE 34 cp 0x34 // a == 0x34, TE
09e6 28 09 jrz 0x09 // 0x09f1
09e8 3A 16 DC ld a, (0xdc16) // BMER: Länge 1
09eb CB BF res 7, a // Lösche Bit 7
09ed FE 34 cp 0x34 // a == 0x34, TE
09ef 20 08 jrnz 0x08 // 0x09f9
09f1 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
09f4 CB 86 res 0, (hl) // bit neues Zeichen gelöscht
09f6 C3 6D 09 jp 0x096d // Schleife Tastenabfrage
// Einsprung Taste SE
09f9 3A 03 DC ld a, (0xdc03) // ZUALF:-Zustand Alpha-Tastendruck
09fc CB 47 bit 0, a // bit neues Zeichen abgefragt
09fe 20 0A jrnz 0x0a // 0x0a0a
0a00 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0a01 32 15 DC ld (0xdc15), a // AMER: 0
0a04 32 16 DC ld (0xdc16), a // BMER: 0
0a07 C3 4D 09 jp 0x094d
// Einsprung
0a0a CB 87 res 0, a // bit neues Zeichen gelöscht
0a0c 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck
0a0f 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
0a12 FE 43 cp 0x43 // ENTER
0a14 20 25 jrnz 0x20 // 0x0a3b, F3 Drucken aus Editor GTX/Klartext
0a16 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a19 FE 00 cp 0x00 // Texteingabe
0a1b CA 4D 09 jpz 0x094d
0a1e 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a21 CB 4F bit 1, a // Schlüsseleingabe
0a23 C8 ret z
// ENDE BEI GT-EINGABE NUR BEI VOLLER 5-GRUPPE
0a24 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0a27 EB ex de, hl
0a28 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0a2b A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0a2c ED 52 sbc hl, de // Länge == 0?
0a2e C8 ret z // KEIN TEXT
0a2f 11 05 00 ld de, 0x0005
0a32 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0a33 ED 52 sbc hl, de // Länge == 0?
0a35 C8 ret z // Kein Text
0a36 30 FA jrnc 0xfa // 0x0a32
0a38 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung aus ISR Liste; 0x0050 Funktionstaste Drucken GTX/Klartext
// Übergabe A
0a3b FE 44 cp 0x44 // F3 IST ENDETASTE BEI T-31x
0a3d 20 09 jrnz 0x09 // 0x0a48
0a3f 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a42 FE 00 cp 0x00 // Texteingabe
0a44 C8 ret z // ABER NUR DORT
0a45 C3 4D 09 jp 0x094d // Schleife Textprozessor
//AUSDRUCKEN DER DATEN
0a48 FE 83 cp 0x83 // CTRL + A Drucken
0a4a 20 19 jrnz 0x19 // 0x0a65
0a4c 3A 01 DC ld a, (0xdc01) // Betriebsartenregister: 0-KT erstellen/1-Schlüsselwechsel/2-GT erstellen/3-GTX senden
0a4f FE 01 cp 0x01 // Betriebsart Schlüsselwechsel?
0a51 CA 4A 09 jpz 0x094a // Textprozessor
0a54 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a57 FE 08 cp 0x08
0a59 CA 4A 09 jpz 0x094a // Textprozessor
0a53 CD A9 17 call 0x17a9 // Druckerprogramm
0a56 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0a60 D3 04 out (0x04), a // PIO-1-A-D
0a62 C3 4A 09 jp 0x094a // Textprozessor
0a65 FE 03 cp 0x03
0a67 20 09 jrnz 0x09 // 0x0a72
0a69 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a6c FE 02 cp 0x02 // GT-Eingabe
0a6e 3E 03 ld a, 0x03 // a == 3
0a70 28 EA jrz 0xea // 0x0a5c
0a72 FE 92 cp 0x92 // CTRL + L? Textprozeß
0a74 20 14 jrnz 0x14 // 0x0a8a
0a76 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a79 CB 47 bit 0, a // Texteingabe
0a7b C2 4A 09 jpnz 0x094a // Textprozessor
0a7e 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0a81 22 1B DC ld (0dc1b), hl // ZADR: Länge 2 ; Aktueller Zeiger
0a84 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0a87 C3 4A 09 jp 0x094a // Textprozessor
0a8a 47 ld b, a
0a8b 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a8e CB 47 bit 0, a // Texteingabe
0a90 78 ld a, b
0a91 C2 6A 0B jpnz 0x0b6a
0a94 FE 85 cp 0x85 // a == 0x85, CTRL + S?
0a96 28 0D jrz 0x0d // 0x0aa5
0a98 FE 05 cp 0x05
0a9a 20 12 jrnz 0x12 // 0x0aae
0a9c 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0a9f FE 02 cp 0x02 // GT-Empfangen
0aa1 3E 05 ld a, 0x05
0aa3 20 09 jrnz 0x09 // 0x0aae
0aa5 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0aa8 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0aab C3 4A 09 jp 0x094a // Textprozessor
// Einsprung GT-Empfangen
0aae FE 99 cp 0x99 // a == 0x99, CTRL + B ?
0ab0 28 0D jrz 0x0d // 0x0abf
0ab2 FE 19 cp 0x19
0ab4 20 12 jrnz 0x12 // 0x0ac8
0ab6 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0ab9 FE 02 cp 0x02 // GT-Empfangen
0abb 3E 19 ld a, 0x19
0abd 20 09 jrnz 0x09 // 0x0ac8
0abf 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0ac2 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0ac5 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung
0ac8 FE 9E cp 0x9e // a == 0x9e, CTRL + V? Sprung vorn Textprozeß
0aca 28 0D jrz 0x0d // 0x0ad9
0acc FE 1E cp 0x1e
0ace 20 4E jrnz 0x4e // 0x0b1e
0ad0 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0ad3 FE 02 cp 0x02 // GT-Empfangen
0ad5 3E 1E ld a, 0x1e
0ad7 20 45 jrnz 0x45 // 0x0b1e
0ad9 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0adc CB 4F bit 1, a // Schlüsseleingabe
0ade 20 1B jrnz 0x1b // 0x0afb
0ae0 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0ae3 11 14 00 ld de, 0x0014
0ae6 19 add hl, de
0ae7 EB ex de, hl
0ae8 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0aeb A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0aec ED 52 sbc hl, de // Länge == -1?
0aee 30 04 jrnc 0x04 // 0x0af4
0af0 ED 5B 1D DC ld de, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0af4 EB ex de, hl
0af5 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0af8 C3 4A 09 jp 0x094a // Textprozessor
0afb 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0afe 11 0A 00 ld de, 0x000a
0b01 19 add hl, de
0b02 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0b05 ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0b09 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b0a ED 52 sbc hl, de // Länge
0b0c CD 71 10 call 0x1071 // Anzeige BCD, Programm zur Fünfergruppenzählung
0b0f 7D ld a, l
0b10 E6 0F and 0x0f
0b12 CB 3F srl a // schiebe A, 0 -> A7 -> A0 -> carry
0b14 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0b17 3C inc a
0b18 3D dec a // trick, prüfe ob FF
0b19 28 CC jrz 0xcc // 0x0ae7
0b1b 2B dec hl
0b1c 18 FA jr 0xfa // 0x0b18
0b1e FE 8A cp 0x8a // a == 0x8a, CTRL + R? Textprozeß
0b20 28 0D jrz 0x0d // 0x0b2f
0b22 FE 0A cp 0x0a
0b24 20 44 jrnz 0x44 // 0x0b6a
0b26 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0b29 FE 02 cp 0x02 // GT-Empfangen
0b2b 3E 0A ld a, 0x0a
0b2d 20 3B jrnz 0x3b // 0x0b6a
0b3f 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0b42 CB 4F bit 1, a // Schlpsseleingabe
0b44 20 1D jrnz 0x1d // 0x0b53
0b46 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0b49 11 14 00 ld de, 0x0014
0b4c A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b4d ED 52 sbc hl, de // Länge
0b4f EB ex de, hl // Tausche Inhalte HL <> DE
0b40 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0b43 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b44 ED 52 sbc hl, de // Länge == -1?
0b46 38 04 jrc 0x04 // 0x0b4c
0b48 ED 5B 1F DC ld de (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0b4c ED 53 1B DC ld (0dc1b), de // ZADR: Länge 2 ; Aktueller Zeiger
0b50 C3 4A 09 jp 0x094a // Textprozessor
0b53 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0b56 11 0A 00 ld de, 0x000a
0b59 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b5a ED 52 sbc hl, de // Länge
0b5c ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0b60 EB ex de, hl // Tausche Inhalt DE <> HL
0b61 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b62 ED 52 sbc hl, de // Länge
0b64 EB ex de, hl // Tausche Inhalt DE <> HL
0b65 DA 02 0B jpc 0x0b02 // Länge war -1?
0b68 18 DE jr 0xde // 0x0b48
0b6a FE 8D cp 0x8d // CTRL + F? Textprozeß
0b6c 20 0B jrnz 0x0b // 0x0b79
0b6e 3A 2A DC ld a, (0xdc2a) // ALRC:-Adresse CRC-Wert Register
0b71 EE 01 xor 0x01 // Lösche Bit 0 von (0xdc2a)
0b73 32 2A DC ld (0xdc2a), a // ALRC:-Adresse CRC-Wert Register
0b76 C3 4A 09 jp 0x094a // Textprozessor
// CURSORSTEUERUNGSTASTEN
0b79 CB 7F bit 7, a
0b7b C2 4A 09 jpnz 0x094a // Textprozessor
0b7e FE 42 cp 0x42 // LEFT
0b80 20 39 jrnz 0x39 // 0x0bbb
0b82 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0b85 EB ex de, hl
0b86 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0b89 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0b8c CB 47 bit 0, a // Texteingabe
0b8e 28 04 jrz 0x04 // 0x0b94
0b90 23 inc hl
0b91 23 inc hl
0b92 23 inc hl
0b93 23 inc hl // hl + 4
0b94 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0b95 ED 52 sbc hl, de // Länge == 0
0b97 28 1B jrz 0x1b // 0x0bb4
0b99 CD 8A 0D call 0x0d8a // Zustand Textprozessor, a und Z-Flag Rückgabe
0b9c 28 15 jrz 0x15 // 0x0bb3
0b9f FE 04 cp 0x04 // a <> 4
0ba0 20 11 jrnz 0x11 // 0x0bb3
// Einsprung aus ISR-Liste; 0x0050
// Übergabe über DE
0ba2 D5 push de // retten DE für Registerwechsel
// Einsprung aus ISR Liste; 0x0050
// Übergabe über DE
0ba3 1B dec de
0ba4 1B dec de
0ba5 1B dec de
0ba6 1B dec de // hl - 4
0ba7 2A 1F DC ld hl (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0baa 2B dec hl
0bab A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0bac ED 52 sbc hl, de // Länge
0bae E1 pop hl // HL = DE
0baf 20 02 jrnz 0x02 // 0x0bb3; Länge > 0
0bb1 EB ex de, hl // Tausche Inhalt DE <> HL
0bb2 13 inc de // Länge == 0 (indirekt HL + 1)
// Länge > 0
0bb3 1B dec de // Länge > 0 (indirekt HL -1), Länge == 0 HL unverändert!
0bb4 EB ex de, hl // Rücktausch Inhalt DE <> HL
0bb5 22 1B DC ld (0xdc1b) hl // ZADR:-Aktueller Zeiger-TextProzessor
0bb8 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung Cursorsteuerung Tasten, 0x0b80
0bbb FE 40 cp 0x40 // a <> 0x40, RIGHT
0bbd 20 2D jrnz 0x2d // 0x0bec
0bbf 2A 1B DC ld hl (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0bc2 EB ex de, hl
0bc3 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0bc6 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0bc7 ED 52 sbc hl, de // Länge == 0
0bc9 CA 4A 09 jpz 0x094a // Textprozessor
0bcc CD 8A 0D call 0x0d8a // Zustand Textprozessor, a und Z-Flag Rückgabe
0bcf 28 08 jrz 0x08 // 0x0bd9
0bd1 FE 08 cp 0x08 // a <> 8
0bd3 20 04 jrnz 0x04 // 0x0bd9
0bd5 13 inc de
0bd6 13 inc de
0bd7 13 inc de
0bd8 13 inc de
0bd9 13 inc de // de + 5
0bda 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0bdd A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0bde ED 52 sbc hl, de // Länge
0be0 EB ex de, hl // Tausche Inhalt DE <> HL
0be1 30 03 jrnc 0x03 // 0x0be6
0be3 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0be6 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0be9 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung Cursorsteuerung Tasten 0x0bbd
0bec 47 ld b, a
0bed 3A 01 DC ld a, (0xdc01) // Betriebsartenregister
0bf0 FE 03 cp 0x03 // Betriebsart GT Senden
0bf2 78 ld a, b
0bf3 CA 4A 09 jpz 0x094a // Textprozessor; KEIN ÄNDERN BEIM SENDEN
// BEARBEITUNG DEL (LÖSCHEN LINKS VOM CURSOR)
0bf6 FE 45 cp 0x45 // DEL
0bf8 20 79 jrnz 0x79 // 0x0c73
0bfa 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0bfd EB ex de, hl
0bfe 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0c01 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0c02 ED 52 sbc hl, de // Länge == 0
0c04 CA 4A 09 jpz 0x094a // Textprozessor
0c07 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0c0a CB 47 bit 0, a // Texteingabe
0c0c 28 41 jrz 0x41 // 0x0c4f
// BEI SCHLÜSSELEINGABE NUR LETZTES ZEICHEN AUSBLENDEN
0c0e 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0c11 EB ex de, hl
0c12 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0c15 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0c16 ED 52 sbc hl, de // Länge > 0
0c18 C2 4A 09 jpnz 0x094a // Textprozessor
// AUSBLENDEN UNTER BERÜCKSICHTIGUNG DER FORMIERUNG
0c1b CD 8A 0D call 0x0d8a // Zustand Textprozessor, a und Z-Flag Rückgabe
0c1e EB ex de, hl
0c1f FE 05 cp 0x05
0c21 20 21 jrnz 0x21 // 0x0c44
0c23 3A 24 DC ld a, (0xdc24) // TPME2:-Formatierung Schlüssel
0c26 D6 01 sub 0x01
0c28 27 daa // BCD korrektur
0c29 32 24 DC ld (0xdc24), a // TPME2:-Formatierung Schlüssel
0c2c 06 04 ld b, 0x04
0c2e 2B dec hl
0c2f 36 04 ld (hl), 0x04
0c31 10 FB djnz 0xfb // 0x0c2e
// Einsprung Schlüsselformatierung 0x0c4d
0c33 2B dec hl
0c34 3A 23 DC ld a, (0xdc23) // TPME1:-Formatierung Schlüssel
0c37 3D dec a
0c38 32 23 DC ld (0xdc23), a // TPME1:-Formatierung Schlüssel
0c3b 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0c3e 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0c41 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung Ausblenden Formatierung, 0x0c21
0c44 FE 08 cp 0x08
0c46 20 EB jrnz 0xeb // 0x0c33
0c48 3E 04 ld a, 0x04
0c4a 32 23 DC ld (0xdc23), a // TPME1:-Formatierung Schlüssel
0c4d 18 E4 jr 0xe4 // 0x0c33
// Einsprung Bearbeiten DEL Löschen links vom Cursor
0c4f 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0c52 E5 push hl // retten HL, GL.ZADR
0c53 EB ex de, hl
0c54 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0c57 E5 push hl // retten HL GL.EADR
0c58 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0c59 ED 52 sbc hl, de // Länge == 0
0c5b 28 07 jrz 0x07 // 0x0c64
0c5d E5 push hl // Registerwechsel
0c5e C1 pop bc // BC = HL, Länge
0c5f D5 push de // Registerwechsel
0c60 E1 pop hl // HL = DE
0c61 1B dec de
0c62 ED B0 ldir // Kopiere von HL nach DE, Länge BC
0c64 E1 pop hl // GL.EADR, wiederherstellen HL
0c65 2B dec hl
0c66 36 04 ld (hl), 0x04 // ZWR
0c68 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0c6b E1 pop hl // GL.ZADR, wiederherstellen HL
0c6c 2B dec hl
0x67 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0c70 C3 4A 09 jp 0x094a // Textprozessor
// BEARBEITUNG INFORMATIONSTASTEN
0c73 21 1A DC ld hl, 0xdc1a // ZTP:Zustand TextProzessor
0c76 CB 46 bit 0, (hl) // Texteingabe-Schlüssleingabe
0c78 CA 05 0D jpz 0x0d05
// KONTROLLE GÜLTIGER ZEICHEN BEI SCHLÜSSELEINGABE
0c7b 21 A7 0D ld hl, 0x0da7
0c7e 01 10 00 ld bc, 0x0010
0c81 ED B1 cpir // BC == 0? oder a == (HL)
0c83 C2 4A 09 jpnz 0x094a // Textprozessor; FALSCHES ZEICHEN
0c86 2A 1B DC ld hl (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0c89 EB ex de, hl
0c8a 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0c8d A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0c8e ED 52 sbc hl, de // Länge > 0
0c90 C2 64 0D jpnz 0x0d64 //
0c93 F5 push af // retten AF
0c94 3A 23 DC ld a, (0xdc23) // TPME1:-Formatierung Schlüssel
0c97 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0c98 20 2F jrnz 0x2f // 0x0cc9
// EINFÜGEN DER ZAHLENKOMBINATION
0c9a 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0c9d 36 04 ld (hl), 0x04 // ZWR
0c9f 23 inc hl
0ca0 3A 24 DC ld a, (0xdc24) // TPME2:-Formatierung Schlüssel
0ca3 C6 01 add a, 0x01
0ca5 27 daa // BCD korrektur
0ca6 32 24 DC ld (0xdc24), a // TPME2:-Formatierung Schlüssel
0ca9 CB 67 bit 4, a // bit 4 == true
0cab 36 36 ld (hl), 0x36 // NULL
0cad 28 02 jrz 0x02 // 0x0cb1
0caf 36 37 ld (hl), 0x37 // EINS
0cb1 23 inc hl
0cb2 E6 0F and 0x0f
0cb4 E5 push hl // retten HL
0cb5 21 A7 0D ld hl, 0x0da7
0cb8 06 00 ld b, 0x00
0cba 4F ld c, a
0cbb 09 add hl, bc // hl von 0x0da7 - 0x0x0db6
0cbc 7E ld a, (hl) // a mit dem inhalt der Zeichentabelle 0 ... f
0cbd E1 pop hl // wiederherstellen HL
0cbe 77 ld (hl), a
0cbf 23 inc hl
0cc0 36 04 ld (hl), 0x04 // ZWR
0cc2 23 inc hl
0cc3 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0cc6 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
// Einsprung Kontrolle Gültige Zeichen 0x0c98
0cc9 3A 23 DC ld a, (0xdc23) // TPME1:-Formatierung Schlüssel
0ccc 3C inc a
0ccd FE 05 cp 0x05
0ccf 20 01 jrnz 0x01 // 0x0cd2
0cd1 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
// Funktion nicht 0x05
0cd2 32 23 DC ld (0xdc23), a // TPME1:-Formatierung Schlüssel
0cd5 F1 pop af // wiederherstellen AF
// Einsprung
0cd6 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0cd9 EB ex de, hl
0cda 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0cdd A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0cde ED 52 sbc hl, de // Länge > 0
0ce0 20 34 jrnz 0x34 // 0x0d16; EINFÜGEN USW:
0ce2 D5 push de // Registerwechsel
0ce3 E1 pop hl // HL = DE
0ce4 77 ld (hl), a
0ce5 2A 21 DC ld hl, (0xdc21) // EADRT:-Endadresse Textspeicher
0ce8 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0ce9 ED 52 sbc hl, de // Länge == 0
0ceb 28 0B jrz 0x0b // 0x0cf8
0ced 13 inc de
0cee EB ex de, hl
0cef 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0cf2 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0cf5 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung Länge == 0
0cf8 3E 02 ld a, 0x02
0cfa 32 23 DC ld (0xdc23), a // TPME1:-Formatierung Schlüssel
0cfd 3E 15 ld a, 0x15
0cff 32 24 DC ld (0xdc24), a // TPME2:-Formatierung Schlüssel
0d02 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung bearbeitung Informationstasten
0d05 CB 4E bit 1, (hl) // bit 1 == true
0d07 28 CD jrz 0xcd // 0x0cd6; KEINE GT-EINGABE
// BEI GT-EINGABE NUR BUCHSTABEN A...P
0d09 21 B1 0D ld hl, 0x0db1
0d0b 01 10 00 ld bc, 0x0010
0d0f ED B1 cpir // BC == 0? oder a == (HL)
0d11 C2 4A 09 jpnz 0x094a // Textprozessor
0d14 18 C0 jr 0xc0 // 0x0cd6
//KORREKTUREN
0d16 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
0d19 CB 56 bit 2, (hl) // bit 2 == true, bit INSERT Mode
0d1b 28 31 jrz 0x31 // 0x0d4e; ÜBERSCHREIBEN
// INS-MODE; Insert
0d1d 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0d20 E5 push hl // rette HL; 1
0d21 EB ex de, hl // DE = HL
0d22 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0d25 E5 push hl // rette HL; 2
0d26 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d27 ED 52 sbc hl, de // Länge
0d29 E5 push hl // rette HL, 3
0d2a C1 pop bc // BC = HL, Länge; -3
0d2b 03 inc bc
0d2c 2A 21 DC ld hl, (0xdc21) // EADRT:-Endadresse Textspeicher
0d2f EB ex de, hl // Tausche Inhalt DE <> HL; HL alten zeiger 0xdc1b, DE zeiger 0xdc21
0d30 E1 pop hl // EADR; -2 HL = zeiger 0xdc1d
0d31 E5 push hl // rette HL; 2
0d32 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d33 ED 52 sbc hl, de // Länge > 0
0d35 20 04 jrnz 0x04 // 0x0d3b; Zurückladen
// LETZTES ZEICHEN verwerfen
0d37 0B dec bc // 1 ZEICHEN WENIGER UMLADEN
0d38 E1 pop hl // wiederherstellen HL; -2
0d39 2B dec hl
0d3a E5 push hl // rette Hl; 2
// ZURÜCKLADEN
0d3b E1 pop hl // wiederherstellen HL; -2
0d3c 54 ld d, h
0d3d 5D ld e, l // DE = HL
0d3e 23 inc hl
0d3f 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
0d42 EB ex de, hl // Tausche Inhalt DE <> HL
0d43 ED B8 lddr // verschiebe rückwärts HL > DE, bc-- , hl--, de--
0d45 E1 pop hl // GL.ZADR; wiederherstellen HL; -1 Zeiger 0xdc1b
0d46 77 ld (hl), a
0d47 23 inc hl
0d48 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0d4b C3 4A 09 jp 0x094a // Textprozessor
// ÜBERSCHREIBEN
0d4e 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0d51 77 ld (hl), a
0d52 EB ex de, hl
0d53 2A 21 DC ld hl , (0xdc21) // EADRT:-Endadresse Textspeicher
0d56 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d57 ED 52 sbc hl, de // Länge > 0
0d59 20 01 jrnz 0x01 // 0x0d5c
0d5b 1B dec de // Länge == 0
// Länge > 0
0d5c EB ex de, hl // Tausche Inhalte DE <> HL
0d5d 23 inc hl
0d5e 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0d61 C3 4A 09 jp 0x094a // Textprozessor
// Einsprung KONTROLLE GÜLTIGER ZEICHEN BEI SCHLÜSSELEINGABE, 0x0c90
0d64 EB ex de, hl
0d65 77 ld (hl), a
0d66 23 inc hl
0d67 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0d6a EB ex de, hl
0d6b 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0d6e A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d6f ED 52 sbc hl, de // Länge == 0
0d71 EB ex de, hl // Tausche Inhalte DE <> HL
0d72 CA 4A 09 jpz 0x094a // Textprozessor
0d75 CD 8A 0D call 0x0d8a // Zustand Textprozessor, a und Z-Flag Rückgabe
0d78 FE 00 cp 0x00 // Rückgabe Textprozessor A > 0? springe
0d7a C2 4A 09 jpnz 0x094a // Textprozessor
0d7d 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0d80 23 inc hl
0d81 23 inc hl
0d82 23 inc hl
0d83 23 inc hl // HL + 4
0d84 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
0d87 C3 4A 09 jp 0x094a // Textprozessor
// Zustand Textprozessor, a und Z-Flag Rückgabe
0d8a 3A 1A DC ld a, (0xdc1a) // ZTP:Zustand TextProzessor
0d8d CB 47 bit 0, a // Texteingabe-Schlüssleingabe
0d8f C8 ret z
0d90 D5 push de // rette DE
0d91 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0d94 EB ex de, hl
0d95 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0d98 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d99 ED 52 sbc hl, de // Länge
0d9b 11 09 00 ld de, 0x0009
0d9e A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0d9f ED 52 sbc hl, de // Länge > -1
0da1 30 FB jrnc 0xfb // 0x0d9e
0da3 19 add hl, de
0da4 7D ld a, l
0da5 D1 pop de // wiederherstellen DE
0da6 C9 ret
// Unwandlungstabelle Zahl > Zeichen, für Hexadezimal-Darstellung
0da7 36 37 33 21 2A 30 35 27 26 38 // 0...9
// Buchstabenliste A ... P (0x00 ... 0x0f Darstellung des De-, Chiffrates) in ITA-2
0db1 03 19 0E 09 01 0D 1A 14 // a, b, c, d, e, f, g, h
0db9 06 0B 0F 12 1C 0C 18 16 // i, j, k, l, m, n, o, p
/*************************************************/
/* ANZEIGESTEUERPROGRAMM
/* ZUANZ = 0: KT-AUSGABE
/* 1: BEDIENERFÜHRUNG
/* 2: MIRA
/* PROGRAMM ZUR ANZEIGE des TEXTPROZESSOR-FENSTERS
/* BEARBEITUNG KT-ANZEIGE
/* Anzeigesteuerprogramm */
0dc1 3A 25 DC ld a, (0xdc25) // ZUANZ:-Zustandsanzeige
0dc4 CB 97 res 2, a // Lösche Bit 2
0dc6 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0dc7 C2 5A 0F jpnz 0x0f5a // Darstellung GTX; KEINE KT-AUSGABE
0dca 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0dcd CB 7F bit 7, A // bit 7 == true
0dcf 28 04 jrz 0x04 // 0x0dd5
0dd1 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0dd2 32 26 DC ld (0xdc26), a // ZUAN2:-Merkerstelle für Bedienermeldungen
0dd5 EB ex de, hl // rette HL in DE
0dd6 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0dd9 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0dda ED 52 sbc hl, de // Länge
0ddc 11 0B 00 ld de, 0x000b
0ddf A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0de0 ED 52 sbc hl, de // Länge > -1, maximal 11 Zeichen
0de2 30 2F jrnc, 0x2f // 0x0e13; längerer Text
0de4 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0de7 11 C8 A0 ld de, 0xa0c8 // LCD-RAM ZZ
0dea D5 push de // rette DE, wird später HL
0deb E5 push hl // rette HL
0dec 01 15 00 ld bc, 0x0015 // 21 runden
0def ED B8 lddr // Kopiere Txt in LCD Speicher; schiebe rückwärts, HL > DE, bc-- , hl--, de--
0df1 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0df4 EB ex de, hl // Tausche Inhalt DE <> HL
0df5 E1 pop hl // wiederherstellen HL
0df6 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0df7 ED 52 sbc hl, de // Länge
0df9 EB ex de, hl // Tausche Inhalt DE <> HL
0dfa E1 pop hl // HL = 0xa0c8
0dfb A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0dfc ED 52 sbc hl, de // Länge
0dfe CB FE set 7, (hl)
0e00 3A 25 DC ld a, (0xdc25) // ZUANZ:-Zustandsanzeige
0e03 CB 57 bit 2, a // bit 2 == true
0e05 28 08 jrz 0x08 // 0x0e0f
0e07 21 B4 A0 ld hl, 0xa0b4 // LCD-RAM AZ
0e0a 36 34 ld (hl), 0x34
0e0c 23 inc hl
0e0d 36 04 ld (hl), 0x04
0e0f CD 2E 0E call 0x0e2e // Umwandlungsprogramm für Anzeige
0e12 C9 ret
// Textende paßt nicht auf Anzeige
0e13 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0e16 11 0B 00 ld de, 0x000b
0e19 19 add hl, de // Länge
0e1a 11 C8 A0 ld de, 0xa0c8 // LCD-RAM ZZ
0e1d D5 push de // rette DE
0e1e 01 15 00 ld bc, 0x0015 // 21 Runden
0e21 ED B8 lddr // verchiebe rückwärts, HL > DE, bc-- , hl--, de--
0e23 11 0B 00 ld de, 0x000b
0e26 E1 pop hl // HL = 0xa0c8
0e27 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0e28 ED 52 sbc hl, de // Länge
0e2a CB FE set 7, (hl) // CURSOR FÜR ANZEIGE
0e2c 18 D2 jr 0xd2 // 0x0e00
// Umwandlungsprogramm für Anzeige
0e2e 0E 00 ld c, 0x00
0e30 06 14 ld b, 0x14
0e32 21 B4 A0 ld hl, 0xa0b4 // LCD-RAM AZ
0e35 11 C8 A0 ld de, 0xa0c8 // LCD-RAM ZZ
0e38 7E ld a, (hl)
0e39 E5 push hl
0e3a D5 push de // rette Register
0e3b 21 74 13 ld hl, 0x1374 // Zeichensatz für LCD
0e3e E6 3F and 0x3f // a = (0xa0c8) & 0x3f; 6 bit Maske 0011 1111
0e40 28 07 jrz 0x07 // 0x0e49
0e42 11 07 00 ld de, 0x0007
0e45 19 add hl, de
0e46 3D dec a
0e47 20 FC jrnz 0xfc // 0x0e45
0e49 16 00 ld d, 0x00
0e4b 59 ld e, c
0e4c 19 add hl, de
0e4d 7E ld a, (hl)
0e4e D1 pop de
0e4f E1 pop hl // Register wiederherstellen
0e50 12 ld (de), a
0e51 23 inc hl
0e52 13 inc de
0e53 10 E3 djnz 0xe3 // 0x0e38
0e55 CD 13 0F call 0x0f13 // LCD Speicher, Übergabe C
0e58 0C inc c // nächstes Zeichen
0e59 3E 07 ld a, 0x07
0e5b B9 cmp c
0e5c 20 D2 jrnz 0xd2 // 0x0e30
0e5e 06 14 ld b, 0x14
0e60 21 B4 A0 ld hl, 0xa0b4 // LCD-RAM AZ
0e63 11 C8 A0 ld de, 0xa0c8 // LCD-RAM ZZ
0e66 CB 7E bit 7, (hl)
0e68 3E 00 ld a, 0x00
0e6a 28 02 jrnz 0x02 // 0x0E6E
0e6c 3E 1F ld a, 0x1f
0e6e 12 ld (de), a
0e6f 23 inc hl
0e70 13 inc de
0e71 10 F3 djnz 0xf3 // 0x0e66
0e73 0C inc c // nächstes Zeichen
0e74 CD 13 0F call 0x0f13 // LCD Speicher, Übergabe C
0e76 21 70 A0 ld hl, 0xa070 // LCD-RAM Z8
0e79 06 10 ld b, 0x10
0e7b AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0e7c 77 ld (hl), a
0e7e 23 inc hl
0e7f 10 FC djnz 0xfc // 0x0e7d
0e81 3A 27 DC ld a, (0xdc27) // ZUAN3:-Einfügemode
0e84 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0e85 20 0C jrnz 0x0c // 0x0e93
0e87 21 90 A0 ld hl, 0xa090 // LCD-RAM Z10
0e8a 06 10 ld b, 0x10 // Schleife 16 elemente
0e8c AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0e8d 77 ld (hl), a
0e8e 23 inc hl // 0xa090 - 0xa0a0 = 0x00
0e8f 10 FC djnz 0xfc // 0x0e8d
0e91 18 0B jr 0x0b // 0x0e9e
// EInsprung Umwandlung für Anzeige, 0x0e89
0e93 21 80 A0 ld hl, 0xa080 // LCD-RAM Z9
0e96 11 90 A0 ld de, 0xa090 // LCD-RAM Z10
0e99 01 10 00 ld bc, 0x00010 // Länge
0e9c ED B0 ldir // Kopiere (0xa080) > (0xa090), länge 0x10
// Einsprung
0e9e 3A 2A DC ld a, (0xdc2a) // ALRC:-Adresse CRC-Wert Register
0ea1 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0ea2 C8 retz // A == 0 Rücksprung
0ea3 3A 01 DC ld a, (0xdc01) // Betriebsartenregister: 0-KT erstellen/1-Schlüsselwechsel/2-GT erstellen/3-GTX senden
0ea6 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0ea7 C0 retnz // A != 0 Rücksprung
0ea8 06 08 ld b, 0x08 // Betriebsart KT erstellen
0eaa 21 00 A0 ld hl, 0xa000 // LCD-RAM Z1
0ead 16 09 ld d, 0x09
0eaf 36 00 ld (hl), 0x00
0eb1 23 inc hl
0eb2 15 dec d
0eb3 20 FA jrnz 0xfa // 0x0eaf, HL 0xa000 bis 0xa06f Löschen mit 0x00
0eb5 11 07 00 ld de , 0x0007
0eb8 19 add hl, de // HL = 0xa009 + 0x0007 = 0xa010, ... 0xa070
0eb9 10 F2 djnz 0xf2 // 0x0ead
0ebb 21 00 A0 ld hl, 0xa000 // LCD-RAM Z1
0ebe 11 10 00 ld de, 0x0010
0ec1 06 0A ld b, 0x0a
0ec3 36 01 ld (hl), 0x01
0ec5 19 add hl, de
0ec6 10 FB djnz 0xfb // 0x0ec3, (0xa000) = 0x01, (0xa010) = 0x01 ... (0xa100)
0ec8 21 08 A0 ld hl, 0xa008
0ecb 06 0A ld b, 0x0a
0ecd 36 02 ld (hl), 0x02
oecf 19 add hl, de
0ed0 10 FB djnz 0xfb // 0x0ecd, (0xa008) = 0x02, (0xa018) = 0x02 ... (0xa108)
0ed2 11 10 00 ld de, 0x0010
0ed5 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
0ed8 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0ed9 28 03 jrz 0x03 // 0x0ede; MIRA
0edb 11 08 00 ld de, 0x0008 // GO
0ede 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0ee1 ED 4B 1F DC ld bc, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0ee5 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0ee6 ED 42 sbc hl, bc // Länge
0ee8 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
0ee9 4F ld c, a
0eea ED 52 sbc hl, de // Länge
0eec 0C inc c
0eed 30 FB jrnc 0xfb // 0x0eea
0eef 21 30 A0 ld hl, 0xa030 // LCD-RAM Z3
oef2 E5 push hl // rette HL
0ef3 11 10 00 ld de, 0x0010
0ef6 3E 03 ld a, 0x03
0ef8 E1 pop hl // wiederherstellen HL = 0xa030
0ef9 E5 push hl // rette HL
0efa 06 04 ld b, 0x04
0efc 77 ld (hl), a
0efd 19 add hl, de // Länge
0efe 10 FC djnz 0xfc // 0x0efc
0f00 0D dec c // c == 0
0f01 28 0E jrz 0x0e // 0x0f11
0f03 47 ld b, a
0f04 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
0f05 38 03 jrc 0x03 // 0F0A
0f07 B0 or b
0f08 18 EE jr 0xee // 0x0ef8
// Einsprung carry = 1; 0x0f05
0f0a E1 pop hl // wiederherstellen HL
0f0b 23 inc hl // HL++
0f0c E5 push hl // rette HL
0f0d 3E 01 ld a, 0x01
0f0f 18 E7 jr 0xe7 // 0x0ef8
// Einsprung Regsister C = 0
0f11 E1 pop hl
0f12 C9 ret
// LCD Speicher; Übergabe C Anzahl der Zeichen
0f13 21 00 A0 ld hl, 0xa000 // LCD-RAM Z1
0f16 79 ld a, c // Übergabe c Anzahl der Zeichen
0f17 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0f18 28 07 jrz 0x07 // 0x0f21
0f1a 11 10 00 ld de, 0x0010
// Schleife A
0f1d 19 add hl, de // Endadresse = c*16 + 0xa000
0f1e 3D dec a // Schleifenzähler
0f1f 20 FC jrnz 0xfc // 0x0f1d
// C war 0
0f21 11 C8 A0 ld de, 0xa0c8 // LCD-RAM ZZ
0f24 06 05 ld b, 0x05
0f26 C5 push bc // rette BC, rette Zeichenlänge
0f27 1A ld a, (de)
0f28 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
0f29 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
0f2a 77 ld (hl), a
0f2b 13 inc de
0f2c 1A ld a, (de)
0f2d 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f2e CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f30 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f31 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f33 23 inc hl
0f34 06 04 ld b, 0x04
0f36 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f37 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f39 10 FB djnz 0xfb // 0x0f36
0f3b 13 inc de
0f3c 1A ld a, (de)
0f3d 06 04 ld b, 0x04
0fef 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f40 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f42 10 FB djnz 0xfb // 0x0f3f
0f44 23 inc hl
0f45 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f46 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f48 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f49 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f4b 13 inc de
0f4c 1A ld a, (de)
0f4d 06 06 ld b, 0x06
0f4f 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
0f50 CB 1E rr (hl) // rotiere (HL); carry -> (HL.7) -> (HL.0) -> carry
0f52 10 FB djnz 0xfb // 0x0f4f
0f54 13 inc de
0f55 23 inc hl
0f56 C1 pop bc // wiederherstellen BC
0f57 10 CD djnz 0xcd // 0x0f26
0f59 C9 ret
// Anzeige des formatierten Geheimtextes
0f5a FE 01 cp 0x01
0f5c CA 3D 10 jpz 0x103d // Bedienertexte Index angelegt
0f5f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
// Umwandlung in Dezimalformat
0f60 32 26 DC ld (0xdc26), a // ZUAN2:-Merkerstelle für Bedienermeldungen
0f63 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0f66 ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0f6a A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0f6b ED 52 sbc hl, de // Länge == 0
0f6d CA E5 0F jpz 0x0fe5 // kein Text
0f70 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0f73 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0f74 ED 52 sbc hl, de // Länge > 0
0f76 20 05 jrnz 0x05 // 0x0f7d
0f78 21 10 00 ld hl, 0x0010
0f7b 18 03 jr 0x03 // 0x0f7d
// Einsprung Länge <= 0; 0x0f76
0f7d CD 71 10 call 0x1071 // Anzeige BCD, Programm zur Fünfergruppenzählung
0f80 E5 push hl // können alle Zeichen dargesellt werden
0f81 C1 pop bc // BC = HL
0f82 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0f85 EB ex de, hl
0f86 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0f89 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0f8a ED 52 sbc hl, de // Länge
0f8c 11 06 00 ld de, 0x0006
0f8f A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0f90 ED 52 sbc hl, de // Länge
0f92 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
0f95 2B dec hl
0f96 38 08 jrc 0x08 // 0x0fa0
0f98 11 05 00 ld de, 0x0005
0f9b 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0f9e 2B dec hl
0f9f 19 add hl, de
0fa0 C5 push bc // rette BC -> wo ist der POP?
0fa1 01 0F 00 ld bc, 0x000f
0fa3 11 C7 A0 ld de, 0xa0c7
0fa5 E5 push hl
0fa6 D5 push de // Register retten
0fa7 ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
0fab A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0fac ED 52 sbc hl, de // Länge == 0
0fb0 3E 82 ld a, 0x82
0fb2 28 04 jrz 0x04 // 0x0fb8
0fb4 CD 71 10 call 0x1071 // Anzeige BCD, Programm zur Fünfergruppenzählung
0fb7 7D ld a, l
0fb8 D1 pop de
0fb9 E1 pop hl // Register wiederherstellen
0fba D6 02 sub 0x02
0fbc 27 daa // BCD korrektur
0fbd E6 0F and 0x0f // Maskiere untere 4 bits
0fbf FE 06 cmp 0x06
0fc1 20 08 jrnz 0x08 // 0x0fcb; springe bei ungleich 0x06
0fc3 EB ex de, hl
0fc4 36 04 ld (hl), 0x04
0fc6 2B dec hl
0fc7 EB ex de, hl
0fc8 0D dec c // c == 0
0fc9 28 2E jrz 0x2e // 0x0ff9
// Einsprung ungleich 0x06
0fcb ED A8 ldd // Kopiere (HL) > (DE), BC -1: bc wird vom aufrufenden Programm getestet.
0fcd E2 F9 0F jppo 0x0ff9 // P-Flag wird von ldd gesetzt (BC=0)
0fd0 D5 push de
0fd1 E5 push hl
0fd2 C5 push bc // rette Register
0fd3 EB ex de, hl // Tausche Inhalt DE <> HL
0fd4 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
0fd7 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
0fd8 ED 52 sbc hl, de // Länge > 0 springe nach 0x0fba
0fda C1 pop bc
0fdb E1 pop hl
0fdc D1 pop de // wiederherstellen Register
0fdd 20 DB jrnz 0xdb // 0x0fba
0fdf ED 53 28 DC ld (0xdc28), de // ANCSP:-Merkerstelle für Cursor
0fe3 18 D5 jr 0xd5 // 0x0fba
// Einsprung KEIN TEXT 0x0f6d
0fe5 21 B4 A0 ld hl, 0xa0b4 // LCD-RAM AZ
0fe8 36 00 ld (hl), 0x00
0fea 11 B5 A0 ld de, 0xa0b5 // LCD-RAM AZ + 1
0fed 01 13 00 ld bc, 0x0013 // Länge
0ff0 ED B0 ldir // lösche 0xa0b4 - 0xa0c8 mit 0x00, // LCD-RAM AZ // LCD-RAM ZZ
0ff2 01 10 00 ld bc, 0x0010
0ff5 C5 push bc // rette BC
0ff6 11 B8 A0 ld de, 0xa0b8 // LCD-RAM ZZ
0ff9 C1 pop bc // wiederherstellen BC
0ffa EB ex de, hl
0ffb 36 04 ld (hl), 0x04 // (0xa0b8) = 0x04; LCD-RAM ZZ
0ffd 2B dec hl
0ffe 36 3A ld (hl), 0x1a // (0xa0b7) = 0x1a; LCD-RAM ZZ - 1
1000 2B dec hl // 0xa0b7 = hl; LCD-RAM ZZ - 4
1001 79 ld a, c // a = 0x10
1002 CD 5A 10 call 0x105a // Zeichengenerator Ziffern, Übergabe/Rückgabe in A
1005 77 ld (hl), a
1006 2B dec hl
1007 78 ld a, e
1008 E6 0F and 0x0f
100a CD 62 10 call 0x1062 // Einsprung in den Zeichengenerator Ziffern, Übergabe/Rückgabe in A
100d 77 ld (hl), a
100e 2B dec hl
100f 78 ld a, b
1010 CD 5A 10 call 0x105a // Zeichengenerator Ziffern, Übergabe/Rückgabe in A
1013 77 ld (hl), a
1014 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
1017 ED 5B 1D DC ld de, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
101b A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
101c ED 52 sbc hl, de // Länge == 0
101e 28 19 jrz 0x19 // 0x1039
1020 3E FF ld a, 0xff
1022 BC cp h // a <> 0xff
1023 20 09 jrnz 0x09 // 0x102e
1025 BD cp l
1026 20 06 jrnz 0x06 // 0x102e
1028 21 C7 A0 ld hl, 0xa0c7
102b 22 28 DC ld (0xdc28), hl // ANCSP:-Merkerstelle für Cursor
102e 2A 28 DC ld hl, (0xdc28) // ANCSP:-Merkerstelle für Cursor
1031 7E ld a, (hl)
1032 FE 04 cp 0x04
1034 20 01 jrnz 0x01 // 0x1037
1036 2B dec hl
1037 CB FE set 7, (hl)
1039 CD 2E 0E call 0x0e2e // Umwandlungsprogramm für Anzeige
103c C9 ret
// Bedienertexte Index angelegt
103d 3A 26 DC ld a, (0xdc26) // ZUAN2:-Merkerstelle für Bedienermeldungen
1040 21 E0 10 ld hl, 0x10e0 // "BITTE WEITER" - Text A = 0x01
1043 11 14 00 ld de, 0x0014
1046 D6 01 sub 0x01 <--\
1048 38 03 jrc 0x03 | // 0x104d, a < 0x00?
104a 19 add hl, de | // 0x10f4, 0x1108 ... -> nächster Block a 14 Bytes
104b 18 F9 jr 0xf9 >--/ // 0x1046
// Einsprung carry = 1
104d 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
1050 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
1053 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
1054 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
1057 C3 C1 0D jp 0x0dc1 // ANZEIGESTEUERPROGRAMM 0 KT-Ausgabe, 1 Bedienerführung, 2 MIRA
// UMWANDLUNG BCD IN ITA VON ZAHLEN 0...9
// Input: BCITL : Wert des linken Halbbyts von A
// BCITR : Wert des rechten Halbbytes von A
// Output A : ITA-Wert
// Zeichengenerator Ziffern
105a CB 3F srl a // schiebe A, 0 -> A7 -> A0 -> carry
105c CB 3F srl a // schiebe A, 0 -> A7 -> A0 -> carry
105e CB 3F srl a // schiebe A, 0 -> A7 -> A0 -> carry
1060 CB 3F srl a // schiebe A, 0 -> A7 -> A0 -> carry, A.high -> A.left, carry = A bit 3
// Einsprung 0x100a
1062 E6 0F and 0x0f // Maskiere, carry = 0
1064 E5 push hl
1065 D5 push de // Register retten
1066 5F ld e, a
1067 16 00 ld d, 0x00
1069 21 C2 10 ld hl, 0x10c2 // ITLIS; Zeichen für den Zeichengenerator
106c 19 add hl, de // Berechne Index, der Ziffer
106d 7E ld a, (hl)
106e D1 pop de
106f E1 pop hl // wiederherstellen Register
1070 C9 ret
// Programm zur Fünfergruppenzählung
// Übergabe: HL : Elementeanzahl Binär
// Rückgabe: HL, B : Gruppenanzahl BCD
1071 C5 push bc // Rette BC
1072 06 00 ld b, 0x00
1074 3E 05 ld a, 0x05 // Vorladen wg. 1 Gruppe
1076 C6 01 add a, 0x01
1078 27 daa // bcd korrektur
1079 30 07 jrnc 0x07 // 0x1082; kein Überlauf nach daa
107b 4F ld c, a
107c 78 ld a, b
107d C6 01 add a, 0x01
107e 27 daa // bcd korrektur
1080 47 ld b, a
1081 79 ld a, c
1082 57 ld d, a
1083 2B dec hl
1084 7C ld a, h
1085 B5 or l
1086 7A ld a, d
1087 20 ED jrnz 0xed // 0x1076; A OR L ist ungleich 0
1089 87 add a, a
108a 27 daa // bcd korrektur
108b 6F ld l, a
108c 78 ld a, b
108d 06 00 ld b, 0x00
108f 30 02 jrnc 0x02 // 0x1093; kein Überlauf nach daa
1091 06 01 ld b, 0x01
1093 87 add a, a
1094 27 daa // BCD korrektur
1095 80 add a, b
1096 27 daa // bcd korrektur
1097 67 ld h, a // Dezimalwert 5er Gruppe
1098 C1 pop bc // Register wiederherstellen
1099 C9 ret
// Programm zur Anzeige der Bedienerführung
// Input: A : Nr. des Wortes ltd. AG
109a 32 26 DC ld (0xdc26), A // ZUAN2:-Merkerstelle für Bedienermeldungen
109d 3A 25 DC ld a, (0xdc25) // ZUANZ:-Zustandsanzeige
10a0 F5 push af // rette AF
10a1 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
10a2 32 2A DC ld (0xdc2a), a // ALRC, LCD Cursor
10a5 3E 01 ld a, 0x01
10a7 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
10aa 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
10ad E5 push hl // rette HL, 1
10ae 2A 1B DC ld hl, (0xdc1b) // ZADR:-Aktueller Zeiger-TextProzessor
10b1 E5 push hl // rette HL, 2
10b2 CD C1 0D call 0x0dc1 // ANZEIGESTEUERPROGRAMM 0 KT-Ausgabe, 1 Bedienerführung, 2 MIRA
10b5 E1 pop hl // wiederherstellung HL, 2
10b6 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
10b9 E1 pop hl // wiederherstellung HL, 1
10ba 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
10bd F1 pop af // wiederherstellung AF
10be 32 25 DC ld (0xdc25), hl // ZUANZ:-Zustandsanzeige
10c1 C9 ret
// ITLIS
// ZiL 0 1 2 3 4 5 6 7 8 9
10c2 36 37 33 21 2A 30 35 27 26 38
//Anzeigegenerator
Mxx
// 0 1 2 3 4 5 6 7 8 9
//eol, "E", "->", "A", " ", "S", "I", "U", "<", "D",
//10 11 12 13 14 15 16 17 18 19
//"R", "J", "N", "F", "C", "K", "T", "Z", "L", "W",
//20 21 22 23 24 25 26 27 28 29
//"H", "Y", "P", "Q", "U", "B", "G", "#", "M", "X",
//30 31 32 33 34 35 36 37 38 39
//"V", "$", "'", "3", "%", "-", CRLF, "+", "8", "7",
//40 41 42 43 44 45 46 47 48 49
//">", "=", "4", "*", ",", "/", ";", "(", "5", "''",
//50 51 52 53 54 55 56 57 58 59
//")", "2", "-,", "6", "0", "1", "9", "?", ":", "[",
//60 61 62 63 64 65 66 67 68 69
//".", "&", "!", "]"
3f = 63 = b0011 1111
Zeichenadresse:
A B C D E F G H I J K L M N O P Q
#03 19 0e 09 01 0d 1a 14 06 0b 0f 12 1c 0c 18 16 17
R S T U V W X Y Z # ' + * ( ) [ ]
#0a 05 10 07 1e 13 1d 15 11 1b 20 25 2b 2f 34 3b 3f
- -> < > _ ! ? 1 2 3 4 5 6 7 8 9 0
#23 02 08 28 04 3E 39 37 33 21 2a 30 35 27 26 38 36
// A == 0x00
10cc 19 12 18 0E // BLOC
10d0 0F 06 01 0A 07 0C 1A 00 37 00 00 00 00 00 00 00 // KIERUNG 1
// A == 0x01
10e0 19 06 10 10 01 04 13 01 06 10 01 0A 00 00 00 00 // BITTE_WEITER
10f0 00 00 00 00
// A == 0x02
1C 18 1C 01 0C 10 04 19 06 10 10 01 // MOMENT_BITTE
1100 04 00 00 00 00 00 00 00 //_
// A == 0x03
1108 19 01 0A 01 06 10 00 00
1110 00 00 00 00 00 00 00 00 00 00 00 00 // BEREIT
// A == 0x04
10 01 1D 10 // TEXT
1120 04 01 0A 05 10 01 12 12 01 0C 00 00 00 00 00 00 // _ERSTELLEN
// A == 0x05
1130 05 0E 14 12 07 01 05 05 01 12 01 06 0C 1A 03 19 // SCHLUESSELEINGAB
1140 01 00 00 00 // E
// A == 0x06
1145 09 01 0E 14 06 0D 0D 0A 06 01 0A 01 // DECHFFRIERE
1150 0C 3E 00 00 00 00 00 00 // N?
// A == 0x07
1158 0E 14 06 0D 0D 0A 06 01 // CHIFFRIE
1160 0A 01 0C 3E 00 00 00 00 00 00 00 00 // REN?
// A == 0x08
116c 05 01 0C 09 // SEND
1170 01 0C 3E 00 00 00 00 00 00 00 00 00 00 00 00 00 // EN?
// A == 0x09
1180 01 1C 16 0D 03 0C 1A 01 0C 3E 00 00 00 00 00 00 // EMPFANGEN?
1190 00 00 00 00
// A == 0x0a
19 01 10 0A 06 01 19 05 03 0A 10 13 // BETRIEBSARTW
11a0 01 0E 14 05 01 12 00 00 // ECHSEL
// A == 0x0b
19 12 18 0E 0F 06 01 0A // BLOCKIER
11b0 07 0C 1A 00 33 00 00 00 00 00 00 00 // UNG 2
// A == 0x0c
19 01 10 0A // BETR
11c0 06 01 19 05 03 0A 10 04 37 00 00 00 00 00 00 00 // IEBSART_1
// A == 0x0d
11d0 05 0E 14 12 07 01 05 05 01 12 0D 01 14 12 01 0A // SCHLUESSELFEHLER
11e0 00 00 00 00
// A == 0x0e
19 01 10 0A 06 01 19 05 03 0A 10 04 // BETRIEBSART_
11f0 33 00 00 00 00 00 00 00 // 2
// A == 0x0f
0F 01 06 0C 00 10 01 1D // KEIN TEX
1200 10 00 00 00 00 00 00 00 00 00 00 00 // T
// A == 0x10
13 06 01 09 // WIED
1210 01 0A 14 18 12 07 0C 1A 00 3E 00 00 00 00 00 00 // ERHOLUNG ?; ; Erscheint bei falscheingaben des GTX innerhalb der IV bzw. der CRC-16_true
// A == 0x11
1220 10 01 1D 10 0D 01 14 12 01 0A 00 3E 00 00 00 00 // TEXTFEHLER ?
1230 00 00 00 00
// A == 0x12
1A 10 1D 04 01 0A 05 10 01 12 12 01 // GTX_ERSTELLE
1240 0C 00 00 00 00 00 00 00 // N
// A == 0x13
03 0C 11 01 06 1A 01 04 // ANZEIGE_
1250 1A 10 1D 00 00 00 00 00 00 00 00 00 // GTX
// A == 0x14
05 01 12 19 // SELB
1260 05 10 10 01 05 10 00 00 00 00 00 00 00 00 00 00 // STTEST
// A == 0x15
1270 1C 18 09 01 1C 04 09 01 0D 01 0F 10 00 00 00 00 // MODEM_DEFEKT
1280 00 00 00 00
// A == 0x16
19 06 10 10 01 04 04 10 03 05 10 01 // BITTE__TASTE
1290 04 05 01 00 00 00 00 00 // _SE
// A == 0x17 , A == 0x18?
19 06 10 10 01 04 10 03 // BITTE_TA
12a0 05 10 01 04 0E 0A 04 25 04 1D 04 04 19 06 10 10 // STE_CR_/_F__BITT
12b0 01 04 10 03 05 10 01 04 10 01 00 00 00 00 00 00 // E_TASTE_TE
// A == 0x19
12c0 16 03 05 05 13 18 0A 10 00 00 00 00 00 00 00 00 // PASSWORT
12d0 00 00 00 00
// A == 0x1a
05 0E 14 12 07 01 05 05 01 12 13 01 // SCHLUESSELWE
12e0 0E 14 05 01 12 00 00 00 // CHSEL
// A == 0x1b
05 0E 14 12 07 01 05 05 // SCHLUESS
12f0 01 12 04 37 00 00 00 00 00 00 00 00 // EL_1
// A == 0x1c
05 0E 14 12 // SCHL
1300 07 01 05 05 01 12 04 33 00 00 00 00 00 00 00 00 // UESSEL_2
// A == 0x1d
1310 19 12 18 0E 0F 06 01 0A 07 0C 1A 00 21 00 00 00 // BLOCKIERUNG 3
1320 00 00 00 00
// A == 0x1e
19 12 18 0E 0F 06 01 0A 07 0C 1A 00 // BLOCKIERUNG
1330 2A 00 00 00 00 00 00 00 // 4
// A == 0x1f
19 12 18 0E 0F 06 01 0A // BLOCKIER
1340 07 0C 1A 00 30 00 00 00 00 00 00 00 // UNG 5
// A == 0x20
19 01 0A 01 // BERE
1350 06 10 00 00 00 00 00 00 00 00 00 00 00 00 00 // IT
// A == 0x21
2B // *
1360 16 03 05 05 13 18 0A 10 0D 01 14 12 01 0A 04 3E // PASSWORTFEHLER_?
1370 00 00 00 00
// LCD Pixel 5*7
1374 00 00 00 00 00 00 00 // LEERZEICHEN
1F 01 01 0F 01 01 1F // E
1382 04 0E 15 04 04 04 04 // ^ (Pfeil)
0E 11 11 1F 11 11 11 // A
1390 00 00 00 00 00 00 00 // Leerzeichen
1397 0E 11 01 0E 10 11 0E // S
139e 0E 04 04 04 04 04 0E // I
13a5 11 11 11 11 11 11 0E // U
08 04 02 01 02 04 08 // <
0F 11 11 11 11 11 0F // D
0F 11 11 0F 05 09 11 // R
13c1 1F 10 10 10 10 11 0E // J
11 11 13 15 19 11 11 // N
1F 01 01 0F 01 01 01 // F
0E 11 01 01 01 11 0E // C
11 09 05 03 05 09 11 // K
13e5 1F 04 04 04 04 04 04 // T
1F 10 08 04 02 01 1F // Z
13f2 01 01 01 01 01 01 1F // L
11 11 11 15 15 1B 11 // W
1400 11 11 11 1F 11 11 11 // H
11 11 0A 04 04 04 04 // Y
140E 0F 11 11 0F 01 01 01 // P
1415 0E 11 11 11 15 19 0E // Q
0E 11 11 11 11 11 0E // U
1423 0F 11 11 0F 11 11 0F // B
0E 11 01 1D 11 11 0E // G
1431 00 0A 1F 0A 1F 0A 00 // #
11 1B 15 11 11 11 11 // M
11 11 0A 04 0A 11 11 // X
1446 11 11 11 11 11 0A 04 // V
04 1E 05 0F 14 0F 04 // $
1454 04 04 02 00 00 00 00 // '
0E 11 10 0E 10 11 0E // 3
1462 03 13 08 04 02 19 18 // %
00 00 00 1F 00 00 00 // -
1470 00 10 10 12 1F 02 00 // NL |->
00 04 04 1F 04 04 00 // +
0E 11 11 0E 11 11 0E // 8
1F 10 08 04 04 04 04 // 7
02 04 08 10 08 04 02 // >
1492 00 00 1F 00 1F 00 00 // =
11 11 11 1F 10 10 10 // 4
14a1 00 11 0A 1F 0A 11 00 // * Akustikkoppler Symbol
00 00 00 00 04 04 02 // ,
14af 00 10 08 04 02 01 00 // /
00 00 04 00 04 04 02 // ;
04 02 02 02 02 02 04 // (
14c4 1F 01 01 0F 10 11 0E // 5
0A 0A 0A 00 00 00 00 // "
14d2 04 08 08 08 08 08 04 // )
0E 11 10 0E 01 11 1F // 2
14e0 07 06 04 04 0E 11 0E // Schlüsselsymbol
0E 11 01 0F 11 11 0E // 6
0E 11 11 15 11 11 0E // 0
04 06 05 04 04 04 04 // 1
0E 11 11 1E 10 11 0E // 9
1503 06 09 08 04 04 00 04 // ?
00 00 04 00 04 00 00 // :
0E 02 02 02 02 02 0E // [
00 00 00 00 00 06 06 // .
151f 0E 09 05 12 0D 09 16 // &
04 04 04 04 04 00 04 // !
0E 08 08 08 08 08 0E // ]
/********************/
/* TASTATURPROGRAMM */
/********************/
PARAMETER
GL.ALIAT TASTATURDATEN
GL.ZUALF BIT 0 NEUES ZEICHEN WAR
1 CTL '0' WAR
2 INS-MOD
3 ÜBERHOLSPERRUNG
GL.ALMER NEUPUFFER
GL.ALMEA ALTPUFFER
GL.ALZAL ZÄHLER FÜR ZEILE
GL.AMER ZEICHENZWISCHENSPEICHER
GL.BMER DTO
GL.CMER FÜR TRICK 17
GL.TAZAL ANZAHL TASTEN
// INTERRUPTROUTINE Tastatur CTC-1
1534 F5 push af
1535 C5 push bc
1536 D5 push de
1537 E5 push hl
1538 DD E5 push ix // Register retten
//ÜBERHOLSPERRUNG
153a 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
153d CB DE set 3, (hl) // bit "Überholsperre"
153f FB EI
1540 21 0C DC ld hl, 0xdc0c // TASTATUR WEITERSCHALTUNG,ALZAL:-Zähler für Zeile
1543 7E ld a, (hl)
1544 3C inc a
1545 E6 07 and 0x07 // Maximal 8 Zeilen
1547 77 ld (hl), a
1548 5F ld e, a
1549 16 00 ld d, 0x00
154b 21 04 DC ld hl, 0xdc04 // ALMER 8 byte, NeuPuffer
154e 19 add hl, de // Puffer HL + 0x0000 ... 0x0007
154f DB 01 in a, (0x01) // Lese PIO-0-B-D; Tastatur ME, ZG, OUTC
1551 E6 3F and 0x3f // Maske 0011 1111
1553 77 ld (hl), a // lege in HL+zeiger die Eingabe ab
1554 43 ld b, e
1555 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
1556 D3 00 out (0x00), a // PIO-0-AD-Tastatur
1558 3E CF ld a, 0xcf // Steuerwort
155a D3 02 out (0x02), a // Steuerwort, PIO-0-A
155c 3E 7F ld a, 0x7f <-\ // Schleife (0xdc0c)
155e 07 rlca | // rotieren A0 -> A7 -> A0; carry = A7
155f 10 FD djnz 0xfd >-/ // aktiviere Zeile 1 ...
1561 D3 02 out (0x02), a // Steuerwort, PIO-0-A
1563 2F cpl // WEGEN PULL-DOWN, Invertiert
1564 D3 00 out (0x00), a // PIO-0-AD-Tastatur
1566 3E 07 ld a, 0x07
1568 BB cp e // e == 7
1569 28 0F jrz 0x0f // 0x157a
156b F3 DI // Sperre Interrupt
156c 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
156f CB 9E res 3, (hl) // bit "Überholsperre"
1571 DD E1 pop ix
1573 E1 pop hl
1574 D1 pop de
1575 C1 pop bc
1576 F1 pop af // Register wiederherstellen
1577 FB EI // Interruptfreigabe
1578 ED 4D reti
// weiter Tastaturabfrage
157a AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
157b 32 19 DC ld (0xdc19), a // TASTATUR AUSWERTEN TAZAL: Länge 1
157e 11 0C DC ld de, 0xdc0c // NEUPUFFER,ALZAL:-Zähler für Zeile
1581 21 15 DC ld hl, 0xdc15 // AMER: Länge 1
1584 DD 21 17 DC ld ix, 0xdc17 // CMER: Länge 1
1588 0E 08 ld c, 0x08
158a 06 06 ld b, 0x06
158c 2B dec hl // HL = 0xdc14; Endadresse ALEMA
158d 1B dec de // DE = 0xdc0b; Endadresse ALMER
158e EB ex de, hl // HL <> DE
158f 1A ld a, (de) // (0xdc14)
1590 AE xor (hl) // A xor M; A = ((0xdc14) XOR (0xdc0b) AND (0xdc14)
1591 A6 and (hl) // Maskiere A AND M
1592 EB ex de, hl // HL <> DE
1593 DD 77 00 ld (ix+00), a // 0xdc17 Rette A; CMER = A = ((0xdc14) XOR (0xdc0b) AND (0xdc14)
1596 1A ld a, (de) // A = (0xdc0b)
// Schleife B = 6 runden
1597 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1598 F5 push af // rette AF
1599 DD CB 00 0E rrc (ix+00) // rotieren (IX+0); (IX+0.0) -> (IX+0.7) -> (IX+0.0) carry = (IX+0.0)
159d F1 pop af // wiederherstellen AF, carry des RRCA 0x1597 wird ausgewertet!
159e 30 2B jrnc 0x2b // bein RRCA wurde das Carry verändert?
15a0 F5 push af // TASTE ERKANNT, rette AF
15a1 3A 19 DC ld a, (0xdc19) // TAZAL: Länge 1
15a4 3C inc a // Erhöhe TAZAL
15a5 32 19 DC ld (0xdc19), a // TAZAL: Länge 1
15a8 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
15ab 32 16 DC ld (0xdc16), a // BMER: Länge 1; Rette (0xdc15)
15ae 78 ld a, b
15af 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
15b0 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
15b1 07 rlca // rotiere A, A7 <- A0 <- A7; carry = A7
15b2 0D dec c
15b3 B1 or c
15b4 0C inc c
15b5 32 15 DC ld (0xdc15), a // AMER: Länge 1; rette A
15b8 DD CB 00 06 rlc (ix + 0x00) // rotieren (IX+0); (IX+0.7) <- (IX+0.0) <- (IX+0.7) carry = (IX+0.7)
15bc DD CB 00 0E rrc (ix + 0x00) // rotieren (IX+0); (IX+0.0) -> (IX+0.7) -> (IX+0.0) carry = (IX+0.0)
15c0 30 08 jrnc 0x08 // Abfrage bit 7 (IX+0), (IX+0) unverändert! kein bit (IX+0) verwendet weil dieser das Z-Flag ändert. das wird aber für das djnz verwendet!
15c2 3A 15 DC ld a, (0xdc15) // AMER: Länge 1; hole A zurück
15c5 CB FF set 7, a // setze Bit 7
15c7 32 15 DC ld (0xdc15), a // AMER: Länge 1; rette A
// Einsprung (IX+0) bit 7 = 1
15ca F1 pop af // wiederherstellen AF
15cb 10 CA djnz 0xca // 0x1597; Schleife B, 6 Runden
15cd 0D dec c
15de 20 BA jrnz 0xba
15d0 01 08 00 ld bc, 0x0008 // Länge
15d3 EB ex de, hl
15d4 ED B0 ldir // Kopiere HL > DE, Länge bc = 8 bytes
15d6 3A 19 DC ld a, (0xdc19) // TAZAL: Länge 1
15d9 FE 02 cp 0x02
15db CA 64 16 jpz 0x1664 // 2 TASTEN
15de FE 01 cp 0x01 // a == 1
15e0 28 0B jrz 0x0b
15e2 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
15e3 20 86 jrnz 0x86 // If a <> 0
15e5 3E 01 ld a, 0x01 // then a = 0x01 else 0x156b
15e7 32 18 DC ld (0xdc18), a // DMER:-Zähler für Durchläufe
15ea C3 6B 15 jp 0x156b
// Einsprung
15ed 3A 15 DC ld a, (0xdc15) // 1 TASTE; AMER: Länge 1
15f0 CB 7F bit 7, a
15f2 CA DA 16 jpz 0x16da // Sprung beit bit 7 = 0
15f5 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
15f8 36 0A ld (hl), 0x0a // ERKENNEN FÜR DAUER <1SEC
15fa CB BF res 7, a // EINE NEUE TASTE
15fc FE 31 cp 0x31
15fe 20 37 jrnz 0x37 // NICHTS INS
1600 3A 01 DC ld a, (0xdc01) // Betriebsartenregister
1603 FE 01 cp 0x01 // Schlüsselwechsel
1605 CA 6B 15 jpz 0x156b
1608 3A 26 DC ld a, (0xdc26) // ZUAN2:-Merkerstelle für Bedienermeldungen
160b A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
160c C2 6B 15 jpnz 0x156b
160f 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
1612 7E ld a, (hl)
1613 EE 04 xor 0x04 // bit 2 = INSERT Mode,
1615 77 ld (hl), a // lösche Bit 2
// UMSCHALTUNG CURSOR FÜR INS-ANZEIGE
1616 21 27 DC ld hl, 0xdc27 // ZUAN3:-Einfügemode
1619 36 00 ld (hl), 0x00
161b CB 57 bit 2, a // bit 2 == true
161d 28 02 jrz 0x02
161f 36 01 ld (hl), 0x01
1621 CD C1 0D call 0x0dc1 // ANZEIGESTEUERPROGRAMM 0 KT-Ausgabe, 1 Bedienerführung, 2 MIRA
1624 C3 6B 15 jp 0x156b
// Einsprung 0x166e ff
1627 CB 7E bit 5, (hl)
1629 CA ED 16 jpz 0x16ed
162c E5 push hl // rette HL
16dd 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
1630 36 01 ld (hl), 0x01
1632 E1 pop hl // wiederherstellen HL
1633 CB BE set 1, (hl)
1635 57 ld d, a
1636 7E ld a, (hl)
1637 21 42 17 ld hl, 0x1742 // Tastencode CITT-2
163a 01 21 00 ld bc, 0x0021
163d ED B1 cpir // BC == 0? oder a == (HL)
163f C2 6B 15 jpnz 0x156b
1642 21 63 17 ld hl, 0x1763 // TU-1, Tastencode Großbuchstaben
1645 09 add hl, bc
1646 7A ld a, d
1647 FE 09 cp 0x09 // a == 9, CTRL
1649 7E ld a, (hl)
164a 28 6A jrz 0x6a
164c FE 98 cp 0x98 // a == 0x98, CRTL+'0'
164e 28 09 jrz 0x09
1650 FE B2 cp 0xb2 // a == 0xb2
1652 28 05 jrz 0x05
1654 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
1657 CB 8E res 1, (hl) // Lösche CRTL-Tastendruck
1659 32 02 DC ld (0xdc02), a // ALDAT:-Datenübergaberegister Tastatur
165c 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
165f CB C6 set 0, (hl) // setze Neues Zeichen
1661 C3 6B 15 jp 0x156b
// Einsprung 2 Tasten, 0x15db
1664 3A 15 DC ld a, (0xdc15) // AMER: Länge 1
1667 21 16 DC ld hl, 0xdc16 // BMER: Länge 1
166a CB BF res 7, a // Lösche Bit 7
166c FE 09 cp 0x09 // a == 9
166e 28 B7 jrz 0xb7 // 0x1627
1670 FE 37 cp 0x37 // a == 0x37
1672 28 1D jrz 0x1d // 0x1692
1674 FE 1F cp 0x1f // a == 0x1f
1676 CA 0B 17 jpz 0x170b // 3.ZEICHENSATZ
1679 3A 16 DC ld a, (0xdc16) // BMER: Länge 1
167c 21 15 DC ld hl, 0xdc15 // AMER: Länge 1
167f CB BF res 7, a // lösche Bit 7
1681 FE 09 cp 0x09 // a == 9
1683 28 A2 jrz 0xa2 // 0x1627
1685 FE 37 cp 0x37 // a == 0x37; TE
1687 28 08 jrz 0x08 // 0x1691
1689 FE 1F cp 0x1f // a == 0x1f
168b CA 0B 17 jpz 0x170b
168e C3 03 17 jp 0x1703
// Einsprung Taste TE, 0x1687
1691 CB 7E bit 7, (hl) // bit 7 == true
1693 CA ED 16 jpz 0x16ed
1696 E5 push hl // rette HL
1697 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
169a 36 0A ld (hl), 0x0a
169c E1 pop hl // wiederherstellen HL
169d CB BE res 7, (hl)
169f 57 ld d, a
16a0 7E ld a, (hl)
16a1 21 48 17 ld hl, 0x1748
16a4 01 1B 00 ld bc, 0x001b
15a7 ED B1 cpir // BC == 0? oder a == (HL)
15a9 C2 6B 15 jpnz 0x156b
15ac 21 84 17 ld hl, 0x1784 // TU-2 Tastencode ASCII Sonderzeichen
15af 09 add hl, bc
16b0 7A ld a, d
16b1 FE 09 cp 0x09 // CRTL
16b3 20 12 jrnz 0x12
16b5 7E ld a, (hl)
16b6 FE 18 cp 0x18 // a <> 0x18, 'O'
16b8 20 10 jrnz 0x10
16ba 3A 03 DC ld a, (0xdc03) // ZUALF:-Zustand Alpha-Tastendruck
16bd CB CF set 1, a // Setze neues Zeichen
16bf 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck
16c2 7E ld a, (hl)
16c3 CB FF set 7, a // Bit 7 des ASCII Zeichen setzen
16c5 18 85 jr 0x85
16c7 7E ld a, (hl)
16c8 18 82 jr 0x82
16ca FE 16 cp 0x16 // a <> 0x16, 'P'
16cc 20 F4 jrnz 0xf4
16ce 3A 03 DC ld a, (0xdc03) // ZUALF:-Zustand Alpha-Tastendruck
16d1 CB 4F bit 1, a // bit 1 == 0, CTRL gedrückt?
16d3 C2 35 02 jpnz 0x0235 // Schlüsselspeicher löschen, Bereich 0x8380 - 0x97ff -> Blockierung 5
16d6 7E ld a, (hl)
16d7 C3 4C 16 jp 0x164c
// Einsprung
16da F5 push af // KEINE EINE NEUE TASTE; rette AF
16db 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
16de AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
16df B6 or (hl)
16e0 20 06 jrnz 0x06
16e2 36 03 ld (hl), 0x03
16e4 F1 pop af // wiederherstellen AF
16e5 C3 FA 15 jp 0x15fa
16e8 35 dec (hl)
16e9 F1 pop af // wiederstellen AF
16ea C3 6B 15 jp 0x156b
16ed F5 push af // KEINE ZWEI NEUE TASTE
16ee E5 push hl // rette Register
16ef 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
16f2 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
16f3 B6 or (hl)
16f4 20 07 jrnz 0x07
16f6 36 04 ld (hl), 0x04 // FÜR 5 Hz
16f8 E1 pop hl
16f9 F1 pop af // Register wiederherstellen
16fa C3 9F 16 jp 0x169f // TA GÜLTIG
16fd 35 dec (hl)
16fe E1 pop hl
16ff F1 pop af // Register wiederherstellen
1700 C3 6B 15 jp 0x156b
1703 3E 02 ld a, 0x02
1705 32 18 DC ld (0xdc18), a // DMER:-Zähler für Durchläufe
1708 C3 6B 15 jp 0x156b
// 3. ZEICHENSATZ
170b CB 7E bit 7, (hl) // bit 7 == true
170d 28 24 jrz 0x24
170f E5 push hl // retten HL, 2
1710 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
1713 36 0A ld (hl), a
1715 E1 pop hl // wiederherstellung HL
1716 CB BE res 7, (hl)
1718 57 ld d, a
1719 7E ld a, (hl)
171a 21 59 17 ld hl, 0x1759
171d 01 0A 00 ld bc, 0x000a
1720 ED B1 cpir // BC == 0? oder a == (HL)
1722 C2 6B 15 jpnz 0x156b
1725 21 9F 17 ld hl, 0x179f // TU-3 Tastencode Zahlen
1728 09 add hl, bc
1729 7A ld a, d
172a FE 09 cp 0x09 // a <> 9
172c C2 C7 16 jpnz 0x16c7
172f 7E ld a, (hl)
1730 C3 B6 16 jp 0x16b6
1733 F5 push af // KEINE ZWEI NEUE TASTE
1734 E5 push hl // rette Register
1735 21 18 DC ld hl, 0xdc18 // DMER:-Zähler für Durchläufe
1738 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
1739 B6 or (hl)
173a 20 C1 jrnz 0xc1 // (hl) <> 0
173c 36 04 ld (hl), 0x04 // FÜR 5 Hz
173e E1 pop hl
173f F1 pop af // wiederherstellung Register
1740 18 D6 jr 0xd6 // TA GÜLTIG
// Tabelle Tastencode CCITT-2 Sonderzeichen
1742 0A // Enter
0C // Rechts
0F // SE
1C // Links
34 // TE
08 // DEL
2F // Space
19 // . (M)
29 // , (N)
21 // ? (B)
22 // ; (V)
2A // : (C)
1A // / (X)
32 // * (Z)
1750 30 // [ (L)
18 // ( (K)
28 // > (J)
20 // < (H)
23 // _ (G)
2B // -> (F)
1B // = (D)
33 // + (S)
0B // - (A)
0E // @ 0 (P) // @ wird nicht auf dem Display angezeigt sondern als Leerzeichen
36 // ) 9 (O)
1E // ( 8 (I)
2E // ' 7 (U)
26 // & 6 (Y-)
25 // % 5 (T)
2D // $ 4 (R)
1760 1D // # 3 (E)
35 // " 2 (W)
0D // ! 1 (Y-)
TCode: // in CCITT ITA-2
1763 17 13 01 0A 10 15 07 06 18 16 03 05 09 // QWERTYUIOPAS
1770 0D 1A 14 0B 0F 12 11 1D 0E 1E 19 0C 1C 04 45 44 // DFGHJKLZXCV
1780 42 41 40 43 // BNM_
//TU2
1784 3E 31 1B 1F 22 3D 20 2F 32 04 23 25 // !"#$%&'()@-+ // @ == 0x04 --> @ wird nicht auf dem Display angezeigt sondern als Leerzeichen
1790 29 02 23 08 28 3B 3F 2B 2D 3A 2E 39 2C 3C 24 // =>_<>[]*/:;?,.
// TU3
179F 37 // 1
17a0 33 21 2A 30 35 27 26 38 36 // 234567890
// INS = 0x31; CTL = 0x09; ZS2 = 0x37; ZS3 = 0x1F
/***********************************************************/
/* DRUCKERPROGRAMM
/* ZDR3 BIT 0 = 1 AUSGABE KT VOR Chiffrieren
1 = 1 AUSGABE KT NACH Dechiffrieren
2 = 1 AUSGABE GT ZUM SENDEN
3 = 1 AUSGABE GT VOR Dechiffrieren */
// Druckerprogramm
17a9 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
17aa D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber TA AUS
17ac DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
17af CB FF set 7, a // bit 7 = 1; SPANNUNG EIN
17b1 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
17b3 CD 21 02 call 0x0221 // Zeitschleife 70ms
17b6 21 00 00 ld hl, 0x0000
17b9 22 BB DC ld (0xdcbb), hl // ZFZ:-Zeiger ZF-folge
17bc 22 AE DC ld (0xdcae), hl // lösche Zeiger/Adresse
17bf 21 B8 DC ld hl, (0xdcb8)
17c2 36 00 ld (hl), 0x00
17c4 3A AB DC ld a, (0xdcab) // Zustandszeiger MIRA/GO
17c7 E6 03 and 0x03
17c9 CA 18 18 jpz 0x1818 // VERFAHREN MIRA
17cc CB 4F bit 1, a // bit 1 == true
17c3 3E 01 ld a, 0x01 // Sonderdruck NR. 1
17d0 20 02 jrnz 0x02 // 0x17d4; Sonderdruck; nach DECHIFFRIEREN
// übergabe A für Sonderdruck = 1 oder 2
17d2 3E 02 ld a, 0x02 // Sonderdruck NR. 2
// Einsprung Sonderdruck-1
17d4 CD 21 1A call 0x1a21 // Sonderdruck Nr. 1, 2, 3 - Abspann
17d7 ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
17db ED 53 AC DC ld (0xdcac), de
17df 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
17e2 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
17e3 ED 52 sbc hl, de // Länge == 0
17e5 22 AE DC ld (0xdcae), hl // Lege Länge ab
17e8 28 0B jrz 0x0b // 0x17f5; KEIN TEXT
// Einsprung aus Druckerroutine 0x188f
17ea 3E 31 ld a, 0x31
17ec 32 A9 DC ld(0xdca9), a // Arbeitsart Drucker = 0x31
17ef CD 92 18 call 0x1892 // Druckersteuerroutine; CALL DRUCK
17f2 CD 04 18 call 0x0418 // DruckOn; CALL DRCON
// ABSPANN
17f5 3E 03 ld a, 0x03 // Sonderdruck NR. 3
17f7 CD 21 1A call 0x1a21 // Sonderdruck Nr. 1, 2, 3 - Abspann
//DRUCKEN BEENDET
17fa DB 05 in a, (0x05) // PIO-1-B-D; Sonderschnittstelle
17fc CB BF res 7, a
17fe D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
1800 CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur; TA EINSCHALTEN
1803 C9 ret
// DRCON
1804 3A A9 DC ld a, (0xdca9) // (0xdca9) von Int-Routine verändert?
1807 E6 03 and 0x03 // fertig?
1809 20 F9 jrnz 0xf9 // 0x1804
180b C9 ret
// Drucker Interruptroutine
180c F5 push af
180d C5 push bc
180e D5 push de
180f E5 push hl // Register retten
1810 CD 92 18 call 0x1892 // Druckersteuerroutine
1812 E1 pop hl
1814 D1 pop de
1815 C1 pop bc
1816 F1 pop af // Wiederherstellen Register
1817 C9 ret
// Geheimtextausgabe, Verfahren MIRA T-315
1818 3A AB DC ld a, (0xdcab) // Zustandszeiger MIRA/GO
181b CB 5F bit 3, a // bit 3 == false
181d 20 59 jrnz 0x059 // 0x1878 Dechiffrieren
181f 3E 04 ld a, 0x04 // Sonderdruck NR. 4
1821 CD 21 1A call 0x1a21 // Sonderdruck Nr. 4 - GTX MIRA
1824 06 00 ld b, 0x00
1826 3E 01 ld a, 0x01
1828 ED 5B 1F DC ld de, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
182c 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
182f 2B dec hl
1830 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1831 ED 52 sbc hl, de // Länge
1833 11 05 00 ld de, 0x0005
1836 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1837 ED 52 sbc hl, de // Länge
1839 38 08 jrc 0x08 // 0x1843, Abbruch bei Länge = -1
183b C6 01 add a, 0x01
183d 27 daa // BCD korrektur
183e 20 F6 jrnz 0xf6 // 0x1836, Schleife
1840 04 inc b
1841 18 F3 jr 0xf3 // 0x1836, Schleife
// Gruppenanzahl BCD in B, A
1843 21 B1 DC ld hl, 0xdcb1 // Ablageort für B = B OR 0x30
1846 CB E0 set 4, b
1848 CB E8 set 5, b // b = b OR 0011 0000
184a 70 ld (hl), b
184b 23 inc hl // 0xdcb2
184c 4F ld c, a
184d 06 04 ld b, 0x04
184f CB 3F srl a <-\ // Schleife, 4 Runden, schiebe A, 0 -> A7 -> A0 -> carry, carry = A bit 3
1851 10 FC djnz 0xfc >-/ // 0x184f
1853 F6 30 or 0x30 // setze bits 4, 5 = 1; 0011_A.high;
1855 77 ld (hl), a // (0xdcb2) = 0x30 || ( a >> 4 )
1856 23 inc hl // 0xdcb3
1857 79 ld a, c // Übergabe aus Reg. A
1858 E6 0F and 0x0f // A = (A & 0x0f) || 0x30
185a F6 30 or 0x30 // Carry = 0; Z = 0
185c 77 ld (hl), a // (0xdcb3) = 0x30 || (A && 0x0f); 0x30 ... 0x3f
185d 3E 03 ld a, 0x03
185f 32 BB DC ld (0xdcbb), a // Länge Drucken
1862 21 B1 DC ld hl, 0xdcb1
1865 22 B9 DC ld (0xdcb9), hl // Zeiger; 5Gruppen Status
1868 3E 35 ld a, 0x35
186a 32 A9 DC ld (0xdca9), a // Arbeitsart Drucker = 0x35
186d CD 92 18 call 0x1892 // Druckersteuerroutine
1870 CD 04 18 call 0x1804 // DRCON
1873 3E 05 ld a, 0x05 // Sonderdruck NR. 5
1875 CD 21 1A call 0x1a21 // Sonderdruck Nr. 5 - GTX in 5er Gruppen
//Ausgabe des GT in 5er Gruppen
1878 2A 1F DC ld hl, (0xdc1f) // AADRT:-Anfangsadresse Textspeicher
187b 22 AC DC ld (0xdcac), hl
187e EB ex de, hl
187f 2A 1D DC ld hl, (0xdc1c)
1882 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1883 ED 52 sbc hl, de // Länge == 0
1885 CA F5 17 jpz 0x17f5 // KEIN TEXT
1888 22 AE DC ld (0xdcae), hl // Länge
188b AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
188c 32 B0 DC ld (0xdcb9), a
188f C3 EA 17 jp 0x17ea
//Druckersteuerroutine; Übergabe 0xdca9 Arbeitsart Drucker 0x31 0der 0x35)
1892 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
1895 CB 46 bit 0, (hl) // bit 0 == false, soll drucker arbeiten
1897 20 12 jrnz 0x12 // 0x18ab; springe bei bit 0 == 0
1899 CB 66 bit 4, (hl) // bit 4
189b 28 0E jrz 0x0e // 0x18ab; springe bie bit 4 == 1
189d CB 6E bit 5, (hl) // bit 5
189f 28 0A jrz 0x0a // 0x18ab
18a1 CB 8E res 1, (hl) // drucker arbeitet nicht
18a3 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
18a5 D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
18a7 CD 30 1A call 0x1a30 // RETI
18aa C9 ret
// bit 0 == false, 4 oder 5 == true; weiter
18ab CB 4E bit 1, (hl) // bit 1 == false
18ad 20 08 jrnz 0x08 // 0x18b7
// Einschalten Drucker CTC
18af 3E 87 ld a, 0x87 // EI, Zeitgeber, Vorteiler 16, neg. Flanke, Zeitkonstantenstart, Zeitkonstante folgt, RESET
18b1 D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
18b3 3E 68 ld a, 0x68 // Zeitkonstante = 104 * 256 / 1340 kHz = 20 ms
18b5 D3 0A out (0x0a), a // CTC Kanal 2 Takt
18b7 CB 66 bit 4, (hl) // bit 4 == false
18b9 20 2A jrnz 0x2a // 0x18e5 Schieberegister ist leer
// Ausgabe der Daten aus den Sendeschieberregister
18bb 3A B7 DC ld a, (0xdcb7)
18be 3D dec a
18bf 32 B7 DC ld (0xdcb7), a // nächstes Zeichen
18c2 28 1B jrz 0x1b // a == 0, 0x18df 1. Stoppbit
18c4 FE 09 cp 0x09 // a == 9
18c6 28 3E jrz 0x3e // 0x1906 Startbit
// Ausroutieren des Sendebits
18c8 21 B5 DC ld hl, 0xdcb5
18cb CB 3E srl (hl) // schiebe (HL), 0 -> (HL.7) -> (HL.0) -> carry
18cd 06 02 ld b, 0x02
18cf 38 02 jrc 0x02 // 0x18d3; bit (HL.0) war == 1 dann springe
18d1 06 00 ld b, 0x00
18d3 CD 33 1A call 0x1a33 // DRUCKPROGRAMM; INPUTS B = 0x00 AUSGABE L-BIT; B = 0x02 AUSGABE H-BIT
18d6 CD 30 1A call 0x1a30 // RETI
18d9 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
18dc CB CE set 1, (hl) // DRUCKER ARBEITET; 0x33 oder 0x37
18de C9 ret
//AUSGABE 1. STOPPBIT
18df CB E6 set 4, (hl) // SR IST LEER
18e1 06 02 ld b, 0x02
18e3 18 EE jr 0xee // 0x18d3
//BEARBEITUNG SR IST LEER
18e5 06 02 ld b, 0x02 // 2. STOPPBIT
18e7 CD 33 1A call 0x1a33 // DRUCKPROGRAMM; INPUTS B = 0x00 AUSGABE L-BIT; B = 0x02 AUSGABE H-BIT
18ea CD 30 1A call 0x1a30 // RETI
183d 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
18f0 CB CE set 1, (hl) // 0x33 oder 0x37
18f2 CB 6E bit 5, (hl) // bit 5 == false
18f4 20 18 jrnz 0x18 // 0x190e; SENDPUFFER AUCH LEER
18f6 3A B6 DC ld a, (0xdcb6) // Speicher konvertierter Text
18f9 32 B5 DC ld (0xdcb5), a
18fc 3E 0A ld a, 0x0a
18fe 32 B7 DC ld (0xdcb7), a
1901 CB EE set 5, (hl) // SENDEPUFFER LEER
1903 CB A6 res 4, (hl) // SR VOLL
1905 C9 ret
// SENDEN EINES STARTBITS
1906 06 00 ld b, 0x00
1908 CD 33 1A call 0x1a33 // DRUCKPROGRAMM; INPUTS B = 0x00 AUSGABE L-BIT; B = 0x02 AUSGABE H-BIT
190b CD 30 1A call 0x1a30 // RETI
// FÜLLEN des SENDEPUFFERS
190e 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
1911 CB CE set 1, (hl) // 0x33 oder 0x37
1913 CB 6E bit 5, (hl) // bit 5 == true
1915 C8 ret z // Sendepuffer Voll leer?
1916 CB 76 bit 6, (hl) // bit 6 == false, ÜBERHOLSPERRE BYTEBEREIT
1918 C0 ret nz
1919 DB 04 in a, (0x04) // Lese PIO-1-A-D; DÜRFEN DATENAUSGEBEN
191b CB 57 bit 2, a // bit 2 == false
191d C0 ret nz // DRUCKER NICHT BEREIT
191e CB F6 set 6, (hl) // ÜBERHOLSPERRE
1920 CB 56 bit 2, (hl) // bit 2 == true
1922 CA 88 19 jpz 0x1988 // NORMALDRUCK
// BEARBEITUNG SONDERDRUCK
1925 2A BB DC ld hl, (0xdcbb) // Länge Text
1928 7C ld a, h
1929 B5 or l
192a 20 21 jrnz 0x21 // 0x194d
// BEGINN SONDERDRUCK
192c 3A AA DC ld a, (0xdcaa) // Sonderdruck Nr. 0, 1, 2, 3 - Abspann, 4 - GTX MIRA, 5 - GTX in 5er Gruppen
192f 87 add a // a *= 2
1930 4F ld c, a // 0x00, 0x02, 0x04 ...
1931 06 00 ld b, 0x00
1933 21 49 1A ld hl, 0x1a49 // SONDERDRUCKLISTE
1936 09 add hl, bc // Zeiger auf entsprechenden Text
1937 5E ld e, (hl) // Adresse 0x1a49 + (a*2)
1938 23 inc hl
1939 56 ld d, (hl) // DE = 0x1a5b, 5c, 6b, ...
193a 01 01 00 ld bc, 0x0001 // zeiger auf nächsten Text, für Längenberechnung
193d 09 add hl, bc // nächste Adresse 0x1a49 + (a*2) + 1
193e 4E ld c, (hl) // Adresse
193f 23 inc hl
1940 46 ld b, (hl) // BC = 0x1a5c, 6b, 7a, ...
1941 C5 push bc // Registertausch
1942 E1 pop hl // HL = BC
1943 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1944 ED 52 sbc hl, de // Länge des Textes
1946 22 BB DC ld (0xdcbb), hl // Länge zwischengespeichert
1949 EB ex de, hl
194a 22 B9 DC ld (0xdcb9), hl // Zeige auf berechnete Adresse des Textes
// AUSGABE des SONDERZEICHENS
194d 2A B9 DC ld hl, (0xdcb9) // Adresse des Textes 0x1a5b, ...
1950 7E ld a, (hl)
1951 32 B6 DC ld (0xdcb6), a // ein Zeichen abgelegt
1954 23 inc hl // nächste Adresse
1955 22 B9 DC ld (0xdcb9), hl // Adresse sichern
1958 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
195b CB AE res 5, (hl) // SENDEPUFFER VOLL
195d 2A BB DC ld hl, (0xdcbb) // Länge des Textes
1960 2B dec hl // -1
1961 22 BB DC ld (0xdcbb), hl // Länge - 1
1964 7C ld a, h
1965 B5 or l
1966 20 18 jrnz 0x18 // 0x1980; Länge != 0
// ABSCHLUSS SONDERDRUCK
1968 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
196b CB 5E bit 3, (hl) // Sonderdruck im Sonderdruck
196d CB 9E res 3, (hl)
196f CB 96 res 2, (hl) // SD AUS
1971 28 0D jrz 0x0d // 0x1980
// ABSCHLUSS SD IM SD
1973 CB D6 set 2, (hl)
1975 21 BD DC ld hl, 0xdcbd // ZFL:-Blocklänge-Zeitschlüssel
1978 11 B9 DC ld de, 0xdcb9
019b 01 04 00 ld bc, 0x0040 // Länge
19be ED B0 ldir // kopiere (0xdcbd) > (0xdcb9) 0x40 bytes
// AUSLÖSUNG SD IM SD; BEDINGUNGEN FÜR SD IM SD KEINE
1980 21 A9 DC ld hl, 0xdca9 // KEINE 3-MALIGE SCHACHTELUNG
1983 F3 DI
1984 CB B6 res 6, (hl) // ÜBERHOLSPERRE WEG
1986 FB EI
1987 C9 ret
// NORMALDRUCK
1988 2A AE DC ld hl, (0xdcae) // Länge
198b 7C ld a, h
198c B5 or l // Prüfe auf Länge =! 0x00
198d 20 07 jrnz 0x07 // 0x1996
// AUSGABE BEENDET
198f 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker 0x31 oder 0x35
1992 CB 86 res 0, (hl)
1994 18 EA jr 0xea // 0x1980
// KONTROLLE OB SONDERDRUCK IM NORMLDRUCK NÖTIG
// HIER NUR FÜR TEXTDRUCK ENTHALTEN SONST BEDINGUNGEN
1996 3A AB DC ld a, (0xdcab) // Zustandszeiger MIRA/GO
1999 E6 0C and 0x0c
199b 20 4C jrnz 0x4c // 0x19e9
199d 3A B8 DC ld a, (0xdcb8)
19a0 FE 45 cp 0x45 // ZEILENLÄNGE
19a2 28 0B jrz 0x0b // 0x19af
19a4 FE 3B cp 0x3b
19a6 38 16 jrc 0x16 // 0x19be KEIN SONDERDRUCK
19a8 3A B5 DC ld a, (0xdcb5)
19ab FE 20 cp 0x20 // a <> 0x20, ZWR
19ad 20 0F jrnz 0x0f // 0x19be
// AUSGABE WR/ZL
19af AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
19b0 32 B8 DC ld (0xdcb8), a
19b3 32 AA DC ld (0xdcaa), a // Sonderdruck Nr. 0
19b6 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker
19b9 CB D6 set 0, (hl) // Druck bereit
19bb C3 80 19 jp 0x1980 // zur Ausgabe SD
// DATENAUSGABE
19be 2A AE DC ld hl, (0xdcae) // Länge
19c1 2B dec hl
19c2 22 AE DC ld (0xdcae), hl // nächstes Zeichen, Länge--
19c5 2A AC DC ld hl, (0xdcac)
19c8 7E ld a, (hl)
19c9 FE 24 cp 0x24 // a <> 0x24, NL
19cb 20 06 jrnz 0x06 // 0x19d3
19cd AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
19ce 32 B8 DC ld (0xdcb8), a
19d1 3E 24 ld a, 0x24
// Einsprung, Übergabe A; T-316 Zeichen; aus 0x19cb
19d3 23 inc hl
19d4 22 AC DC ld (0xdcac), hl
19d7 CD 3B 1A call 0x1a3b // Konverter T-316 - ASCII; Übergabe A = T316 Zeichen, Rückgabe A = ASCII Zeichen
19da 32 B6 DC ld (0xdcb6), a // Speicher ASCII
19dd 21 B8 DC ld hl, 0xdcb8
19e0 34 inc (hl)
19e1 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker
19e4 CB AE res 5, (hl) // Beende Sonderdruck
19e6 C3 80 19 jp 0x1980 // Sprung nach AUSLÖSUNG SD IM SD; BEDINGUNGEN FÜR SD IM SD KEINE
// AUSGABE GEHEIMTEXT
19e9 3A B0 DC ld a, (0xdcb0)
19ec A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
19ed 28 17 jrz 0x17 // 0x1a06; (0xdcb0) == 0 springe
19ef FE 01 cp 0x01 // a <> 1
19f1 20 03 jrnz 0x03 // 0x19f6 (0xdcb0) > 1 springe
19f3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
19f4 18 08 jr 0x09 // 0x19fe (0xdcb0) == 1 springe
// Einsprung (0xdcb0) > 1
19f6 47 ld b, a // rette A
19f7 E6 0F and 0x0f // Maske 0000 1111
19f9 28 1D jrz 0x1d // 0x1a18; ZWR
19fb 78 ld a, b // lade A zurück
19fc CB 87 res 0, a // bit 0 von A = 0
// Einsprung (0xdcb0) == 1
19fe C6 02 add a, 0x02 // A + 2
1a00 27 daa // BCD korrektur
1a01 32 B0 DC ld (0xdcb0), a
1a04 18 B8 jr 0x18 // 0x19be; Springe zu -Datenausgabe-
// Einsprung (0xdcb0) == 0
1a06 3E 07 ld a, 0x07 // 2 * NL
1a08 21 B0 DC ld hl, 0xdcb0
1a0b 36 01 ld (hl), 0x01
1a0d 32 AA DC ld (0xdcaa), a // Sonderdruck Nr. 7
1a10 21 A9 DC ld hl, 0xdca9 // Arbeitsart Drucker
1a13 CB D6 set 2, (hl) // Sonderdruck Ein
1a15 C3 80 19 jp 0x1980 // Schleife
1a18 3E 06 ld a, 0x06 // ZWR
1a1a 21 B0 DC ld hl, 0xdcb0
1a1d CB C6 set 0, (hl)
1a1f 18 EC jr 0xec // 0x1a0d
// UP ZUM DRUCKER
// BILDDRUCK; INPUTS BILDDRUCK-NR. in A 1... 5
1a21 32 AA DC ld (0xdcaa), a // Sonderdruck Nr. 0, 1, 2, 3 - Abspann, 4 - GTX MIRA, 5 - GTX in 5er Gruppen
1a24 3E 35 ld a, 0x35
1a26 32 A9 DC ld (0xdca9), a // Arbeitsart Drucker = 0x35
1a29 CD 92 18 call 0x1892 // Druckersteuerroutine
1a2c CD 04 18 call 0x1804 // DRCON
1a2f C9 ret
// RETI-TRICK
1a30 FB EI
1a31 ED 4D reti
// DRUCKPROGRAMM; INPUTS B = 0x00 AUSGABE L-BIT; B = 0x02 AUSGABE H-BIT
1a33 DB 04 in a, (0x04) // Lese PIO-1-A-D
1a35 CB 8F res 1, a // Lösche bit 1
1a37 B0 or b // je nach B bit 0 oder 2 = 1 UND bit 1 = 0
1a38 D3 04 out (0x04), a // PIO-1-A-D
1a3a C9 ret
// Konverter T-316 - ASCII; Übergabe a = T-316 Zeichen; Rückgabe a = ASCII Zeichen
1a3b 21 9F 1A ld hl, 0x1a9f // CITT-2 Tabelle
1a3e 01 40 00 ld bc, 0x0040 // Durchsuche 64 Zeichen
1a41 ED B1 cpir // BC == 0? oder a == (HL)
1a43 21 DF 1A ld hl, 0x1adf // ASCI Tabelle - Tastatur rückwärts
1a46 09 add hl, bc // 0x1adf + 0x00 ... 0x40
1a47 7E ld a ,(hl) // Rückgabe ASCII Zeichen
1a48 C9 ret
//Druckerformatierung mit Klartext
1a49 5B 1A // Zeiger 0 = cr
1a4b 5C 1A // Zeiger 1 = EINGANG: cr cr cr cr
1a4d 6B 1A // Zeiger 2 = AUSGANG: cr cr cr cr
1a4f 7A 1A // Zeiger 3 = cr cr cr cr
1a51 7F 1A // Zeiger 4 = cr cr GEHEIMTEXT _ _ _ _ _
1a53 91 1A // Zeiger 5 = _ GRUPPEN CR CR CR
1a55 9C 1A // Zeiger 6 = cr
1a57 9D 1A // Zeiger 7 = cr cr
1a59 9F 1A // Zeiger 8 = ??, getrickst mit doppel X
// Sonderdrucklisten:
1a5b 0D // B1, CR
1a5c 1B 40 7F 45 49 4E 47 41 4E 47 3A 0D 0D 0D 0D // B2, EINGANG: cr cr cr cr; 0x1b 0x40 0x7f == Drucker reset und Druckerpuffer löschen
1a6b 1B 40 7F 41 55 53 47 41 4E 47 3A 0D 0D 0D 0D // B3, AUSGANG: cr cr cr cr; 0x1b 0x40 0x7f == Drucker reset und Druckerpuffer löschen
1a7a 0D 0D 0D 0D 0D // B4, cr cr cr cr cr
1a7f 0D 0D 0D 47 45 48 45 49 4D 54 45 58 54 20 20 20 20 20 // B5, cr cr cr GEHEIMTEXT _ _ _ _ _
1a91 20 47 52 55 50 50 45 4E 0D 0D 0D // B6, _ GRUPPEN cr cr cr
1a9c 20 // B7, _
1a9d 0D 0D // B8, cr cr
Umwandlungstabelle T-316- CITT-2 -> 6 bit ASCII
1a9f 04 // Space
1aa0 17 // Q
13 // W
01 // E
0A // R
10 // T
15 // Y
07 // U
06 // I
18 // O
16 // P
03 // A
05 // S
09 // D
0D // F
1A // G
14 // H
1ab0 0B // J
0F // K
12 // L
08 // < WR?
11 // Z
1D // X
0E // C
1E // V
19 // B
0C // N
1C // M
22 // %
37 // 1
33 // 2
21 // 3
2A // 4
1ac0 30 // 5
35 // 6
27 // 7
26 // 8
38 // 9
36 // 0
23 // -
25 // +
29 // =
2D // /
3A // :
2B // *
2F // (
32 // )
31 // "
2E // ;
1ad0 3E // !
39 // ? ->
2C // ,
3C // .
02 // ->
24 // NL
22 // %
28 // >
3D // &
3B // [ -> in ITA-2 ist das Ziffernumschaltung
3F // ] -> in ITA-2 ist das Buchstabenumschaltung
08 // <
1B // # -> in ITA-2 ist das Ziffernumschaltung
20 // '
1F // $ -> in ITA-2 ist das Buchstabenumschaltung
ASCII-Tabelle für Drucken & Abbild der Tastatur rückwärts
1adf 24 // $
1ae0 27 23 3C 3E 3C 26 3E 25 0D 5F 2E 2C 3F 21 3B 22 // '#<><&>%._.,?!;"
1af0 29 28 2A 3A 2F 3D 2B 2D 30 39 38 37 36 35 34 33 // )(*:/=+-09876543
1b00 32 31 25 4D 4E 42 56 43 58 5A 3C 4C 4B 4A 48 47 // 21%MNBVCXZ<LKJHG
1b10 46 44 53 41 50 4F 49 55 59 54 52 45 57 51 20 // FDSAPOIUYTREWQ
// CRC Überprüfung, Übergabe HL Wertebereich, Rückgabe A 0 = io, 0xff = falsch
// UNTERPRGRAMM KONTROLLE CRC-WERTE 2
/*******************************************/
/* Übergabe HL Adresse
/* Übergabe BC Länge des Datenbereiches
/* Übergabe (0xdc2b) zu überprüfende CRC
/* Rückgabe DE CRC Wert aus der CRC Funktion
/* A = 0 OK, = ff Fehler
/*******************************************/
1b1f CD 31 1B call 0x1b31 // CRC2-16 Schleife, Übergabe: HL Wert, Rückgabe: CRC in DE
1b22 2A 2B DC ld hl, (0xdc2b) // hier steht die Adresse zur CRC16 Prüfsumme
1b25 46 ld b, (hl)
1b26 23 inc hl
1b27 4E ld c, (hl) // BC = CRC gespeicherter Wert
1b28 EB ex de, hl // Registerinhalt Tausch DE <> HL
1b29 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0;
1b2a ED 42 sbc hl, bc // CRC Vergleich
1b2c 28 02 jrz 0x02 // 0x1b30, OK A = 0, sonst 0xff
1b2e 3E FF ld a, 0xff // A = 0xff Fehler
1b30 C9 ret
// CRC-16 Schleife, Übergabe HL ANFANGSWERT, BC LÄNGE, Rückgabe CRC in DE
// UNTERPROGRAMM CRC-WERT-BERECHNUNG VON A, DE
/*************************************************/
/* CRC Vektor = 0x0000
/* Übergabe HL Adresse der Daten
/* Übergabe BC Länge der Daten
/* Rückgabe DE die 16bit CRC
/*************************************************/
1b31 11 00 00 ld de, 0x0000 // CRC Vektor 0x0000
1b34 7E ld a, (hl) <--\
1b35 CD 3F 1B call 0x1b3f | // CRC2-16 mit Übergabe des Vektors, Übergabe DE-CRC Vektor, A Wert, Rückgabe DE CRC
1b38 23 inc hl |
1b39 0B dec bc |
1b3a 78 ld a, b |
1b3b B1 or c |
1b3c 20 F6 jrnz 0xf6 >--/ // 0x1b34, bis BC = 0x0000
1bee C9 ret
// CRC2-16 mit Übergabe des Vektors, Übergabe DE CRC Vektor, A Wert, Rückgabe DE CRC
/**********************************************/
/* AUFRUF RO.CRC
/* ÜBERGABEPARAMETER
/* A = NEUES BYTE
/* DE = ALTER CRC WERT
/* RÜCKGABEPARAMETER:
/* DE = NEUER CRC-WERT
/* REGISTERÄNDERUNG AF, DE
/**********************************************/
1b3f AA xor d
1b40 57 ld d, a
1b41 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b42 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b43 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b44 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b45 E6 0F and 0x0f
1b47 AA xor d
1b48 57 ld d, a
1b49 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b4a 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b4b 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b4c F5 push af // rette AF
1b4d E6 1F and 0x1f // Maske 0001 1111
1b4f AB xor e
1b50 5F ld e, a
1b51 F1 pop af // wiederherstellen AF
1b52 F5 push af // rette AF
1b53 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
1b54 E6 F0 and 0xf0
1b56 AB xor e
1b57 5F ld e, a
1b58 F1 pop af // wiederherstellen AF
1b59 E6 E0 and 0xe0
1b5b AA xor d
1b5c 53 ld d, e
1b5d 5F ld e, a
1b5e C9 ret
// Lösche Bereich; Übergabe HL, Länge BC
1b5f D5 push de // Rette DE
1b60 36 00 ld (hl), 0x00
1b62 E5 push hl // Registerwechsel
1b63 D1 pop de // DE = HL
1b64 13 inc de // DE = HL + 1
1b65 ED B0 ldir // kopiere HL > DE länge BC
1b67 D1 pop de // DE zurückladen
1b68 C9 ret
// Rundenschlüssel für Feistel, Übergabe A, Schlüssel 0xde9e ... 0xdea5, Rückgabe 0xde00
/* Speicher 0xdc52 + 8, 0xde9e Schlüsselauszug */
1b69 21 00 DE ld hl, 0xde00 // GTextspeicher
1b6c 22 90 DE ld (0xde90), hl // Zeiger GTextspeicher
1b6f 11 01 DE ld de, 0xde01
1b72 01 7F 00 ld bc, 0x007f // Länge 128 byte
1b75 36 00 ld (hl), 0x00
1b77 ED B0 ldir // lösche Textspeicher 0xde00 - 0xde7f
1b79 11 88 DE ld de, 0xde88 // Zwischenspeicher Transposition + n, n = 0 ... 3
1b7c 0E 04 ld c, 0x04 // Schleifenvariable C = 4
1b7e 21 A5 DE ld hl, 0xdea5 <--\ // letztes Byte aus 0xde9e + 8 Schlüsselkopie
1b81 06 08 ld b, 0x08 | // Schleifenvariable B = 8
1b83 CB 16 rl (hl) <--\ | // rotiere (HL), carry <- (HL.7) <- (HL.0) <- carry
1b85 17 rla | | // rotiere A, carry -> A0 -> A7 -> carry
1b86 2B dec hl | | // Bit 7 von (HL) nach A via carry-Flag, 8 bits; 0xdea5 - 0xde9d
1b87 10 FA djnz 0xfa >--/ | // 0x1b83, 8*, (HL) = 0xde9d - 0xdea5; 8 bit in A - aus (HL+n bitNr 7 ... 0)
1b89 12 ld (de), a | // (0xde88 + C) = A; 0xde88, 0xde89, 0xde8a, 0xde8b in diesen stehen die eingesammelten Bit7.HL
1b8a 13 inc de | // 0xde88 bits 7, 0xde89 bits 6, bis 0xde88 - 0xde90
1b8b 0D dec c | // DE = 4 * 8 = 32 bit aus (HL)
1b8c 20 F0 jrnz 0xf0 >--/ // 0x1b7e, 4*; Aufteilung Bits 7 ... 4 nach: 0xde88-0xde8b, 0xde8f = 0xde8b, 0xde8c - 0xde8e = Low-Bits aus 0xdea5 - 0xde9e
1b8e 11 8F DE ld de, 0xde8f // Bits rückwärts ablegen
1b91 12 ld (de), a // Runde 1; 0xde8f = A = bits 4 == 0xde8b
1b92 1B dec de // 0xde8e
1b93 0E 03 ld c, 0x03 // Schleifenvariable C
1b95 21 A5 DE ld hl, 0xdea5 <--\ // letztes Byte aus 0xde9e + 8 Schlüsselkopie
1b98 06 08 ld b, 0x08 | // Schleifenvariable B
1b9a CB 16 rl (hl) <--\ | // rotiere (HL), carry <- (HL.7) <- (HL.0) <- carry
1b9c 17 rla | | // rotiere A, carry -> A0 -> A7 -> carry
1b9d 2B dec hl | |
1b9e 10 FA djnz 0xfa >--/ | // 8 Runden; bits 3 ... 1
1ba0 12 ld (de), a | // 0xde8e = bits 3, 0xde8d = bits 2, 0xde8c = bits 1
1ba1 1B dec de |
1ba2 0D dec c | // 0xde8e ... 0xde8c,
1ba3 20 F0 jrnz 0xf0 >--/ // 0x1b95; bits 3 ... 1 extrahiert
// Ende Transposition; Bit 0 wird nicht extrahiert!
1ba5 21 FC 7E ld hl, 0x7efc // Initalwert b 0111_1110_1111_1100
1ba8 22 92 DE ld (0xde92), hl // Variable Initalwert
1bab 21 94 DE ld hl, 0xde94 // schleifenvariable
1bae 36 10 ld (hl), 0x10 // Rundenanzahl = 16
1bb0 06 02 ld b, 0x02 <-\ // 2 * 16 Runden
1bb2 FD 21 88 DE ld iy, 0xde88 <----\ | // Einsprung aus 0x1bf5, bits 7; die extrahierten Bits 7, 6, 5,...
1bb6 AF xor a | | // Lösche A, Z = 1, carry = 0, 32 bit rotieren
1bb7 FD CB 03 16 rl (iy + 0x03) | | // 0xde8b bits 4; rotiere (IY+3), carry <- (IY+3.7) <- (IY+3.0) <- carry
1bbb FD CB 02 16 rl (iy + 0x02) | | // 0xde8a bits 5; rotiere (IY+2), carry <- (IY+2.7) <- (IY+2.0) <- carry.bits4(.7)
1bbf FD CB 01 16 rl (iy + 0x01) | | // 0xde89 bits 6; rotiere (IY+1), carry <- (IY+1.7) <- (IY+1.0) <- carry.bits5(.7)
1bc3 FD CB 00 16 rl (iy + 0x00) | | // 0xde88 bits 7; rotiere (IY+0), carry <- (IY+0.7) <- (IY+0.0) <- carry.bits6(.7)
1bc7 1F rra | | // rotiere A; carry.bits7(.7) -> A7 -> A0 -> carry
1bc8 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bc9 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bca 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bcb FD B6 03 or (iy + 0x03) | | // A = A or IY + 3; Maske bits 4 OR 0xde8b; ...
1bce FD 77 03 ld (iy + 0x03), a | | // IY + 3 bits 4
1bd1 FD 7E 07 ld a, (iy + 0x07) | | // a = (0xde8f)
1bd4 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bd5 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bd6 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bd7 1F rra | | // rotiere A; carry -> A7 -> A0 -> carry
1bd8 FD CB 06 16 rl (iy + 06) | | // bits 1; 0xde8e (IY carry < 7 ... 0 < carry)
1bdc FD CB 05 16 rl (iy + 05) | | // bits 2; 0xde8d (IY carry < 7 ... 0 < carry)
1be0 FD CB 04 16 rl (iy + 04) | | // bits 3; 0xde8c (IY carry < 7 ... 0 < carry)
1be4 FD CB 07 16 rl (iy + 07) | | // bits 4; 0xde8f (IY carry < 7 ... 0 < carry)
1be8 05 dec b | | // b == 0; -> P-Box
1be9 28 0C jrz 0x0c >-\ | | // 0x1bf7, 2 Durchläufe ? Ja unten weiter
1beb 2A 92 DE ld hl, (0xde92) | | | // 0xde92 = 0x7efc; 0111 1110 1111 1100 Variable Initalwert
1bee CB 1C rr h | | | // rotiere H 0x7e 0111 1110; carry -> H7 -> H0 -> carry
1bf0 CB 1D rr l | | | // rotiere L 0xfc 1111 1100; carry -> L7 -> L0 -> carry
1bf2 22 92 DE ld (0xde92), hl | | | // 0xde92 Zwischenspeicher Initalwert + carry
1bf5 38 BB jrc 0xbb | >-/ | // 0x1bb2, 2 Durchläufe, Aufteilung 4 bits "L" / "R" ?
// Ende Bits extrahieren | |
// P-Box | |
1bf7 DD 21 18 1F ld ix, 0x1f18 <-/ | // Permutationsbox-Box 64 byte
1bfb FD 21 8F DE ld iy, 0xde8f | // bits 4
1bff 0E 08 ld c, 0x08 | // Schleifenzähler C, 8 Runden
1c01 06 08 ld b, 0x08 <-\ | // Schleifenzähler B, 8 Runden
1c03 FD CB 00 0E rrc (iy + 0x00) | <-\ | // bits 0 rotieren (IY+0); (IY+0.0) -> (IY+0.7) -> (IY+0.0) carry = (IY+0.0)
1c07 DD 56 00 ld d, (ix + 0x00) | | | // d = 0x63; P-Box erster Wert, ... + B + C
1c0a DD 23 inc ix | | | // ix = 0x1f19; P-Box zweiter Wert, ... + B + C
1c0c 30 18 jrnc 0x18 >-\ | | | // 0x1c26, rrc (IX+0)bit 0 = 0?; Schleife einen Schritt überspringen
1c0e 7A ld a, d | | | | // a = byte P-Box (0x01 ... 0x76)
1c0f E6 F0 and 0xf0 | | | | // Maskiere a= 0x60; High-byte
1c11 0F rrca | | | | // rotieren A; A7 -> A0, A0 -> A7, carry = A0, 0110 0000 > 0011 0000 Carry = 0
1c12 0F rrca | | | | // 0001 1000 Carry = 0
1c13 0F rrca | | | | // 0000 1100 Carry = 0
1c14 0F rrca | | | | // a = 0x06, 0000 0110, carry = 0; Swap Hig-Low; benutzt Low-Teil
1c15 2A 90 DE ld hl, (0xde90) | | | | // Zeiger auf 0xde00, GTextspeicher 128 byte
1c18 85 add a, l | | | | // 00 + 0x06, ...
1c19 6F ld l, a | | | | // 0xde06 ...
1c1a 7A ld a, d | | | | // a = 0x63; P-Box
1c1b E6 0F and 0x0f | | | | // Maskiere a; Low-Byte
1c1d 57 ld d, a | | | | // d = 0x03 -> Schleifenzähler; 0x01 ... 0x09, entspricht Bit 1 ... 7, 0!
1c1e AF xor a | | | | // Lösche A, Z-Flag = 1, carry-Flag = 0
1c1f 37 scf | | | | // carry = 1
1c20 17 rla <--\ | | | | // rotiere A, carry -> A0 -> A7 -> carry; A = 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00; Bit 0x40 und 0x80 werden nicht benutzt!
1c21 15 dec d | | | | | // Schleifenzähler, D Runden, 1 ... 9 Runden
1c22 20 FC jrnz 0xfc <--/ | | | | // 0x1c20
1c24 B6 or (hl) | | | | // A OR (HL); Setze Bit (A)[0 ... 7] in berechnetes (HL), Einzelnes bit 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, ODER 0x00
1c25 77 ld (hl), a | | | | // gesetzte bits 1,2,4,8,0x10,0x20 speichern
1c26 10 DB djnz 0xdb <-/ | >-/ | // 0x1c03, Schleifenzähler B, 8 Runden
1c28 FD 2B dec iy | | // 128 bit Speicher, rückwärts, Bits 1, 2, ... 7
1c2a 0D dec c | | // Schleifenzähler C, 128 bit bearbeitet
1c2b 20 D4 jrnz 0xd4 >-/ | // 0x1c01, Schleife 8mal (64 Runden)
1c2d 3A 90 DE ld a, (0xde90) | // 0xde00, GTextspeicher 128 byte
1c30 C6 08 add a, 0x08 | // Länge + 8; 64 bit bearbeitet
1c32 32 90 DE ld (0xde90), a | // 0xde08, ... 64bit Blöcke
1c35 21 94 DE ld hl, 0xde94 | // Schleifenzähler, 16 Runden
1c38 35 dec (hl) | // (HL) <> 0
1c39 C2 B0 1B jpnz 0x1bb0 >-/ // Schleife 16 Runden, 128 byte
1c3c C9 ret // in 0xde00 ... 0xde7f Rundenschlüssel für Feistel
// Feistel und G(X, Y) Funktion; Startwert 0x00: Funktion A -> C mit der Funktion G aus pdf *601; Programm bis 0x1f17
1c3d AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
1c3e 18 02 jr 0x02 >-\ // 0x1c42
// Einsprung | // Startwert 0xff; aus: 64 bit Manipulation L - R
1c40 3E FF ld a, 0xff | // Einsprung von: 0x297a PWD Check; Feistel Rückwärts
1c42 32 95 DE ld (0xde95), a <-/ // Sichere a; A = Chiffrieren/Dechiffrieren (0x00, 0xff); Nur für die Passwortfunktion
1c45 21 96 DE ld hl, 0xde96 // Input Ktxt (IV), a = 0: Kopie 64bit; a = 0xff:
1c48 06 08 ld b, 0x08 //
1c4a CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c4c 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c4d 23 inc hl | // a(bit n+1) = (HL + n-1)
1c4e 10 FA djnz 0xfa >-/ // 0x1c4a, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c50 32 80 DE ld (0xde80), a // 0xde80 Byte 1-Bits7
1c53 21 96 DE ld hl, 0xde96
1c56 06 08 ld b, 0x08
1c58 CB 06 rlc (hl) <-} // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c5a 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c5b 23 inc hl | // a(bit n+1) = (HL + n-1)
1c5c 10 FA djnz 0xfa >-/ // 0x1c58, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c5e 32 84 DE ld (0xde84), a // 0xde84 Byte 2-Bits6
1c61 21 96 DE ld hl, 0xde96
1c64 06 08 ld b, 0x08
1c65 CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c67 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c68 23 inc hl | // a(bit n+1) = (HL + n-1)
1c69 10 FA djnz 0x0fa >-/ // 0x1c66, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c6b 32 81 DE ld (0xde81), a // 0xde81 Byte 3-Bits5
1c6f 21 96 DE ld hl, 0xde96
1c72 06 08 ld b, 0x08
1c74 CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c76 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c77 23 inc hl | // a(bit n+1) = (HL + n-1)
1c78 10 FA djnz 0xfa >-/ // 0x1c74, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c7a 32 85 DE ld (0xde85), a // 0xde85 Byte 4-Bits4
1c7d 21 96 DE ld hl, 0xde96
1c80 06 08 ld b, 0x08
1c82 CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c84 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c85 23 inc hl | // a(bit n+1) = (HL + n-1)
1c86 10 FA djnz 0xfa >-/ // 0x1c82, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c88 32 82 DE ld (0xde82), a // 0xde82 Byte 5-Bits3
1c8b 21 96 DE ld hl, 0xde96
1c83 06 08 ld b, 8
1c90 CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1c92 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1c93 23 inc hl | // a(bit n+1) = (HL + n-1)
1c94 10 FA djnz 0xfa >-/ // 0x1c90, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1c96 32 86 DE ld (0xde86), a // 0xde86 Byte 6-Bits2
1c99 21 96 DE ld hl, 0xde96
1c9c 06 08 ld b, 0x08
1c9e CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1ca0 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1ca1 23 inc hl | // a(bit n-1) = (HL + n-1)
1ca2 10 FA djnz 0xfa >-/ // 0x1c9e, 8 bit nach a gespiegelt; Zeile wird in Spalten abgelegt
1ca4 32 83 DE ld (0xde83), a // 0xde83 Byte 7-Bits1
1ca7 21 96 DE ld hl, 0xde96
1caa 06 08 ld b, 0x08
1cac CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1cae 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1caf 23 inc hl | // a(bit n) = (HL + n bit 7)
1cb0 10 FA djnz 0xfa >-/ // 0x1cac, 8 bit nach a gespiegelt - transponiert; Zeile wird in Spalten abgelegt
1cb2 32 87 DE ld (0xde87), a // 0xde87 Byte 8-Bits0
1cb5 21 80 DE ld hl, 0xde80
1cb8 46 ld b, (hl) // b = (0xde80) bits-7
1cb9 23 inc hl
1cba 4E ld c, (hl) // c = (0xde81) bits-5
1cbb 23 inc hl
1cbc 56 ld d, (hl) // d = (0xde82) bits-3
1cbd 23 inc hl
1cbe 5E ld e, (hl) // e = (0xde83) bits-1
1cbf C5 push bc // rette BC, (0xde80, 0xde81)
1cc0 23 inc hl
1cc1 46 ld b, (hl) // b = (0xde84) bits-6
1cc2 23 inc hl
1cc3 4E ld c, (hl) // c = (0xde85) bits-4
1cc4 C5 push bc // Registerwechsel; Rette BC -> kopiere nach IX, via PUSH -> POP
1cc5 DD E1 pop ix // (--sp)IX zeigt auf wert von BC (0xde84, 0xde85)
1cc7 23 inc hl // 0xde86
1cc8 46 ld b, (hl) // b = (0xde86) bits-2
1cc9 23 inc hl // 0xde87
1cca 4E ld c, (hl) // c = (0xde87) bits-0
1ccb C5 push bc // Registerwechsel; Rette BC -> kopiere nach IY, via PUSH -> POP
1ccc FD E1 pop iy // (--sp) IY zeigt auf Wert von BC (0xde86, 0xde87)
1cce C1 pop bc // wiederherstellen BC, (0xde80, 0xde81)
1ccf 3A 95 DE ld a, (0xde95) // hole a zurück, 0x00 oder 0xff
1cd2 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1cd3 28 02 jrz 0x02 // 0x1cd7, a > 0x00 then a = 0x0f
1cd5 3E 0F ld a, 0x0f // nein dann A = 0x0f
// Berechnung der HL-Adressen 0xde00 bis 0xde78; 0xde78 bis 0xde00 rückwärts bei A = 0x0f
1cd7 F5 push af // rette Schleifenzähler AF, 0x00 oder 0x0f
1cd8 21 00 DE ld hl, 0xde00 // Rundenschlüssel 128 byte
1cdb D5 push de // Rette DE; 0xde82,83; Bits3 Bits1
1cdc 16 00 ld d, 0x00
1cde 5F ld e, a // e = 0x00 oder 0x0f; carry 0x0f; 0x00
1cdf CB 23 sla e // schiebe E, carry <- E7 <- E0 <- 0, 0x1e; 0
1ce1 CB 12 rl d // rotiere D, carry -> D0 -> D7 -> carry 0x00; 0
1ce3 CB 23 sla e // 0x2a; 0
1ce5 CB 12 rl d // 0x00; 0
1ce7 CB 23 sla e // 0x48; 0
1ce9 CB 12 rl d // 0x00; 0
1ceb 19 add hl, de // Adresse 0xde00 oder 0xde48 "R/L"
1cec D1 pop de // wiederherstellen DE; 0xde00
// "Expansion" ?
// K-Boxen (K-Box 0-7) Substitution durch K-Box (bei DES == S-Box) Schleife "A" < 0x10 Wiederholung 0x1e7e; 16 Runden
1ced C5 push bc
1cee D5 push de // 0x1e6a POP IX, POP IY
1cef E5 push hl // Rette Register, HL = HL+DE aus 0x1ceb
1cf0 78 ld a, b // s. 0x1cbf: b = (0xde80) bits-1
1cf1 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1cf2 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1cf3 1F rra // rotiere A, A0 > carry > A7 > A0; 0100 1000 >> 0000 1001 (0)
1cf4 E6 1F and 0x1f // Maske nur bit 0 bis 4; xxxB BBBB
1cf6 CB 43 bit 0, e // prüfe Reg. E bit 0 == true
1cf8 28 02 jrz 0x02 >-| // 0x1cfc, Bit 2 == 0
1cfa CB EF set 5, a | // A = xx1x xxxx
1cfc AE xor (hl) <-| // a = a xor (HL) (0xde00...) (0xde48 ...) "R/L"
// "Eingang" K-Box 1
1cfd 21 00 3E ld hl, 0x3e00 // K-Box / K-Boxen 1; Teil der "G"-Funktion
1d00 85 add a, l // a = 0x20 + 0x00
1d01 6F ld l, a // l = l + 0x20
1d02 7E ld a, (hl) // Index a = (0x3e20) 0x04
1d03 E1 pop hl // Hole HL zurück, berechnete Adresse 0xde00 0xde48 "R/L"
1d04 F5 push af // rette AF, 1
1d05 23 inc hl // 0xde00 + 1, (+8)
1d06 E5 push hl // rette HL
1d07 78 ld a, b // s. 0x1cf0 -> s. 0x1cc8: b = (0xde86) bits-1
1d08 C5 push bc // rette BC
1d09 CB 11 rl c // rotiere C, carry -> C0 -> C7 -> carry
1d0b 17 rla // rotiere A, carry -> A0 -> A7 -> carry
1d0c E6 3F and 0x3f // Maske 0011 1111
1d0e C1 pop bc // wiederherstellung BC
1d0f AE xor (hl) // A XOR (HL), berechnete Adresse 0xde00 0xde48 "R/L"
// K-Box 2
1d10 21 40 3E ld hl, 0x3e40 // K-Box 2
1d13 85 add a, l // a += 0x40
1d14 6F ld l, a
1d15 7E ld a, (hl) // Index a = (H, L+A)
1d16 E1 pop hl // wiederherstellen HL
1d17 F5 push af // rette AF, 2
1d18 23 inc hl // 0xde00 + 2 (+8)
1d19 E5 push hl // rette HL
1d1a 79 ld a, c
1d1b C5 push bc // rette BC
1d1c CB 18 rr b // rotiere B; carry -> B7 -> B0 -> carry
1d1e 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d1f 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d20 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d21 C1 pop bc // Push BC
1d22 E6 3F and 0x3f // Maske 0011 1111
1d24 AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 3
1d25 21 80 3E ld hl, 0x3e80 // K-Box 3
1d28 85 add a, l // a += 80
1d29 6F ld l, a
1d2a 7E ld a, (hl) // Index a = (H, L+A)
1d2b E1 pop hl // wiederherstellen HL
1d2c F5 push af // rette AF, 3
1d2d 23 inc hl // 0xde00 + 3 (+8)
1d2e E5 push hl // rette HL
1d2f 79 ld a, c
1d30 D5 push de // rette DE
1d31 CB 12 rl d // rotiere D, carry -> D0 -> D7 -> carry
1d33 17 rla // rotiere A, carry -> A0 -> A7 -> carry
1d34 D1 pop de // wiederherstellen DE
1d35 E6 3F and 0x3f // Maske 0011 1111
1d37 AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 4
1d38 21 C0 3E ld hl, 0x3ec0 // K-Box 4
1d3b 85 add a, l // a += c0
1d3c 6F ld l, a
1d3d 7E ld a, (hl) // Index a = (H, L+A)
1d3e E1 pop hl // wiederherstellen HL
1d3f F5 push af // rette AF, 4
1d40 23 inc hl // 0xde00 + 4 (+8)
1d41 E5 push hl // rette HL
1d42 7A ld a, d
1d43 C5 push bc // rette BC
1d44 CB 19 rr c // rotiere C; carry -> C7 -> C0 -> carry
1d46 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d47 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d48 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d49 C1 pop bc // wiederherstellen BC
1d4a E6 3F and 0x3f // Maske 0011 1111
1d4c AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 5
1d4d 21 00 3F ld hl, 0x3f00 // K-Box 5
1d50 85 add a, l // a += 0x00
1d51 6F ld l, a
1d52 7E ld a, (hl) // Index a = (H, L+A)
1d53 E1 pop hl // wiederherstellen HL
1d54 F5 push af // rette AF, 5
1d55 23 inc hl // 0xde00 + 5 (+8)
1d56 E5 push hl // rette HL
1d57 7A ld a, d
1d58 D5 push de // rette DE
1d59 CB 13 rl e // rotiere E, carry -> E0 -> E7 -> carry
1d5b 17 rla // rotiere A, carry -> A0 -> A7 -> carry
1d5c D1 pop de // wiederherstellen DE
1d5d E6 3F and 0x3f // Maske 0011 1111
1d5f AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 6
1d60 21 40 3F ld hl, 0x3f40 // K-Box 6
1d63 85 add a, l // a += 0x40
1d64 6F ld l, a
1d65 7E ld a, (hl) // Index a = (H, L+A)
1d66 E1 pop hl // wiederherstellen HL
1d67 F5 push af // rette AF, 6
1d68 23 inc hl // 0xde00 + 6 (+8)
1d69 E5 push hl // rette HL
1d6a 7B ld a, e
1d6b D5 push de // rette DE
1d6c CB 1A rr d // rotiere D; carry -> D7 -> D.0 -> carry
1d6e 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d6f 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d70 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1d71 D1 pop de // wiederherstellen DE
1d72 E6 3F and 0x3f // Maske 0011 1111
1d74 AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 7
1d75 21 80 3F ld hl, 0x3f80 // K-Box 7
1d78 85 add a, l // a += 0x80
1d79 6F ld l, a
1d7a 7E ld a, (hl) // Index a = (H, L+A)
1d7b E1 pop hl // wiederherstellen HL
1d7c F5 push af // rette AF, 7
1d7d 23 inc hl // 0xde00 + 7 (+8)
1d7e 7B ld a, e
1d7f CB 10 rl b // rotiere B, carry -> B0 -> B7 -> carry
1d81 17 rla // carry nach A bit 0
1d82 E6 3F and 0x3f // Maske 0011 1111
1d84 AE xor (hl) // A = 0x3f XOR (HL)
// K-Box 8
1d85 21 C0 3F ld hl, 0x3fc0 // K-Box 8
1d88 85 add a, l // a += 0xc0
1d89 6F ld l, a
1d8a 7E ld a, (hl) // Index a = (H, L+A)
1d8b 01 00 00 ld bc, 0x0000
1d8e 11 00 00 ld de, 0x0000
1d91 CB 5F bit 3, a // bit A 0, 1, 2, 3 setzt bits 5,3,1 in bc de; 0x1d8a Datenbereich 8
1d93 28 02 jrz 0x02 >-\ // 0x1d97
1d95 CB D8 set 3, b |
1d97 CB 57 bit 2, a <-/ // bit 2 == true
1d99 28 02 jrz 0x02 >-\ // 0x1d9d
1d9b CB EB set 5, e |
1d9d CB 4F bit 1, a <-/ // bit 3 == true
1d9f 28 02 jrz 0x02 >-\ // 0x1da3
1da1 CB C9 set 1, c |
1da3 CB 47 bit 0, a <-/ // bit 0 == true
1da5 28 02 jrz 0x02 >-\ // 0x1da9
1da7 CB DA set 3, d | // bit A 0, 1, 2, 3 setzt bits 5,3,1 in bc de; 0x1d8a
1da9 F1 pop af <-/ // wiederherstellen AF, 7; bit A 0, 1, 2, 3 setzt bits in 0,4,2,1 bc de; 0x1d7a K-Box 7
1daa CB 5F bit 3, a // bit 3 == true
1dac 28 02 jrz 0x02 >-\ // 0x1db0
1dae CB C3 set 0, e |
1db0 CB 57 bit 2, a <-/ // bit 2 == true
1db2 28 02 jrz 0x02 >-\ // 0x1db6
1db4 CB E1 set 4, c |
1db6 CB 4F bit 1, a <-/ // bit 1 == true
1db8 28 02 jrz 0x02 >-\ // 0x1dbc
1dba CB D2 set 2, d |
1dbc CB 47 bit 0, a <-/ // bit 0 == true
1dbe 28 02 jrz 0x02 >-\ // 0x1dc2
1dc0 CB C8 set 1, b | // bit A 0, 1, 2, 3 setzt bits in 0,4,2,1 bc de; 0x1d7a
1dc2 F1 pop af <-/ // wiederherstellen AF, 6; bit A 0, 1, 2, 3 setzt bits in 3,4,5 bc de; 0x1d65 K-Box 6
1dc3 CB 5F bit 3, a // bit 3 == true
1dc5 28 02 jrz 0x02 >-\ // 0x1dc9
1dc7 CB E0 set 4, b |
1dc9 CB 57 bit 2, a <-/ // bit 2 == true
1dcb 28 02 jrz 0x02 >-\ // 0x1dcf
1dcd CB DB set 3, e |
1dcf CB 4F bit 1, a <-/ // bit 1 == true
1dd1 28 02 jrz 0x02 >-\ // 0x1dd5
1dd3 CB E9 set 5, c |
1dd5 CB 47 bit 0, a <-/ // bit 0 == true
1dd7 28 02 jrz 0x02 >-\ // 0x1ddb
1dd9 CB EA set 5, d | // bit A 0, 1, 2, 3 setzt bits in 4,3,5 bc de; 0x1d65
1ddb F1 pop af <-/ // wiederherstellen AF, 5; bit A 0, 1, 2, 3 setzt bits in bc 0,2,5,7 de; 0x1d52 K-Box 5
1ddc CB 5F bit 3, a // bit 3 == true
1dde 28 02 jrz 0x02 >-\ // 0x1de2
1de0 CB C0 set 0, b |
1de2 CB 57 bit 2, a <-/ // bit 2 == true
1de4 28 02 jrz 0x02 >-\ // 0x1de8
1de6 CB D1 set 2, c |
1de8 CB 4F bit 1, a <-/ // bit 1 == true
1dea 28 02 jrz 0x02 >-\ // 0x1dee
1dec CB FB set 7, e |
1dee CB 47 bit 0, a <-/ // bit 0 == true
1df0 28 02 jrz 0x02 >-\ // 0x1df4
1df2 CB E8 set 5, b | // bit A 0, 1, 2, 3 setzt bits in 0,2,5,7 bc de; 0x1d52
1df4 F1 pop af <-/ // wiederherstellen AF, 4; bit A 0, 1, 2, 3 setzt bits in 4,6,7 bc de; 0x1d3d Datembereich 4
1df5 CB 5F bit 3, a // bit 3 == true
1df7 28 02 jrz 0x02 >-\ // 0x1dfb
1df9 CB F3 set 6, e |
1dfb CB 57 bit 2, a <-/ // bit 2 == true
1dfd 28 02 jrz 0x02 >-\ // 0x1e01
1dff CB E2 set 4, d |
1e01 CB 4F bit 1, a <-/ // bit 1 == true
1e03 28 02 jrz 0x02 >-\ // 0x1e07
1e05 CB F1 set 6, c |
1e07 CB 47 bit 0, a <-/ // bit 0 == true
1e09 28 02 jrz 0x02 >-\ // 0x1e0d
1e0b CB F8 set 7, b | // bit A 0, 1, 2, 3 setzt bits in 4,6,7 bc de; 0x1d3d
1e0d F1 pop af <-/ // wiederherstellen AF, 3; bit A 0, 1, 2, 3 setzt bits in bc 0,2 de; 0x1d2a K-Box 3
1e0e CB 5F bit 3, a // bit 3 == true
1e10 28 02 jrz 0x02 >-\ // 0x1e14
1e12 CB C2 set 0, d |
1e14 CB 57 bit 2, a <-/ // bit 2 == true
1e16 28 02 jrz 0x02 >-\ // 0x1e1a
1e18 CB C1 set 0, c |
1e1a CB 4F bit 1, a <-/ // bit 1 == true
1e1c 28 02 jrz 0x02 >-\ // 0x1e20
1e1e CB D3 set 2, e |
1e20 CB 47 bit 0, a <-/ // bit 0 == true
1e22 28 02 jrz 0x02 >-\ // 0x1e26
1e24 CB D0 set 2, b | // bit A 0, 1, 2, 3 setzt bits in 0,2 bc de; 0x1d2a
1e26 F1 pop af <-/ // wiederherstellen AF, 2; bit A 0, 1, 2, 3 setzt bits in 3,4,6 bc de; 0x1d15 K-Box 2
1e27 CB 5F bit 3, a // bit 3 == true
1e29 28 02 jrz 0x02 >-\ // 0x1e2d
1e2b CB D9 set 3, c |
1e2d CB 57 bit 2, a <-/ // bit 2 == true
1e2f 28 02 jrz 0x02 >-\ // 0x1e33
1e31 CB E3 set 4, e |
1e33 CB 4F bit 1, a <-/ // bit 1 == true
1e35 28 02 jrz 0x02 >-\ // 0x1e39
1e37 CB F0 set 6, b |
1e39 CB 47 bit 0, a <-/ // bit 0 == true
1e3b 28 02 jrz 0x02 >-\ // 0x1e3f
1e3d CB F2 set 6, d | // bit A 0, 1, 2, 3 setzt bits 3,4,6 in bc de; 0x1d15
1e3f F1 pop af <-/ // wiederherstellen AF, 1; bit A 0, 1, 2, 3 setzt bits in 1,7 bc de; 0x1d02 K-Box 1
1e40 CB 5F bit 3, a // bit 3 == true
1e42 28 02 jrz 0x02 >-\ // 0x1e46
1e44 CB F9 set 7, c |
1e46 CB 57 bit 2, a <-/ // bit 2 == true
1e48 28 02 jrz 0x02 >-\ // 0x1e4c
1e4a CB FA set 7, d |
1e4c CB 4F bit 1, a <-/ // bit 1 == true
1e4e 28 02 jrz 0x02 >-\ // 0x1e52
1e50 CB CA set 1, d |
1e52 CB 47 bit 0, a <-/ // bit 0 == true
1e54 28 02 jrz 0x02 >-\ // 0x1e58
1e56 CB CB set 1, e | // bit A 0, 1, 2, 3 setzt bits 1,7 in bc de; 1d02
1e58 DD E5 push ix <-/ // Registerwechsel
1e5a E1 pop hl // HL = IX
1e5b 7C ld a, h // a = 0x3e
1e5c A8 xor b
1e5d 47 ld b, a // b = b xor j
1e5e 7D ld a, l // a = 0x00
1e5f A9 xor c
1e60 4F ld c, a // c = c xor l, BC = IX XOR BC
1e61 FD E5 push iy // Registerwechsel
1e63 E1 pop hl // HL = IY
1e64 7C ld a, h
1e65 AA xor d
1e66 57 ld d, a // d = d xor h
1e67 7D ld a, l
1e68 AB xor e
1e69 5F ld e, a // e = e xor l; DE = HL XOR DE
1e6a FD E1 pop iy // PUSH DE 0x1cee
1e6c DD E1 pop ix // PUSH BC 0x1cee
1e6e 3A 95 DE ld a, (0xde95)
1e71 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
1e72 28 06 jrz 0x06 >-\ // 0x1e7a a == 0?
1e74 F1 pop af | // wiederherstellen AF, 0
1e75 3D dec a | // a--
1e76 FE FF cp 0xff | // a war 0
1e78 18 04 jr 0x04 | >-\ // 0x1e7e -> 0x1cd7
// Einsprung | |
1e7a F1 pop af <-/ | // wiederherstellen AF, 0
1e7b 3C inc a | ^
1e7c FE 10 cp 0x10 | | // a <> 0x10
1e7e C2 D7 1C jpnz 0x1cd7 <-/ -/ // Datenbereich 0-7, byte 0x00 ... 0x3f, 64bit; Schleife Funktionsblock A->C mit G
// 16 Runden - Rundenschlüssel
// Einsprung A == 16
1e81 78 ld a, b
1e82 32 81 DE ld (0xde81), a // Bytes 3
1e85 79 ld a, c
1e86 32 83 DE ld (0xde83), a // Bytes 7
1e89 7A ld a, d
1e8a 32 85 DE ld (0xde85), a // Bytes 4
1e8d 7B ld a, e
1e8e 32 87 DE ld (0xde87), a // BC, DE abgelegt in 0xde81 ... 87
1e91 DD E5 push ix // Registerwechsel
1e93 E1 pop hl // HL = IX
1e94 7C ld a, h
1e95 32 80 DE ld (0xde89), a // IX in 0xde89 und 0xde82
1e98 7D ld a, l
1e99 32 82 DE ld (0xde82), a // Bytes 5
1e9c FD E5 push iy // Registerwechsel
1e9e E1 pop hl // HL = IY
1e9f 7C ld a, h
1ea0 32 84 DE ld (0xde84), a // Bytes 2
1ea3 7D ld a, l
1ea4 32 86 DE ld (0xde86), a // Bytes 6; IX in 0xde84 und 0xde86
// 64bit Block Rück-Transposition von 0xde87 - > 0xde9d
1ea7 21 87 DE ld hl, 0xde87 // Bytes 7
1eaa 06 08 ld b, 0x08
1eac CB 06 rlc (hl) <-\ // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1eae 1F rra | // rotiere A; carry -> A7 -> A0 -> carry
1eaf 2B dec hl | // für 8 bytes, 8bits
1eb0 10 FA djnz 0xfa >-/ // 0x1eac, 8 Runden
1eb2 32 9D DE ld (0xde9d), a
1eb5 21 87 DE ld hl, 0xde87 // Bytes 7
1eb8 06 08 ld b, 0x08
1eba CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1ebc 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1ebd 2B dec hl // für 8 bytes, 8bits
1ebe 10 FA djnz 0xfa // 0x1eba, 8 Runden
1ec0 32 9C DE ld (0xde9c), a
1ec3 21 87 DE ld hl, 0xde87 // Bytes 7
1ec6 06 08 ld b, 0x08
1ec8 CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1eca 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1ecb 2B dec hl // für 8 bytes, 8bits
1ecc 10 FA djnz 0xfa // 0x1ec8, 8 Runden
1ece 32 9B DE ld (0xde9b), a
1ed1 21 87 DE ld hl, 0xde87 // Bytes 7
1ed4 06 08 ld b, 0x08
1ed6 CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
led8 1F rra // rotiere A; carry -> A7 -> A0 -> carry
led9 2B dec hl // für 8 bytes, 8bits
leda 10 FA djnz 0xfa // 0x1ed6, 8 Runden
ledc 32 9A DE ld (0xde9a), a
ledf 21 87 DE ld hl, 0xde87 // Bytes 7
lee2 06 08 ld b, 0x08
lee4 CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
lee6 1F rra // rotiere A; carry -> A7 -> A0 -> carry
lee7 2B dec hl // für 8 bytes, 8bits
lee8 10 FA djnz 0xfa // 0x1ee4, 8 Runden
leea 32 99 DE ld (0xde99), a
leed 21 87 DE ld hl, 0xde87 // Bytes 7
1ef0 06 08 ld b, 0x08
1ef2 CB 06 rlc (hl) // rotieren (carry)(HL); (HL.7) <- (HL.0) <- (HL.7);
1ef4 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1ef5 2B dec hl // für 8 bytes, 8bits
1ef6 10 FA djnz 0xfa // 0x1ef2, 8 Runden
1ef8 32 98 DE ld (0xde98), a
1efb 21 87 DE ld hl, 0xde87 // Bytes 7
1efe 06 08 ld b, 0x08
1f00 CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1f02 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1f03 2B dec hl // für 8 bytes, 8bits
1f04 10 FA djnz 0xfa // 0x1f00, 8 Runden
1f06 32 97 DE ld (0xde97), a
1f09 21 87 DE ld hl, 0xde87 // Bytes 7
1f0c 06 08 ld b, 0x08
1f0e CB 06 rlc (hl) // rotieren (HL); (carry)(HL.7) <- (HL.0) <- (HL.7);
1f10 1F rra // rotiere A; carry -> A7 -> A0 -> carry
1f11 2B dec hl // für 8 bytes, 8bits
1f12 10 FA djnz 0xfa // 0x1f0e, 8 Runden
1f14 32 96 DE ld (0xde96), a
1f17 C9 ret // Ende Feistel G(X, Y)
// Permutations-Box 64 byte;
// Aufbau: H-Teil Adresse (0xde00 + H);
// L-Teil Schleifenzähler bitposition setzen: bit 0 ... bit 7
1f18 63 41 09 61 09 09 09 09
1f20 45 54 74 65 51 42 76 53
1f28 66 09 75 46 55 64 09 43
1f30 73 09 62 52 71 44 56 72
1f38 09 09 09 09 15 34 22 09
1f40 03 26 09 12 33 25 09 05
1f48 36 14 06 32 24 04 11 09
1f50 21 35 13 01 23 16 31 02
-Ende Datenblock
// Kontroll-Dechiffrierung Rückgabe A 0x00 OK, A 0xff Fehler
1f58 3A 00 83 ld a, (0x8300) // Funktion ab 0x1f5f schon aufgerufen und nicht in 0x2e11 zurückgesetzt?
1f5b FE FF cp 0xff // Rundenschlüssel erzeugen Ja/nein
1f5d 28 6C jrz 0x6c >-\ // 0x1fcb, a == 0xff
1f5f 3E FF ld a, 0xff | // Merker Rundenschlüssel erzeugt
1f61 32 00 83 ld (0x8300), a | // Rundenschlüssel erzeugen ja/nein
1f64 21 1C 5C ld hl, 0x5c1c | // 0x5c1c in 0xdc3c abgelegt
1f67 22 3C DC ld (0xdc3c), hl | // Zeiger
1f6a 21 00 84 ld hl, 0x8400 | // Textspeicher; GL.KTSPS
1f6d 22 3E DC ld (0xdc3e), hl | // Zeiger auf Klartext
1f70 2A C6 DC ld hl, (0xdcc6) | // GL.EAKTS; EndAdresse Text-S
1f72 01 00 84 ld bc, 0x8400 | // Startadresse Ktxt
1f75 AF xor a | // Lösche A, Z-Flag = 1, carry-Flag = 0
1f76 ED 42 sbc hl, bc | // 0 < Länge < 132
1f78 CA 25 20 jpz 0x2025 | // Kein Text -> Enter -> Menüprogramm; return
1f7b DA 2A 20 jpc 0x202a | // negative Anzahl, BLOCKIERUNG 5; return
1f7f 11 52 DC ld de, 0xdc52 | // Klartext vorhanden, weiter ...
1f82 2A 81 DC ld hl, (0xdc81) | // Zeiger Schlüssel 1
1f85 01 20 00 ld bc, 0x0020 | // Länge 32 byte, 256 bit
1f88 ED B0 ldir | // Kopiere (0xdc81) > 0xdc52 0x20 bytes
1f8a 2A 83 DC ld hl, (0xdc83) | // Zeiger CRC Schlüssel 1
1f8d 22 2B DC ld (0xdc2b), hl | // Speicherort CRC
1f90 21 52 DC ld hl, 0xdc52 | // der oben kopierte Schlüssel
1f93 01 20 00 ld bc, 0x0020 | // Länge 32 byte
1f96 CD 1F 1B call 0x1b1f | // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
1f99 F6 00 or 0x00 | // a == 0 CRC OK, A = 0xff Fehler
1f9b C2 2A 20 jpnz 0x202a | // BLOCKIERUNG 5
1f9e 21 52 DC ld hl, 0xdc52 | // der oben kopierte Schlüssel
1fa1 11 9E DE ld de, 0xde9e | // Adresse für Speicher Schlüsselbearbeitung
1fa4 01 08 00 ld bc, 0x0008 | // Länge 8 byte
1fa7 ED B0 ldir | // Kopiere 0xdc52 > 0xde9e 8 bytes, A = 0x00
1fa9 CD 69 1B call 0x1b69 | // Rundenschlüssel für Feistel, Übergabe A = 0x00, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
1fac 11 42 DC ld de, 0xdc42 | // Zieladresse; Kopie IV
1faf 21 77 DC ld hl, 0xdc77 | // Startadresse, IV
1fb1 01 08 00 ld bc, 0x0008 | // Länge 8byte
1fb3 ED B0 ldir | // Kopiere 0xdc77 > 0xde42 8 bytes
1fb5 21 7F DC ld hl, 0xdc7f | // CRCiv Länge 2; CRC der IV
1fb8 22 2B DC ld (0xdc2b), hl | // Zeiger auf CRC-IV in 0xDC7f
1fbb 21 42 DC ld hl, 0xdc42 | // Kopie IV
1fc0 01 08 00 ld bc, 0x0008 | // Länge 8 byte
1fc3 CD 1F 1B call 0x1b1f | // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
1fc6 F6 00 or 0x00 | // CRC IV OK?
1fc8 C2 2A 20 jpnz 0x202a | // Blockierung 5
// Einsprung Rundenschlüssel vorhanden |
1fcb 21 42 DC ld hl, 0xdc42 <-/ // Kopie IV
1fce 11 96 DE ld de, 0xde96 // Text-speicher IV
1fd1 01 08 00 ld bc, 0x0008 // Länge 8byte
1fd4 ED B0 ldir // Kopiere (0xdc42) > (0xde96) 8 bytes
1fd6 CD 3D 1C call 0x1c3d // Feistel vorwärts, Übergabe/Rückgabe 0xde96
1fd9 21 96 DE ld hl, 0xde96 // Wurmfolgen
1fdc 11 42 DC ld de, 0xdc42 // nach 0xdc42 zurückschreiben
1fdf 01 08 00 ld bc, 0x0008 // Länge 8 byte
1fe2 ED B0 ldir // Kopiere (0xde96) > (0xde42) 8 bytes
1fe4 2A 3C DC ld hl, (0xdc3c) // Klartext Zeiger auf 0x5c1c
1fe7 11 42 DC ld de, 0xdc42 // chiffr. IV
1fea DD 21 33 DC ld ix, 0xdc33 // SPAD1:-Zieladresse/chiff/dechiff
1fee 06 08 ld b, 0x08 // 8 Runden
1ff0 1A ld a, (de) <-\ // 8 Werte bearbeiten
1ff1 AE xor (hl) | // a xor (0x5c1c) XOR KTXT : Key
1ff2 DD 77 00 ld (ix + 0x00), a | // in (0xdc33 + n) GTX/KTX abgelegt
1ff5 23 inc hl | // 0x5c1c ++
1ff6 13 inc de | // 0xdc42 ++
1ff7 DD 23 inc ix | // 0xdc33 ++
1ff9 10 F5 djnz 0xf5 >-/ // 0x1ff0, 8 Runden - 8 byte
// Prüfung Chiffrierung Klartext gegen den dechiffr. GTX
1ffb 22 3C DC ld (0xdc3c), hl // HL == 0x5c1c+8 Zeiger auf Klartext, GTX/Klartext?
1ffe 2A 3E DC ld hl, (0xdc3e) // Hole Zeiger auf dechiffr. GTX
2001: 11 33 DC ld de, 0xdc33 // SPAD1:-Zieladresse/chiff/dechiff
2004 06 08 ld b, 0x08 // Runden
2006 1A ld a, (de) <-\
2007 BE cp (hl) | // (DE) <> (HL)
2008 20 20 jrnz 0x20 | // BLOCKIERUNG 5; 0x202a
200a 23 inc hl |
200b 13 inc de |
200c 10 F8 djnz 0xf8 >-/ // 0x2006, 8 Runden
200e 22 3E DC ld (0xdc3e), hl // HL + 8
2011 ED 4B C6 DC ld bc, (0xdcc6) // Endadresse Txtspeicher 0x84xx; GL.EAKTS
2015 2A 3E DC ld hl, (0xdc3e) // Txtspeicher 0x5c24; mit der heißen Nadel gestrickt
2018 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2019 32 3B DC ld (0xdc3b), a // Speichern Rückgabewert 0x00
201c ED 42 sbc hl, bc // Länge Text == -1 ?
201e D8 ret c // Rückgabe 0x00 bei Überlauf
201f 3E FF ld a, 0xff
2021 32 3B DC ld (0xdc3b), a // Speichern Rückgabewert
2024 C9 ret // Rückgabe 0xff bei Fehler
// Einsprung Fehler Kein Text
2025 21 7E 02 ld hl, 0x027e // Rücksprungadresse: Kein Text -> Enter -> Menüprogramm
2028 E3 ex (sp), hl
2029 C9 ret
// Einsprung Fehler Blockierung 5
202a 21 DB 02 ld hl, 0x02db // Rücksprungadresse: BLOCKIERUNG 5, von 0x2008
202d E3 ex (sp), hl
202e C9 ret
// Chiffrieren
202f 3E 07 ld a, 0x07 // "CHIFFRIEREN?"
2031 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2034 F3 DI // PP nicht stören
2035 C3 21 30 jp 0x3021 // Aufruf von PP, Kaltstart
// retour aus der PP, Warm-Kaltstartroutine
2038 31 DE DF ld sp, 0xdfde // Stack-Pointer wiederherstellen
203b FB EI // jetzt Int freigegeben
203c 2A C6 DC ld hl, (0xdcc6) // Zeiger auf Klartextspeicher; GL.EAKTS
203f 01 00 84 ld bc, 0x8400 // Klartextspeicher; GL.KTSPS
2042 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2043 ED 42 sbc hl, bc // Länge == 0, Länge == -1
2045 CA 7E 02 jpz 0x027e // Kein Text -> Enter -> Menüprogramm
2048 DA DB 02 jpc 0x02db // Überlauf, BLOCKIERUNG 5
204b 3E 23 ld a, 0x23 // DI, Zeitgeber, Vorteiler 256, neg. Flanke, RESET
204d D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber, Rausch-Generator
// Einsprung aus CRC Test über 64bit Block
204f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2050 32 2E DC ld (0xdc2e), a // Steuerwort 0x00 PP
2053 DD 21 F6 3D ld ix, 0x3df6 // Zeiger auf 0x3e00, K-Boxen
2057 FD 21 5E 20 ld iy, 0x205e // Rücksprungadresse
205b C3 8D 25 jp 0x258d // ROM/RAM Check PP
// Rücksprung aus PP
205e C2 CB 02 jpnz 0x02cb // BLOCKIERUNG 1
2061 2A 03 83 ld hl, (0x8303) // GL.ANZA1; Geheimtextlänge Anzahl 1
2064 22 FB 93 ld (0x93fb), hl // Rette Zeiger GL.ANZA1; Geheimtextlänge Anzahl 1
2067 11 52 DC ld de, 0xdc52
206a 2A 81 DC ld hl, (0xdc81) // Zeiger Rundenschlüssel 1
206d 01 20 00 ld bc, 0x0020 // Länge 32, 256 bit
2070 ED B0 ldir // Kopiere (0xdc81) > (0xdc52) 32 byte, ADZS:-Adresse Zeitschlüssel
2072 2A 83 DC ld hl, (0xdc83) // Zeiger CRC Rundenschlüssel 1
2075 22 2B DC ld (0xdc2b), hl // für den CRC Test-vergleich
2078 21 52 DC ld hl, 0xdc52 // Schlüssel 1
207b 01 20 00 ld bc, 0x0020 // Länge 32 byte
207e CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
2081 F6 00 or 0x00 // a <> 0
2083 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
2086 21 52 DC ld hl, 0xdc52 // CRC Schlüsselprüfung bestanden; 0xdc52 Kopie Schlüssel 1
2089 11 9E DE ld de, 0xde9e // Kopiere nach 0xde9e -> nur 8 byte
208c 01 08 00 ld bc, 0x0008 // Länge 8 byte, 64 bit
208f ED B0 ldir // Kopiere 0xdc52 > 0xde9e 8 bytes
2091 CD 69 1B call 0x1b69 // Rundenschlüssel für Feistel, Übergabe A = 0x00, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
2094 11 42 DC ld de, 0xdc42 // Kopie IV
2097 21 77 DC ld hl, 0xdc77 // IV
209a 01 08 00 ld bc 0x0008 // Länge 8
209d ED B0 ldir // kopiere 0xdc77 > 0xdc42 8 byte
209f 21 7F DC ld hl, 0xdc7f // CRCiv Länge 2 ; CRC der IV
20a2 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
20a5 21 42 DC ld hl, 0xdc42 // CRC IV Kopie von 0xdc77
20a8 01 08 00 ld bc, 0x0008 // Länge 8
20ab CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
20ae F6 00 or 0x00 // a <> 0
20b0 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
// Festlegung Init-Vektor CRC
20b3 21 00 00 ld hl, 0x0000
20b6 22 FD 93 ld (0x93fd), hl // Start Initialisierung CRC Vektor
// Blockkopieren; Feistel
20b9 21 42 DC ld hl, 0xdc42
20bc 11 96 DE ld de, 0xde96
20bf 01 08 00 ld bc, 0x0008 // Länge 8
20c2 ED B0 ldir // kopiere (0xdc42) > (0xde96) 8 byte
20c4 CD 3D 1C call 0x1c3d // Feistel vorwärts, Übergabe/Rückgabe 0xde96
20c7 21 96 DE ld hl, 0xde96 // Wurmfolgen
20ca 11 42 DC ld de, 0xdc42
20cd 01 08 00 ld bc, 0x0008 // Länge 8
20d0 ED B0 ldir // Kopiere (0xde96) > (0xdc42) 8 byte
20d2 2A FB 93 ld hl, (0x93fb) // Zeiger auf Adresse mit der Länge; Zeiger 0x8303
20d5 01 08 00 ld bc, 0x0008
20d8 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
20d9 ED 42 sbc hl, bc // Länge > -1; Länge Modular 8
20db 30 04 jrnc 0x04 >-/ // 0x20e1; kein Unterlauf - Ergebnis > 0
20dd 09 add hl, bc | // Modular 0x08, Rest
20de 45 ld b, l | // Rest (z.B. -1) + 0x08 = 0x07
20df 18 02 jr 0x02 | // 0x20e3, Übergabe Länge in B, kleiner 0x08!
// Einsprung aus 0x20bd; L > 7 |
20e1 06 08 ld b, 0x08 <-/ // B = 0x08
// Einsprung L = 1 ... 7, B = L Schleifenvariable
20e3 21 42 DC ld hl, 0xdc42
20e6 ED 5B FD 93 ld de, (0x93fd) // CRC Vektor, zu Anfang = 0, später der letzte CRC Wert -Schleife-
// Schleife Rundenanzahl 8,7,6,5,4,3,2,1
20ea 7E ld a, (hl)
20eb CD 3F 1B call 0x1b3f <-\ // CRC2-16 mit Übergabe des Vektors, Übergabe DE CRC Vektor, A Wert, Rückgabe DE CRC
20ee 23 inc hl |
20ef 10 F9 djnz 0xf9 >-/ // 0x20eb; Standard 8 Runden; ansonsten 1 bis 7 Runden - s. 0x20d5
// CRC über den 64 Bit Block
20f1 ED 53 FD 93 ld (0x93fd), de // CRC in 0x93fd addressierten Bereich ablegen
20f5 2A FB 93 ld hl, (0x93fb) // gespeicherte Länge
20f8 01 08 00 ld bc, 0x0008 // 8 byte
20fb AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
20fc ED 42 sbc hl, bc // Länge == 0, Länge <> 0
20fe 22 FB 93 ld (0x93fb), hl // Länge in (0x93fb)
2101 28 02 jrz 0x02 // 0x2105; Länge == 0
2103 30 B4 jrnc 0xb4 // 0x204f, Länge == -1; PP Starten -> Fehler aufgetreten und Versuch diesen zu ermitteln
// Länge OK
2105 2A 59 83 ld hl, (0x8359) // CRC des ?klartextes?
2108 ED 5B FD 93 ld de, (0x93fd) // vorherig berechnete CRC; IV
210c 7A ld a, d
210d AC xor h
210e 57 ld d, a // D = D xor H
210f 32 85 DC ld (0xdc85), a // Speichern D = D xor H
2112 7B ld a, e
2113 AD xor l
2114 5F ld e, a // E = E xor L
2115 32 86 DC ld (0xdc86), a // Speichern E = E xor L; x0dc85 ... 0xde86 = DE = DE XOR HL; weitere Verwendung?
2118 21 40 95 ld hl, 0x9540
211b 46 ld b, (hl)
211c 23 inc hl // 0x9541, ...
211d 4E ld c, (hl) // Hole 16bit Wert
211e EB ex de, hl // Tausche Inhalt DE mit HL; HL-0x9540 : DE-0xdc85 == DE XOR HL; danach HL = HL XOR DE; DE = 0xdec85 CRC IV
211f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2120 ED 42 sbc hl, bc // HL != HL + 1; IV - (0x9540)
2122 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5; HL ist <> 0 Fehler CRC IV
// Textspeicher testen vor Nutzung; weiter CRC IV richtig
2125 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
2128 22 C6 DC ld (0xdcc6), hl // Zeiger auf Klartexspeicher; GL.EAKTS
212b 01 FF 03 ld bc, 0x03ff // Länge 0x3ff, 1024 byte
212e CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
2131 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
2124 01 FF 03 ld bc, 0x03ff // Länge 0x3ff, 1024 byte
2127 CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
212a F6 00 or 0x00 // a <> 0 ?
212c C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
// Textspeicher 0x8400 - 0x87ff OK
212f 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2132 01 FF 03 ld bc, 0x03ff // Länge 0x3ff, 1024 byte
2135 CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
2138 F6 00 or 0x00 // A <> 0?
213a C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
// Textspeicher 0x8800 - 0x8cff OK
213d 21 42 DC ld hl, 0xdc42 // Lösche Zeitschlüsselbereich
2150 01 32 00 ld bc, 0x0032 // 50 byte
2153 CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
2156 21 42 DC ld hl, 0xdc42 // Prüfe ob Zeitschlüsselbereich gelöscht ist
2159 01 32 00 ld bc, 0x0032
215b CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
215f F6 00 or 0x00 // A <> 0?
2161 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
// Ende Prüfung Textspeicher
2164 FB EI // Interrupt für Rauschgenerator freigeben
2165 3E 40 ld a, 0x40 // ZF-Erzeugung 0x40
2167 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
216a CD 0E 08 call 0x080e // Zufallsfolge
216d 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
2170 CB 77 bit 6, a // Bit 6, Zufallsfolge Error
2172 C2 D3 02 jpnz 0x02d3 // BLOCKIERUNG 3, HALT
2175 3E FB ld a, 0xfb // Steuerwort - Bereit Chiffrieren
2177 32 2E DC ld (0xdc2e), a // Steuerwort nach Kontrollchiffr. u. Löschen KTXT
217a 2A 00 81 ld hl, (0x8100) // Zeiger, Länge Variablenspeicher
217d 11 68 01 ld de, 0x0168 // 360 byte
2180 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2181 ED 52 sbc hl, de // Länge <> 360 byte?
2183 C2 DB 02 jpnz 0x02db // <> 360 byte; BLOCKIERUNG 5
2186 CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
2189 C3 BE 01 jp 0x01be // Menüprogramm
// Empfangsroutine GO
218c 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher, Hauptbetriebsart-1; GL.HBA
218f FE 01 cp 0x01 // a == 1, MIRA
2191 CA DB 24 jpz 0x24db // Sprung bei MIRA
2194 DB 05 in a, (0x05) // Lese PIO-1-B-D
2196 CB FF set 7, a // Bit 7 = 1 Empfangsspannungen
2198 D3 05 out (0x05), a // PIO-1-B-D; EINSCHALTEN DER Empfangsstufenspannungen
219a CD 21 02 call 0x0221 // Zeitschleife 70ms
219d 3E 09 ld a, 0x09 // "EMPFANGEN?"
219f CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
21b2 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
21b5 22 A0 DC ld (0xdca0), hl // Zeiger auf 0x9000; GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
21b8 22 A4 DC ld (0xdca4), hl // Zeiger auf 0x9000
21bb 01 FF 03 ld bc, 0x03ff // 1024 byte
21be CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
21c1 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
21c2 32 91 DC ld (0xdc91), a
21c5 3E 0F ld a, 0x0f
21c7 32 9C DC ld (0xdc9c), a
21ca 21 50 00 ld hl, 0x0050 // Mittelwert Zeitkonstante
21cd 22 98 DC ld (0xdc98), hl
21c0 22 9A DC ld (0xdc9a), hl
21c3 21 14 00 ld hl, 0x0014 // Grundzeit für Halb-Bit
21c6 22 96 DC ld (0xdc96), hl // Speichern 0x14 0x00
21c9 FD 21 96 DC ld iy, 0xdc96 // IY Zeiger auf 0xdc96 (0x14)
21cd DB 05 in a, (0x05) // Lese PIO-1-B-D; Kontrolle ob Modem vorhanden
21cf CB 47 bit 0, a // bit 0 == true
21d1 CA 15 22 jpz 0x2215 // Empfangsroutine Akkustikkoppler
21d4 21 9C 00 ld hl, 0x009c // Empfang über Modem; Vorbereitung Empfangs PIO
21d7 7D ld a, l // Steuerwort 0x9c; Eingang bit: 2 3 4 7 Ausgabe bit: 0 1 5 6
21d8 D3 06 out (0x06), a // PIO-1-A-C; Steuerwort; neuer Vektor
21da 3E 01 ld a, 0x01
21dc 32 9D DC ld (0xdc9d), a // Voreinstellung Flanke
21df 3E D7 ld a, 0xd7 // nur Bit 6 IR
21e1 D3 06 out (0x06), a // Steuerwort-PIO-1-A
21e3 3E BF ld a, 0xbf // bei H-> Flanke
21e5 D3 06 out (0x06), a // Steuerwort-PIO-1-A
21e7 C3 32 22 jp 0x2231 // EM1; Laufende Arbeit während des Empfangs
// Datenlesen Interrupt Routine für Modem
21ea F5 push af
21eb C5 push bc
21ec D5 push de
21ed E5 push hl // Register retten
21ee CD F7 21 call 0x21f7 // Aufruf Datenlesen Modem
21f1 E1 pop hl
21f2 D1 pop de
21f3 C1 pop bc
21f4 F1 pop af // Register wiederherstellen
21f5 FB EI
21f6 C9 ret
// Datenlesen Interrupt Routine für Modem, Umprogrammieren PIO
21f7 0E 06 ld c, 0x06 // PIO Kanal
21f9 06 D7 ld b, 0xd7
21fb 16 BF ld d, 0xbf
21fd 3A 9D DC ld a, (0xdc9d) // GL.FLANK; ZADE: Länge 2 ; Aktueller Zeiger GTE
2200 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2201 28 02 jrz 0x02 // 0x2205
2203 06 F7 ld b, 0xf7
2205 ED 41 out (c), b // PIO-1-A-C
2207 ED 51 out (c), d // PIO-1-A-C
2209 EE 01 xor 0x01
220b 32 9D DC ld (0xdc9d), a // GL. FLANK; ZADE: Länge 2 ; Aktueller Zeiger GTE
220e A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
220f C2 85 23 jpnz 0x2385 // Wechsel 0-->1 gewesen
2212 C3 42 23 jp 0x2342 // Wechsel 1-->0 gewesen
// Empfangsroutine Akustikkoppler; EMAK
2215 0E 06 ld c, 0x06
2217 3E F7 ld a, 0xf7 // Steuerwort
2219 06 7F ld b, 0x7f // OIII IIII E/A
221b ED 79 out (c), a // PIO-1-A-C
221d ED 41 out (c), b // Neuinitialisierung
221f DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
2221 CB D7 set 2, a // Schalte bit 2 auf 1
2223 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
2225 CD 21 02 call 0x0221 // Zeitschleife 70ms
2228 0E 0A ld c, 0x0a // CTC Kanal 2
222a 3E 17 ld a, 0x17 // Steuerwort
222c 06 FF ld b, 0xff // Zeitkonstante
222e ED 79 out (c), a // CTC Kanal 2 DI, Timer, Vorteiler 16, pos. Flanke, Zeitkonstante folgt, RESET
2230 ED 41 out (c), b // Zeitkonstante 255 * 16 / 1340 kHz = 3,04 ms
// EM1; Laufende Arbeit während des Empfangs
2232 3A 9C DC ld a, (0dc9c) // GL.ZEMPF
2235 CB 4F bit 1, a // bit 1 == true
2237 28 15 jrz 0x15 // 0x224e; EMPFANGEN BEENDET
2239 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
223c FE 43 cp 0x43 // a == 0x43, ENTER
223e 28 0E jrz 0x03 // 0x224e, ENDE
2240 3A 15 DC ld a, (0xdc15) // (GL.AMER)
2243 FE 0F cp 0x0f // a == 0x0f, Taste SE
2245 28 07 jrz 0x07 // 0x224e
2247 3A 16 DC ld a, (0xdc16) // (GL.BMER)
224a FE 0F cp 0x0f // a <> 0x0f,
224c 20 E4 jrnz 0xe4 // 0x2232
// Empfangsabbruch, CTC und PIO IR Sperren; Umprogrammieren PIO-1-A
224e 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
2250 D3 0A out (0x0a), a // CTC Kanal 2 Zeitgeber
2252 D3 09 out (0x09), a // CTC Kanal 1 Zeitgeber
2254 DB 05 in a, (0x05) // Lese PIO-1-B-D; Lese Sonderschnittstelle
2256 CB 97 res 2, a // Lösche Bit 2, Ausschalten von ...
2258 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
225a 3E FF ld a, 0xff // PIO-1-A Betriebsart 3
225c D3 06 out (0x06), a // PIO-1-A-C
225e 3E C4 ld a, 0xc4 // Eingänge bit: 2 6 7 Ausgänge bit: 0 1 3 4 5
2260 D3 06 out (0x06), a // PIO-1-A-C
2262 3E 67 ld a, 0x67 // Maskensteuerwort
2264 D3 06 out (0x06), a // PIO-1-A-C, INT. VERBOTEN
2266 21 9A 00 ld hl, 0x009a // Stuerwort
2269 7D ld a, l // Maske bit/ Interrupt Vektor?
226a D3 06 out (0x06), a // PIO-1-A-C
226c CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
// Ausschalten der Empfangsspannungen
226f DB 05 in a, (0x05) // Lese PIO-1-B-D; Sonderschnittstelle
2271 CB BF res 7, a // Lösche Bit 7
2273 D3 05 out (0x05), a // PIO-1-B-D; Sonderschnittstelle
2275 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
2278 CB 86 res 0, (hl) // Lösche neuen Tastendruck
227a 3A 9C DC ld a, (0xdc9c) // (GL.ZEMPF)
227d A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
227e CA BE 01 jpz 0x01be // Menüprogramm
2281 FE 0F cp 0x0f // a == 0x0f,
2283 CA BE 01 jpz 0x01be // Menüprogramm NORMALES ENDE
2286 CB 57 bit 2, a // bit 2 == false
2288 20 02 jrnz 0x02 // 0x228c IV FALSCH; Empfangsfehler
228A 18 16 jr 0x16 // 0x22a2 TEXT FALSCH
// Empfangsfehlerbearbeitung
// IV Falsch
228c 3E 10 ld a, 0x10 // "WIEDERHOLUNG"; Erscheint bei falscheingaben des GTX innerhalb der IV bzw. der CRC-16_true
228e CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2291 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2292 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck
2295 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
2298 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
229b FE 43 cp 0x43 // a <> 0x43, Taste: "C"/ENTER
229d 20 F6 jrnz 0xf6 // 0x2295
229f C3 BE 01 jp 0x01be // Menüprogramm
// Text fehlerhaft
22a2 3E 11 ld a, 0x11 // "TEXTFEHLER"
22a4 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
22a7 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
22aa 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
22ad FE 43 cp 0x43 // a <> 0x43, ENTER
22af 20 F6 jrnz 0xf6 // 0x22a7
22b1 C3 BE 01 jp 0x01be // Menüprogramm
// CTC Interrupt Routine
22b4 F5 push af // rette AF
22b5 FD CB 03 46 bit 0, (iy+0x03) // bit 0 == false
22b9 FD CB 03 C6 set 0, (iy+0x03) // UBERTRAG DER BITLÄNGE
22bd 20 04 jrnz 0x04 // 0x22c3;
22bf F1 pop af // wiederherstellen AF
// Einsprung Routine beenden
22c0 FB EI
22c1 ED 4D RETI
// Einsprung aus CRC Interrupt Routine
22c3 3E A7 ld a, 0xa7 // DI, Zeitgeber, Vorteiler 256, neg. Flanke, Zeitkonstante folgt RESET; EINSCHALTEN DER TASTATZR
22c5 D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber, BEI BYTE-ZEITÜBERSCHREITUNG
22c7 3E 31 ld a, 0x31 // Zeitkonstent ZK = 49 * 256 / f in ms
22c9 D3 0B out (0x0b), a // CTC Kanal 3 Takt
22cb 18 F2 jr 0xf2 // 0x22c0; EI RETI
// DATENEINLESE Interrupt ROUTINE FÜR Akustikkoppler
22cd F5 push af
22ce C5 push bc
22cf D5 push de
22d0 E5 push hl // Register retten
22d1 CD DA 22 call 0x22da // DATENLESEROUTINE
22d4 E1 pop hl
22d5 D1 pop de
22d6 C1 pop bc
22d7 F1 pop af // wiederherstellen Register
22d8 FB EI
22d9 C9 ret
// DATENLESEROUTINE Bereich 0 EINLESEN DER CTC-STÄNDE
22da 0E 0A ld c, 0x0a // ZP:CTC Kanal 2
22dc ED 78 in a, (c) // Lese CTC Kanal 2
22de 2F cpl // A != A
22df 47 ld b, a
22e0 FE 3C cp 0x3c // STÖRUNG ?
22e2 DA 21 23 jpc 0x2321 // JA
22e5 3E 17 ld a, 0x17 // VT 16 OHNE IR; DI, Timer, Vorteiler 16, pos. Flanke, Zeitkonstante folgt, RESET
22e7 ED 79 out (c), a // CTC Kanal 2 Timer
22e9 3E FF ld a, 0xff // Zeitkonstante 255 * 16 / 1340 kHz = 3,04 ms
22eb ED 79 out (c), a // CTC Kanal 2 Takt
22ed 78 ld a, b
22ee FE 60 cp 0x60 // LÜCKE IM DATENFLUSS ?
22f0 D2 21 23 jpnc 0x2321 // JA
// Software PLL; BESTIMMUNG DER ZEITABWEICHUNG
22f3 FE 4C cp 0x4c // MITTELWERT ZW: FO UND FU
22f5 30 1B jrnc 0x1b // 0x2312 a => 0x1b springe
// ZEITKONSTANTE KLEINER MACHEN
22f7 3A 9A DC ld a, (0xdc9a)
22fa FE 4C cp 0x4c // a == 0x4c, UNTERE GRENZE
22fc 28 23 jrz 0x23 // 0x2321
22fe FE 4D cp 0x4d // UNTERE SCHALTSCHWELLE
2300 F5 push af // rette AF
2301 D6 01 sub 0x01
2303 32 9A DC ld (0xdc9a), a // NEUE KLEINERE ZEITKONSTANTE
2306 47 ld b, a
2307 F1 pop af // wiederherstellen AF
2308 38 17 jrc 0x17 // 0x2321 BEREITS UNTERE SCHALTSCHWELLE
230a 78 ld a, b // ZEIK3 NEU
230b FE 4D cp 0x4d
230d 30 12 jrnc 0x12 // 0x2321 a => 0x12
//UMSCHALTSCHWELLE PASSIERT LOG 1 SETZEN
230f C3 85 23 jp 0x2385
//ZEITKONSTANTE GRÖßER MACHEN 1->=
2312 3A 9A DC ld a, (0xdc9a) // ZEIK3
2315 FE 53 cp 0x53 // a == 0x53, OBERE GRENZE
2317 28 08 jrz 0x08 // 0x2321
2319 3C inc a
231a FE 51 cp 0x51 // a == 0x51, OBERE SCHALTSCHWELLE
231c 32 9A DC ld (0xdc9a), a // Zeitkonstante
//UMSCHALTSCHWELLE PASSIERT; LOG 0 SETZEN
231f 28 21 jrz 0x21 // 0x2342
//AUSSPRUNG NACH KURZEN DURCHLAUF
2321 E1 pop hl
2322 21 D4 22 ld hl, 0x22d4
2325 E5 push hl
2326 ED 4D RETI
// EINLESE UP FÜR CTC-STAND DER FLANKENABSTÄNDE
2328 DB 09 in a, (0x09) // CTC Kanal 1 Lese Zähler/Timer
232a 2F cpl
232b 32 98 DC ld (0xdc98), a // GESAMTLÄNGE ZWISCHEN ZWISCHEN FLANKEN - ABSTÄNDE
232e 3E B7 ld a, 0xb7 // RESET, Zeitkonstante folgt, EI Zeitgeber Vorteiler 256 pos. Flanke
2330 D3 09 out (0x09), a // CTC Kanal 1 Zeitgeber
2332 3E FF ld a, 0xff // 255 * 256 /f in ms
2334 D3 09 out (0x09), a // CTC Kanal 1 Takt
// SPERRUNG DER TASTATUR CTC
2336 3E 21 ld a, 0x21 // DI, Zeitgeber, Vorteiler 256, neg. Flanke
2338 D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber
IR-KETTE FREISCHALTEN
233a 21 41 23 ld hl, 0x2341
233d E5 push hl
233e FB EI
233f ED 4D RETI
2341 C9 RET // oder CTC Wert
//BERECHNUNG DATENBYTE BEI GEWESENEN EINSEN
// Übergabe B
2342 CD 28 23 call 0x2328 // EINLESE UP FÜR CTC-STAND DER FLANKENABSTÄNDE
2345 CD A2 24 call 0x24a2 // BITANZAHL IN B, N > 0x0002 N < 0x1f0; Übergabe HL, Rückgabe B Anzahl, 0xdc99 Status
2348 3A 9E DC ld a, (0xdc9e)
234b 80 add a, b // B = Anzahl + (0xdc9e)
234c FE 09 cp 0x09 // größer 8
234e 38 0D jrc 0x0d // 0x235b; a > 9 springe
2350 3A 9E DC ld a, (0xdc9e) // <= 8
2353 47 ld b, a // ANZAHL; 0xdc9e
2354 3E 08 ld a, 0x08
2356 90 sub b // Rest
2357 30 01 jrnc 0x01 // 0x235a
2359 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
// größer 8
235a 47 ld b, a // B = 0
235b 3E 08 ld a, 0x08
// größer 9
235d 32 9E DC ld (0xdc9e), a // Anzahl = 8
2360 3A 9F DC ld a, (0xdc9f) // VORE: Länge 1; Vorbereitung X1.DCA
// Schleife
2363 37 scf // EINSEN REINSCHREIBEN; carry = 1
2364 04 inc b // B = 1 wenn <= 8, B > 8 Schleifenzähler
2365 05 dec b // B war 0
2366 28 07 jrz 0x07 // 0x236f, Abbruch
2368 1F rra // rotieren A; carry -> A7 -> A0 -> carry
2369 05 dec b // Schleifenzähler B
236a 32 9F DC ld (0xdc9f), a // VORE: Länge 1 ; Vorbereitung X1.DCA
236d 18 F4 jr 0xf4 // 0x2363, Schleife
// Abbruch
236f 3A 9E DC ld a, (0xdc9e) // Übergabe oder 8
2372 FE 08 cp 0x08 // a <> 8
2374 C0 retnz // Springe a <> 8
// AUSWAHL des EMPFANGSZUSTANDES // a = 8
2375 3A 91 DC ld a, (0xdc91) // Berechne Sprungadresse, mit 0xdc91
2378 87 add a, a // 2 * a
2379 4F ld c, a //
237a 06 00 ld b, 0x00 // 0x00, 2*a
237c 21 83 25 ld hl, 0x2583 // Tabelle Sprungadressen
237f 09 add hl, bc // HL = 0x2583 + 2*(0xdc91)
2380 5E ld e, (hl)
2381 23 inc hl
2382 56 ld d, (hl)
2383 EB ex de, hl
2384 E9 jp (hl) // Einsprung in die berechnete Adresse, Programm 1 ... 5
// 0x2583 Programm: 0x23c7; DBAA Suche Anfangskennung
// 0x2585 Programm: 0x23e6; DBSY Lese IV
// 0x2587 Programm: 0x2401; CRCSY CRC IV
// 0x2589 Programm: 0x2436; DALAE Datenlänge
// 0x258b Programm: 0x2461; DBGT Datenlänge GTX
// HINWEIS: SY = Synchronfolge ist nicht existent sondern nur Initialisierungs-Vektor IV
// BERECHNUNG DATENBYTE BEI GEWESENEN NULLEN
2385 CD 28 23 call 0x2328 // EINLESE UP FÜR CTC-STAND DER FLANKENABSTÄNDE
2388 CD A2 24 call 0x24a2 // BITANZAHL IN B, N > 0x0002 N < 0x1f0
238b 3A 9E DC ld a, (0xdc9e)
238e FE 08 cp 0x08 // a <> 8
2390 20 13 jrnz 0x13 // 0x23a3
2392 3A 91 DC ld a, (0xdc91) // AMEISE
2395 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2396 28 08 jrz 0x08 // 0x23a3
2398 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
239b 2B dec hl
239c 7E ld a, (hl)
239d CD 54 02 call 0x0254 // Indikator Senden und Empfang (Ameisen)
23a0 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0; NEUES BYTE
23a1 32 9E DC ld (0xdc9e), a // Anzahl Bits
23a4 05 dec b // STARTBIT FORTLASSEN
23a5 80 add a, b
23a6 FE 09 cp 0x09
23a8 38 0A jrc 0x0a // 0x23ba a <= 0x09 dann springe
23aa 47 ld b, a
23ab 3E 08 ld a, 0x90
23ad 90 sub b
23ae 30 01 jrnc 0x01 // 0x23b1
23b0 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
23b1 47 ld b, a
23b2 3E 08 ld a, 0x08
23b4 32 9E DC ld (0xdc9e), a // Anzahl der Bits
23b7 3A 9F DC ld a, (0xdc9f) // VORE: Länge 1; Vorbereitung X1.DCA
23ba A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0; NULLEN REINSCHREIBEN
23bb 04 inc b
23bc 05 dec b
23bd CA A1 24 jpz 0x24a1 // b == 0?, Abbruch
23c0 1F rra // rotiere A; carry -> A7 -> A0 -> carry
23c1 05 dec b
23c2 32 9F DC ld (0xdc9f), a // VORE: Länge 1 ; Vorbereitung X1.DCA
23c5 18 F3 jr 0xf3 // 0x23bb, Schleife
// Anfangskennung 16 * 0xff und 2 * 0xaa
// Suchen der Anfangskennung Berechnet in 0x2375, Übergabe HL, Rückgabe (0xdc94) HL
// DBBA
23c7 3A 9F DC ld a, (0xdc9f) // LETZTES BYTE VORE: Länge 1 ; Vorbereitung X1.DCA
23ca 21 94 DC ld hl, 0xdc94 // ANZAHL DER AA
23cd 34 inc (hl)
23ce FE AA cp 0xaa // a == 0xaa
23d0 28 03 jrz 0x03 // 0x23d5; AA IST
23d2 36 00 ld (hl), 0x00
23d4 C9 ret // KEIN AA
// Einsprung
23d5 3E 02 ld a, 0x02
23d7 BE cp (hl) // (hl) <> 2
23d8 C0 RETNZ // ERST EIN AA
23d9 36 00 ld (hl), 0x00
23db 3E 01 ld a, 0x01
23dd 32 91 DC ld (0xdc91), a
23e0 21 9C DC ld hl, 0xdc9c
23e3 CB 86 res 0, (hl)
23e5 C9 ret
// Programm: EINLESEN IV, Berechnet in 0x2375, Übergabe HL
// DBSY
23e6 3A 9F DC ld a, (0xdc9f) // GL.DBYTE; VORE: Länge 1; Vorbereitung X1.DCA
23e9 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
23eb 77 ld (hl), a
23ec 23 inc hl
23ed 22 A0 DC ld (0xdca0), hl // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
23f1 21 94 DC ld hl, 0xdc94
23f4 34 inc (hl)
23f5 3E 08 ld a, 0x08
23f7 BE cp (hl) // (hl) <> 8
23f8 C0 RETNZ // Rückspung wenn <> 8
23f9 36 00 ld (hl), 0x00
23fb 3E 02 ld a, 0x02
23fd 32 91 DC ld (0xdc91), a
2400 C9 ret
// Programm: EINLESEN UND PRÜFEN CRC DER IV, Berechnet in 0x2375, Übergabe HL
// CRCSY
2401 3A 9F DC ld a, (0xdc9f) // VORE: Länge 1; Vorbereitung X1.DCA
2404 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
2407 77 ld (hl), a
2408 23 inc hl
2409 22 A0 DC ld (0xdca0), hl // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
240c 21 94 DC ld hl, 0xdc94
240f 34 inc (hl)
2410 3E 02 ld a, 0x02
2412 BE cp (hl) // (hl) <> 2
2413 C0 RETNZ
2414 36 00 ld (hl), 0x00
2416 3E 03 ld a, 0x03
2418 32 91 DC ld (0xdc91), a
// KONTROLLE CRC DER SYF
241b 21 08 90 ld hl, 0x9008 // Adresse der CRC des IV
241e 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
2421 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
2424 01 08 00 ld bc, 0x0008 // Länge 8 byte
2427 CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
242a A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
242b 21 9C DC ld hl, 0xdc9c
242e 20 03 jrnz 0x03 // 0x2433; CRC-WERT FALSCH
2430 CB 96 res 2, (hl) // 0xdc9c = xxxx x0xx
2432 C9 ret
2433 CB 8E res 1, (hl) // 0xdc9c = xxxx xx0x
2435 C9 ret
// Programm: EINLESEN DATENLÄNGE, Berechnet in 0x2375
// DALAE
2436 3E 02 ld a, 0x02
2438 11 93 DC ld de, 0xdc93 // N4: Länge 4; Reg. Mod-Verknüpfung
243b 21 94 DC ld hl, 0xdc94
243e 34 inc (hl)
243f BE cp (hl) // (hl) == 2?
2440 3A 9F DC ld a, (0xdc9f) // VORE: Länge 1; Vorbereitung X1.DCA
2443 28 0B jrz 0x0b // 0x2450; (HL+1) == 2
2445 EB ex de, hl // Tausch DE<>HL
2446 77 ld (hl), a // (0xdc93) = (0xdc9f)
2447 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
244a 77 ld (hl), a // Zeiger(0xdca0) = (0xdc9f)
244b 23 inc hl
244c 22 A0 DC ld (0xdca0), hl // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
244f C9 ret
// (HL+1) == 2
2450 EB ex de, hl // Tausch DE<>HL
2451 2B dec hl // HL = 0xdc92
2542 77 ld (hl), a // (0xdc92) = 2
2453 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
2456 77 ld (hl), a // Zeiger (0xdca0) = 2
2457 23 inc hl
2458 22 A0 DC ld (0xdca0), hl // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
245b 3E 04 ld a, 0x04
245d 32 91 DC ld (0xdc91), a // Zeiger (0xdc91) = 4
2460 C9 ret
// Programm: EINLESEN GT, Berechnet in 0x2375, Übergabe HL
// DBGT
2461 3A 9F DC ld a, (0xdc9f) // GL.DBYTE; VORE: Länge 1; Vorbereitung X1.DCA
2464 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
2467 77 ld (hl), a
2468 23 inc hl
2469 22 A0 DC ld (0xdca0), hl // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
246c 22 A4 DC ld (0xdca4), hl // Zeiger
246f 2A 92 DC ld hl, (0xdc92) // Hole neue Adresse
2472 11 01 00 ld de, 0x0001
2475 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2476 ED 52 sbc hl, de // Länge > 0
2478 22 92 DC ld (0xdc92), hl // Lege Länge ab
247b C0 RETNZ // > 0, Rücksprung
// CRC-ÜBERPRÜFUNG GTX; Weiter
247c F3 DI // Sperre Interrupt
247d 2A A0 DC ld hl, (0xdca0) // GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
2480 2B dec hl
2481 2B dec hl // neuer Adresszeiger
2482 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
2485 11 0C 90 ld de, 0x900c // Startadresse GTX
2488 2A A4 DC ld hl, (0xdca4) // End-Adresse GTX
248b A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
248c ED 52 sbc hl, de // Länge GTX
248e E5 push hl // Registerwechsel
248f C1 pop bc // BC = HL
2490 0B dec bc
2491 0B dec bc // alte Adresse von HL
2492 EB ex de, hl // DE <--> HL, Tausch Registerinhalte
2493 CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
2496 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2497 21 9C DC ld hl, 0xdc9c // Zeiger auf ...
249a 20 02 jrnz 0x02 // Ergebnis der CRC Prüfung <> 0, 0x249e,
249c CB 9E res 3, (hl) // EMPFÄNGERFOLGE RICHTIG
// Einsprung CRC-Prüfung <> 0
249e CB 8E res 1, (hl) // Empfangsfolge Falsch
24a0 FB EI
24a1 C9 ret
//UP "ANZAL" ZUR BESTIMMUNG DER ANZAHL; GLEICHER BITS HINTEREINANDER
// Übergabe HL, Rückgabe B Anzahl, 0xdc99 Status
24a2 21 98 DC ld hl, 0xdc98 // Übergabe HL
24a5 CD C0 24 call 0x24c0 // Plausibilitätskontrolle > 0x0002 < 0x01f0; Klartextlänge BA2 < 500; Übergabe HL
24a8 2A 98 DC ld hl, (0xdc98) // Rückgabe HL, HL + 1 = Rückgabe 0x00 >1 und < 496; oder 0x01 < 2 Zeichen
24ab 3A 96 DC ld a, (0xdc96) // s. 0x21c6; 0x14,0x00
24ae 5F ld e, a
24af 16 00 ld d, 0x00 // DE = 0x00, (0xdc96)
24b1 06 00 ld b, 0x00 // Zählervariable
// Schleife, Zähler
24b3 04 inc b // Zähler B
24b4 A7 and a // carry-Flag = 0
24b5 ED 52 sbc hl, de // Länge (0xdc98) - 0x00(0xdc96)
24b7 30 FA jrnc 0xfa // 0x24b3, kein Überlauf Zähler B erhöhen
24b9 CB 38 srl b // schiebe B, 0 -> B7 -> B0 -> carry; B = B/2
24bb AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
24bc 32 99 DC ld (0xdc99), a // 0xdc99 = 0
24bd C9 ret // Rückgabe B
// PLAUSIBILITÄTSKONTROLLE DER ZÄHLER; ZÄHLER DARF NICHT KLEINER ALS 0x0002 UND
// NICHT GRÖßER ALS 0x01f0 SEIN
// BA2 darf der Klartext nicht größer als 500 sein (0x1f4) - CRC16
// Übergabe HL, Rückgabe (HL) 0xdc99 = 0 oder 1
24c0 5E ld e, (hl) // e = (0xdc98)
24c1 23 inc hl // HL = 0xdc99
24c2 56 ld d, (hl) // d = (0xdc99) -> Parameter aus 0x0050
24c3 E5 push hl // rette HL, 0xdc99
24c4 21 01 00 ld hl, 0x0001
24c7 A7 and a // carry-Flag = 0
24c8 ED 52 sbc hl, de // HL = HL - (0xdc99, 0xdc98)
24ca 38 04 jrc 0x04 // 0x24d0, Textlänge größer 1
24cc E1 pop hl // wiederherstellen HL = 0xdc99
24cd 36 01 ld (hl), 0x01 // (0xdc99) = 0x01, Länge <= 1
24cf C9 ret
// Bei Überlauf aus 0x24c0,
24d0 21 F0 01 ld hl, 0x01f0 // Textlänge BA2; 496 byte
24d3 A7 and a // carry-Flag = 0
24d4 ED 52 sbc hl, de // Länge > 496
24d6 E1 pop hl // wiederherstellen HL = 0xdc99
24d7 D0 retnc // Länge > 496
24d8 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
24d9 77 ld (hl), a // 0xdc99 = 0; Länge im Bereich von 2 bis 496
24da C9 ret
// Geheimtexteingabe BEI MIRA
24db 3E 12 ld a, 0x12 // "GTX ERSTELLEN"
24dd CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
24e0 3E 02 ld a, 0x02 // Betriebsart GT erstellen
24e2 32 01 DC ld (0xdc01), a // BA MERKEN, Betriebsartenregister
// REGISTER VORBEREITEN
24e5 21 00 8C ld hl, 0x8c00 // GeheimtextspeicherText (A-P)
24e8 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
24eb 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
24ee 11 FF 03 ld de, 0x03ff
24f1 19 add hl, de
24f2 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
24f5 2A A2 DC ld hl, (0xdca2) // Adresse vom GeheimtextspeicherText (A-P)
24f8 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
24fb 3E 06 ld a, 0x06
24fc 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor
2500 3E 02 ld a, 0x02 // GT-Eingabe
2502 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
2505 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2506 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck, kein neues Zeichen
2509 32 27 DC ld (0xdc27), a // ZUAN3:-Einfügemode
250c 3E 08 ld a, 0x08 // Zustandzeiger = 8
250e 32 AB DC ld (0xdcab), a // Zustandszeiger MIRA/GO
// SPEICHER FÜR ANZEIGE SAUBER MACHEN
2511 21 EC 8B ld hl, 0x8bec
2514 36 00 ld (hl), 0x00
2516 11 ED 8B ld de, 0x8bed
2519 01 13 00 ld bc, 0x0013 // Länge
251c ED B0 ldir // lösche 0x8bec - 0x8bff mit 0x00, 0x13 bytes
251e CD 1C 02 call 0x021c // Zeit 1sec
2521 CD 4A 09 call 0x094a // Textprozessor
2524 2A 1D DC ld hl, (0xdc1d) // Kopiere Text Adresse // EADR:-End-Zeiger-TextProzessor
2527 22 A2 DC ld (0xdca2), hl // nach GeheimtextspeicherText (A-P)
// ÜBERGABEPARAMETER GL.EADE -ENDADRESSE
// BESCHREIBUNG: EINGEGEBENE BUCHSTABEN WERDEN IN DIE ENTSPRECHENDE
// BITFOLGE UMGEWANDELT A->0000 BIS F->1111
// REGISTER: GL.ADREM - LÄNGE TEXT (VON GT)
252a 2A A2 DC ld hl, (0xdca2) // hole Adresse GeheimtextspeicherText (A-P)
252d 11 00 8C ld de, 0x8c00 // GeheimtextspeicherText (A-P)
2530 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2531 ED 52 sbc hl, de // Länge
2533 28 3D jrz 0x3d // 0x2572, Länge == 0x0000
2535 CB 45 bit 0, l // bit 0 == true; Ungerade länge?
2537 28 01 jrz 0x01 // 0x253a
2539 2B dec hl // auf gerade Länge setzen; NUR GERADZAHLIGE HALBBYTE
253a 22 A0 DC ld (0xdca0), hl // die Länge des umzuwandelnden Textes; GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
253d 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
2540 11 00 8C ld de, 0x8c00 // GeheimtextspeicherText (A-P)
2543 1A ld a, (de) // Halbbyte abarbeitung
2544 CD 75 25 call 0x2575 // Konverter Text > Zahl, Übergabe A = Text (A - P), Rückgabe A = Zahl (0x00 - 0x0f)
2547 ED 6F rld // a = (DE); (HL3-0) = a3-0; a= (HL7-4); (HL7-4) = (HL3-0)
2549 13 inc de
254a 1A ld a, (de) // Halbbyteabarbeitung
254b CD 75 25 call 0x2575 // Konverter Text > Zahl, Übergabe A = Text (A - P), Rückgabe A = Zahl (0x00 - 0x0f)
254e ED 6F rld // a = ?; (HL3-0) = a3-0; a= (HL7-4); (HL7-4) = (HL3-0)
2550 23 inc hl // in HL liegen die Ziffernwerte
2551 22 A4 DC ld (0xdca4), hl // NEUE ENDADRESSE
2554 13 inc de
2555 ED 4B A0 DC ld bc, (0xdca0) // Hole Länge; GL.ADREM; HWKB: Länge 1; Speicheradresse empfangenes Byte
2559 0B dec bc
255a 0B dec bc
255b ED 43 A0 DC ld (0xdca0), bc // Länge - 2
255f 79 ld a, c
2560 B0 or b
2561 20 E0 jrnz 0xe0 // 0x2543, Länge > 0
2563 21 9C DC ld hl, 0xdc9c // Länge == 0
2566 36 04 lh (hl), 0x04
2568 CD 1B 24 call 0x241b // KONTROLLE CRC DES IV
256b 3A 9C DC ld a, (0xdc9c)
256e A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
256f C2 8C 22 jpnz 0x228c // IV Falsch; A <> 0; Emfpangsfehler
2572 C3 BE 01 jp 0x01be // Menüprogramm; CRC richtig;
// Konverter Text - Zahl, Übergabe A = Text (A - P), Rückgabe A = Zahl (0x00 - 0x0f)
2575 E5 push hl
2576 21 B1 0D ld hl, 0x0db1 // Buchstabenliste A ... P (0x00 ... 0x0f Darstellung)
2579 01 10 00 ld bc 0x0010
257c ED B1 cpir // BC == 0? oder a == (HL)
257e 3E 0F ld a, 0x0f
2580 91 sub c // a = a - c; = 0x0f - c; 0 ... f
2581 E1 pop hl
2582 C9 ret
// Sprungtabelle Berechnet in 0x2375
2583 C7 23 // Programm: 0x23c7; DBAA
2585 E6 23 // Programm: 0x23e6; DBSY
2587 01 24 // Programm: 0x2401; CRCSY
2589 36 24 // Programm: 0x2436; DALAE
258b 61 24 // Programm: 0x2461; DBGT
// ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
/********************************************************/
/* AUFRUF: RO.START
/* PARAMETER:
/* IX ADRESSE ROM-BEREICHE
/* PRO ROM BREICH: ANFANGSADRESSE (2 BYTE)
/* LÄNGE (2 BYTE)
/* CRC-WERT (2 BYTE)
/* BEENDE ROM-TEST BEI BEREICH MIT LÄNGE = 0
/* IY: RÜCKSPRUNGADRESSE AUS RO.START
/* BEI RÜCKSPRUNG:
/* KEIN FEHLER ERKANNT: Z-FLAG=1, IX AUF BEREICH MIT LÄ
/* FEHLERERKANNT: Z-FLAG=0, IX AUF FEHLERBEICH (IX, I
/* REGISTERÄNDERUNG: AF,BC,DE,HL,IX
/* KONTROLLE EIN ROM-BREICH HL = ROMBEREICHSANFANG
/* BC = ROM-BEREICHSLÄNGE
/* DE = CRC-ANFANGSWERT!!!!
/* BEREICHSLÄNGE == 0 END */
258d DD 4E 02 ld c, (ix + 0x02)
2590 DD 46 03 ld b, (ix + 0x03) // in IX+n gespeicherte Länge nach BC
2593 78 ld a, b
2594 B1 or c
2595 28 20 jrz 0x20 // 0x25b7, Return (IY) wenn bc = 0x0000
2597 DD 6E 00 ld l, (ix + 0x00) // in IX gespeicherte Startadresse nach HL
259a DD 66 01 ld h, (ix + 0x01)
259d CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
// ABSPEICHERN CRC-WERT FÜR VERGLEICH GESPEICHERTEN CRC-WERT MIT BERECHNETEM DE
25a0 DD 73 04 ld (ix + 0x04), e
25a3 DD 72 05 ld (ix + 0x05), d // CRC-16 in IX+n ablegen
25a6 DD 6E 04 ld l, (ix + 0x04)
25a9 DD 66 05 ld h, (ix + 0x05) // in IX+n abgelegte Länge
25ac ED 52 sbc hl, de // Länge > 0
25ae 20 07 jrnz 0x07 // 0x25b7, Return (IY) CRC korrekt?
// IX+6 NEUE ROM-BEREICHSADRESSE
25b0 01 06 00 ld bc, 0x0006 // IX Bereich um 6 erhöhen nächster Datenbereich prüfen.
25b3 DD 09 add ix, bc
25b5 18 D6 jr 0xd6 // 0x258d, ROM-RAM Check, Schleife 0x258d
25b7 FD E9 jp (iy) // Rücksprung (IY)
// Berechne CRC-16 HL Startadresse, BC Länge, Rückgabe DE
// UNTERPROGRAMM CRC-WERTBERECHNUNG MIT AUSWERTUNG BC-
25b9 11 00 00 ld de, 0x0000 // Vektor 0x0000 !
// BERECHNUNG DE = CRC(DE, HL)
25bc 7E ld a, (hl)
25bd AA xor d
25be 57 ld d, a
25bf 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c0 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c1 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c2 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c3 E6 0F and 0x0f
25c5 AA xor d
25c6 57 ld d, a
25c7 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c8 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25c9 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25ca E6 1F and 0x1f // Maske 0001 1111
25cc AB xor e
25cd 5F ld e, a
25ce 7A ld a, d
25cf 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25d0 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25d1 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25d2 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25d3 E6 F0 and 0xf0
25d5 AB xor e
25d6 5F ld e, a
25d7 7A ld a, d
25d8 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25d9 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25da 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
25db E6 E0 and 0xe0
25dd AA xor d
25de 53 ld d, e
25df 5F ld e, a
25e0 23 inc hl // INC HL (NÄCHSTE ROM-ADRESSE); DEC BC, BC#0: ->0x25BC
25e1 0B dec bc
25e2 78 ld a, b
25e3 B1 or c
25e4 20 D6 jrnz 0xd6 // 0x25bc, bis BC = 0x0000
25e6 C9 ret
/********************************************/
/* RAM-TEST
/* FUNKTION: ABWECHSELND VORWÄRTS UND RÜCKWÄRTS EIN
/* TESTWERTE VON BEREICH TESTW IN DEN ZU TEST
/* UND KONTROLLE des VORHER IN RAM EINGESCHRIEB
/* RA.START
/* PARAMETER:
/* IX ADRESSE RAM BEREICHE
/* PRO RAM-BEREICH: ANFANGSADESSE (2 BYTE)
/* LÄNGE (2 BYTE)
/* BEENDEN RAM-TEST BEI BEREICH MIT LÄNGE=0
/* IY RÜCKSPRUNGADRESSE AUS ROM
/* RÜCKSPRUNG JP(IY)
/* KEIN FEHLER ERKANNT: Z-FLAG=1; IX AUF BEREICH MIT LÄ
/* FEHLER ERKANNT: Z-FLAG00; IX AUF FEHLERBEREICH (IX,
/* MIT FEHLER AUF HL, TESTWERT (DE) NICH
/* REGISTERÄNDERUNG: IX, HL, BC, DE, AF */
//Prüffolge FÜR RAM-TEST
25e7 FF 00 FF 55 FF AA 00 FF AA
25f0 55 AA 00 AA FF 00 AA 00 55 00 FF AA 55 55 FF 00
// EIN BEREICH TSTEN HL=RAM-BEREICHSANFANG
// BC=RAM-BEREICHSLÄNGE
// BEREICHSLÄNGE=0 END
// RAMTEST ff00ff55ffaa
2600 DD 4E 02 ld c, (ix + 0x02) // aus 0x069d IX=0x00b4, c = 0x00
2603 DD 46 03 ld b, (ix + 0x03) // b = 0x14
2606 78 ld a, b // a = 0x14
2607 B1 or c // prüfe BC auf 0x00
2608 28 4B jrnz 0x4b // 0x2655
// ANFANGSSTELLUNG BEREICH MIT (TESTW)
260a DD 6E 00 ld l (ix + 0x00) // l = 0x00
260d DD 66 01 ld h (ix + 0x01) // h = 0x80
2610 5D ld e, l
2611 54 ld d, h // de = 0x8000, Dopplungs-Speicher
2612 13 inc de
2613 3A E7 25 ld a, (0x25e7)
2616 77 ld (hl), a // 0x8000 = 0xff, Dopplungs-Speicher
2617 0B dec bc // Länge - 1
2618 ED B0 ldir // Kopiere (0x8000) > 0x80ff, Dopplungs-Speicher
261b 11 E7 25 ld de, 0x25e7
// VERGLEICH RÜCKWÄRTS MIT (TESTW+2*I); EINSCHREIBEN (TESTW+2*I)
261e DD 4E 02 ld c, (ix + 0x02)
2620 DD 46 03 ld b, (ix + 0x03) // BC = 0x1400
2623 1A ld a, (de) // a = 0xff
2624 AE xor (hl) // a xor (0x93ff) Speichertest 0xff
2625 20 2E jrnz 0x2e // 0x2655, FEHLER IM RAM
2627 13 inc de // 0x25e8 (0x00)
2628 1A ld a, (de)
2629 77 ld (hl), a // NEUER TESTWERT
262a 1B dec de
262b 2B dec hl
262c 0B dec bc
262d 79 ld a, c
262e B0 or b
262f 20 F2 jrnz 0xf2 // 0x2624 Speichertest
// VERGLEICH VORWÄRTS MIT (TESTW+2*I)
// EINSCHREIBEN (TESTW+2*I+2)
2631 13 inc de // 0x25e9 (0xFF)
2632 23 inc hl
2633 DD 4E 02 ld c, (ix + 0x02)
2636 DD 46 03 ld b, (ix + 0x03)
2639 1A ld a, (de)
263a AE xor (hl) //
263b 20 18 jrnz 0x18 // 0x2655, Speichertest beendet FEHLER IM RAM
263d 13 inc de // 0x25ea (0x55)
263e 1A ld a, (de)
263f 77 ld (hl), a
2640 1B dec de
2641 23 inc hl
2642 0B or b
2643 79 ld a, c
2644 B0 or b
2645 20 F2 jrnz 0xf2 // 0x2639, Speichertest
// TEST EIN BEREICH ABGESCHLOSSEN? (L(TWEND)=E?)
2647 2B dec hl
2648 13 inc de
2649 3A FE A3 ld a, (0xa3fe)
264c AB xor e
264d 20 CE jrnz 0xce // 0x261b
// IX AUF NÄCHSTEN BEREICH
264f 0E 04 ld c, 0x04
2651 DD 09 add ix, bc // nächse Bytefolge
2653 18 AB jr 0xab // 0x2600, RAMTEST ff00ff55ffaa
2655 FD E9 jp (iy)
// Programm Schlüsseleingabe
2657 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2658 32 2D DC ld (0xdc2d), a // Nr. des Schlüssel
265b 3E 01 ld a, 0x01 // Betriebsart Schlüsselwechsel
26bd 32 01 DC ld (0xdc01), a // Betriebsartenregister: 1-Schlüsselwechsel
// Einsprung Ende Schlüsseleingabe
2660 3E 05 ld a, 0x05 // "SCHLUESSELEINGABE"
2662 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2665 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
2668 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
266b FE 43 cp 0x43 // a <> 0x43, ENTER
266d 20 0A jrnz 0x0a // 0x2679
266f 3A 2D DC ld a, (0xdc2d) // Nr. des Schlüssel
2672 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2673 CA BE 01 jpz 0x01be // Nr. des Schlüssel unverändert, Menüprogramm
2676 C3 2B 06 jp 0x062b // Aufruf der prophylaktischen Prüfung
// Taste ENTER
2679 FE 91 cp 0x91 // a <> 0x91, CTRL + Z
267b 20 E8 jrnz 0xe8 // 0x2665, warte auf CTRL + Z
// Einsprungpunkt Schlüsseleingabe
267d 3E 1B ld a, 0x1b // "SCHLUESSEL 1"
267f CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2682 3E 01 ld a, 0x01 // 1 = Schlüsselwechsel
2684 32 01 DC ld (0xdc01), a // Betriebsartenregister:
2687 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2688 32 2E DC ld (0xdc2e),a <--\ // Steuerwort 0x00, Schlüsseleingabe
268b CD 2B 02 call 0x022b | // ein Zeichen von der Tastatur
268e 3A 02 DC ld a, (0xdc02 ) | // ALDAT:-Datenübergaberegister Tastatur
2691 FE 91 cp 0x91 | // a == 0x91, CTRL + Z
2693 CA B0 27 jpz 0x27b0 | // Eingabe Schlüssel 2
2696 FE 43 cp 0x43 | // a <> 0x43, ENTER
2698 20 F1 jrnz 0xf1 >--/ // 0x268b, warte auf Enter
269a 21 00 94 ld hl, 0x9400 // SSP Schlüsselspeicher, crc-
269d 01 86 00 ld bc, 0x0086 // Länge 134 byte
26a0 11 01 94 ld de, 0x9401
26a3 36 00 ld (hl), 0x00
26a5 ED B0 ldir // Lösche Bereich (0x9400 - 0x9486) mit 0x00, 0x86 bytes // Schlüsselspeicher, crc-
26a7 21 00 94 ld hl, 0x9400 // Schlüsselspeicher, crc-
26aa 01 86 00 ld bc, 0x0086
26ae CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
26b0 F6 00 or 0x00 // a == 0x00 OK sonst:
26b2 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
26b5 3E 01 ld a, 0x01 // Schlüssel Nr. 1
26b7 32 2D DC ld (0xdc2d), a // Nr. des Schlüssel
// Einsprung Schlüssel 2 Eingabe
26ba 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
26be 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
26c0 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
26c3 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
26c6 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
26c7 32 23 DC ld (0xdc23), a // TPME1:-Formatierung Schlüssel
26ca 32 24 DC ld (0xdc24), a // TPME2:-Formatierung Schlüssel
26cd 21 EC 83 ld hl, 0x83ec
26d0 11 ED 83 ld de, 0x83ed
26d3 01 00 03 ld bc, 0x0300 // Länge 768 Byte
26d6 36 00 ld (hl), a
26d8 ED B0 ldir // Lösche (0x83ec - 0x86ec) mit 0x00, 0x0300 bytes
26da 21 84 84 ld hl, 0x8484
26dd 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
// Einsprung Schlüsselfehler
26e0 3E 01 ld a, 0x01
26e2 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor = 1 Schlüsseleingabe
26e5 3E 04 ld a, 0x04 // GT-Empfangen
26e7 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
26ea CD 4A 09 call 0x094a // Textprozessor
26ed CD F3 27 call 0x27f3 // Korrektur/Einfügen in Zeile
26f0 11 C8 84 ld de, 0x84c8
26f3 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518
26f6 06 24 ld b, 0x24 // Schlüssellänge incl. 2*crc16
26f8 CD E2 27 call 0x27e2 <---\ // De-Kodieren Tasteneingabe-Hexzahlen; Übergabe DE = 0x84c8, Rückgabe A
26fb ED 6F rld | // a = high; (HL3-0) = a3-0; a= (HL7-4); (HL7-4) = (HL3-0)
26fd 13 inc de |
26fe CD E2 27 call 0x27e2 | // De-Kodieren Tasteneingabe-Hexzahlen; Übergabe DE = 0x84c8 + n, Rückgabe A
2701 ED 6F rld | // a = low; (HL3-0) = a3-0; a= (HL7-4); (HL7-4) = (HL3-0)
2703 13 inc de | // (HL) = erste Eingabe z.B. 0xf, zweite Eingabe 0x5 (HL) = 0xf5
2704 23 inc hl |
2705 10 F1 djnz 0xf1 >---/ // 0x26f8, 36 bytes eingelesen = Schlüssel + 2*crc16
2707 06 20 ld b, 0x20 // nur den Schlüssel 32 bytes
2709 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518
270c AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
270d B6 or (hl) <--\ // a = a OR (HL)
270e 23 inc hl | // ++HL
270f 10 FC djnz 0xfc >--/ // a = a or (hl) prüfe ob keine 0x00 eingegeben wurde!
2711 B7 or a // mindestens ein Bit muß gesetzt sein!
2712 CA 94 02 jpz 0x0294 // a == 0 Schlüsselfehler
2715 21 38 85 ld hl, 0x8538 // Ort der ersten crc16 Prüfsumme, Falsch
2718 22 01 83 ld (0x8301), hl // Speicher Adresse auf der die Adresse mit den Prüfsummen zeigt
271b 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518
271e 01 20 00 ld bc 0x0020 // Länge 32 byte - 256 bit
2721 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2724 FE FF cp 0xff // Fehler erste Prüfsumme, Z = 1 wenn A - 0xff == 0 ist
2726 C2 CB 02 jpnz 0x02cb // BLOCKIERUNG 1
2729 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518; !! Muß man hier jetzt nicht verstehen !!
272c 01 20 00 ld bc, 0x0020 // Länge 32 bytes - 256 bit
272f 21 38 85 ld hl, 0x8538 // Ort der ersten crc16 Prüfsumme
2732 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
2735 CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
2738 F6 00 or 0x00 // Fehler erste Prüfsumme, Prüfsumme der Prüfsumme?, ergebniss muß != 0x00 sein
273a CA CB 02 jpz 0x02cb // BLOCKIERUNG 1, Wenn Ergebnis der CRC OK ist!
273d 21 3A 85 ld hl, 0x853a // Ort der zweiten crc16 Prüfsumme
2740 22 01 83 ld (0x8301), hl // Zeiger auf 2. Prüfsumme
2743 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518
2746 01 20 00 ld bc, 0x0020 // Länge 32 byte - 256 bit
2749 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
274c FE FF cp 0xff // Fehler zweite Prüfsumme
274e CA 94 02 jpz 0x0294 // SCHLÜSSELFEHLER
2751 21 3A 85 ld hl, 0x853a // zweite CRC16 Prüfsumme
2754 22 2B DC ld (0xdc2b), hl // Speicherort CRC für Prüfung
2757 21 18 85 ld hl, 0x8518 // Schlüssel steht z.Zt. in 0x8518
275a 01 20 00 ld bc, 0x0020 // Länge 32 byte - 256 bit
275d CD 1F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
2760 F6 00 or 0x00 // Fehler zweite Prüfsumme
2762 C2 94 02 jpnz 0x0294 // SCHLÜSSELFEHLER
2765 CD 29 2A call 0x2a29 // Ausgabe Zufalls-Passwort
2768 11 00 94 ld de, 0x9400 // Schlüsselspeicher, crc-
276b 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
276e 01 28 00 ld bc, 0x0028 // Länge 0x28 bytes, Schlüssel + 2*crc16
2771 3A 2D DC ld a, (0xdc2d) // Nr. des Schlüssel
2774 FE 01 cp 0x01 // Prüfe Schlüsselzähler
2776 28 03 jrz 0x03 // 0x277b, erster Schlüssel?
2778 11 46 94 ld de, 0x9446 // Adresse zweiter Schlüssel
277b ED B0 ldir // Kopiere PWD Schlüssel in die Bereiche 0x9400 oder 0x9446
277d 11 0A 95 ld de, 0x950a // Zeiger CRC Schlüssel1
2780 21 41 84 ld hl, 0x8441 // Zeiger auf (DE) CRC Prüfsumme Passwort
2783 01 02 00 ld bc, 0x0002 // Länge 2 byte CRC-16
2786 3A 2D DC ld a, (0xdc2d) // Nr. des Schlüssel
2789 FE 01 cp 0x01 // A == (0xdc2d) == 0x01?
278b 28 03 jrz 0x03 // 0x2790, Erster Schlüssel?
278d 11 0C 95 ld de, 0x950c // CRC Schlüssel 1 oder 2
2790 ED B0 ldir // Kopiere (CRC) von 0x8441 nach (Key 1) 0x950a, (Key 2) 0x950c mit der Länge 2
2792 21 EC 83 ld hl, 0x83ec
2795 E5 push hl
2796 D1 pop de // DE = HL = 0x83ec
2797 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2798 13 inc de
2799 77 ld (hl), a
279a 01 14 04 ld bc, 0x0414 // Länge
279d ED B0 ldir // Lösche 0x83ec - 0x87ff, mit 0x00
279f 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
27a2 01 FF 03 ld bc, 0x03ff
27a5 CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
27a8 F6 00 or 0x00
27aa C2 DB 02 jpz 0x02db // BLOCKIERUNG 5
27ad C3 60 26 jp 0x2660 // Sprung Schlüsseleingabe
// Einsprung aus: 0x2693 Schlüsseleingabe
27b0 3E 1C ld a, 0x1c // "SCHLUESSEL 2"
27b2 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
27b5 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
27b8 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
27bb FE 43 cp 0x43 // ENTER
27bd 20 F6 jrnz 0xf6 // 0x27b5
27bf 21 46 94 ld hl, 0x9446 // 2. Schlüsselbereich
27c2 01 20 00 ld bc, 0x0020 // Länge
27c5 11 47 94 ld de, 0x9447
27c8 36 00 ld (hl), 0x00
27ca ED B0 ldir // Lösche 2. Schlüsselbereich
27cc 21 46 94 ld hl, 0x9446 // 2. Schlüsselbereich
27cf 01 20 00 ld bc, 0x0020
27d2 CD B4 28 call 0x28b4 // Prüfe (HL) == 0x00
27d5 F6 00 or 0x00 // a == 0
27d7 C2 DB 02 jpz 0x02db // BLOCKIERUNG 5
27da 3E 02 ld a, 0x02
27dc 32 2D DC ld (0xdc2d), a // Nr. des Schlüssel
27df C3 BA 26 jp 0x26ba // Sprung nach Schlüsseleingabe / Prüfung
// De-Kodieren Tasteneingabe-Hexzahlen
27e2 E5 push hl
27e3 C5 push bc
27e4 1A ld a, (de)
27e5 01 10 00 ld bc, 0x0010
27e8 21 A7 0D ld hl, 0x0da7 // Umsetztabelle
27eb ED B1 cpir // BC == 0? oder a == (HL)
27ed 3E 0F ld a, 0x0f
27ef 91 sub c // a = 0x0f - c; a = 0x00 ... 0x0f
27f0 C1 pop bc
27f1 E1 pop hl
27f2 C9 ret
// Korrektur/Einfügen in Zeile
27f3 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
27f6 11 C8 84 ld de, 0x84c8
// Wiederholung
27f9 0E 07 ld c, 0x07
// Schleife, 7 Runden
27fb 7E ld a, (hl)
27fc FE 04 cp 0x04 // a == 4
27fe 28 14 jrz 0x14 // 0x2814 -> INC HL und 0x27fb weiter
2800 47 ld b, a
2801 79 ld a, c // Prüfzähler
2802 FE 07 cp 0x07 // a == 7
2804 28 0D jrz 0x0d // 0x2813 -> DEC C, INC HL 0x27fb weiter
2806 FE 06 cp 0x06 // a == 6
2808 28 09 jrz 0x09 // 0x2813 -> DEC C, INC HL 0x27fb weiter
280a 78 ld a, b // wiederherstellen A, C < 6
280b 12 ld (de), a // A in 0x84c8 ++ ablegen; 5 Elemente 0x84c8 ... 0x84cc
280c 23 inc hl
280d 13 inc de
280e 0D dec c // c <> 0
280f 20 EA jrnz 0xea // 0x27fb -> Schleife 7 Elemente
2811 18 04 jr 0x04 // 0x2817 -> nach 7 Elemente bzw. 5 gespeicherte Werte
// Schleife C == 7, C == 6
2813 0D dec c
2814 23 inc hl
2815 18 E4 jr 0xe4 // 0x27fb
// Schleife C == 0
2817 E5 push hl // Rette HL; HL 0x8400 + "C" Testspeicher Startwert
28a8 01 9E 84 ld bc, 0x849e // Ende Testspeicher erreicht?
28ab ED 42 sbc hl, bc // Länge = -1 ?
28ad E1 pop hl // wiederherstellen HL
28ae 38 D9 jrc 0xd9 // 0x27f9; Wiederholung der Schleife
2820 C9 ret
// Programm Schlüsselwechsel
2821 3E 1A ld a, 0x1a // "SCHLUESSELWECHSEL"
2823 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2826 CD 1C 02 call 0x021c // Zeit 1sec
2829 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
282c CB 86 res 0, (hl) // Lösche neues Zeichen
// wiederholen Tastaturabfrage
282e CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
2831 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
2833 FE 43 cp 0x43 // a == 0x43,ENTER
2835 CA BE 01 jpz 0x01be // Menüprogramm
2838 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
283b FE 93 cp 0x93 // a <> 0x93
283e 20 EE jrnz 0x0ee // 0x282e; wiederholen Tastaturabfrage
2840 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2841 32 2E DC ld (0xdc2e), a // Steuerwort Schlüsselwechsel
2843 21 00 94 ld hl, 0x9400 // Schlüsselspeicher, crc-
2846 11 01 94 ld de, 0x9401
2849 01 20 00 ld bc, 0x0020 // Länge
284b 36 00 ld (hl), 0x00
284f ED B0 ldir // lösche (0x9400 Schlüsselspeicher 0x20 byte)
2851 21 02 95 ld hl, 0x9502
2853 22 01 83 ld (0x8301), hl // Zeiger, auf 0x9502
2856 21 46 94 ld hl, 0x9446 // 2. Schlüsselbereich
2859 01 20 00 ld bc 0x0020 // Länge
285b CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2860 FE FF cp 0xff // a == 0xff; CRC fehlerhaft == 0xff
2862 28 2B jrz 0x2b // 0x288f; Lösche Speicherbereiche
2864 21 46 94 ld hl, 0x9446 // 2. Schlüsselbereich
2867 11 00 94 ld de, 0x9400 // Schlüsselspeicher, crc-
286a 01 28 00 ld bc, 0x0028 // Länge 0x28 byte
286d ED B0 ldir // Kopiere 2. Schlüssel in 1. Schlüsselbereich
286f 2A 02 95 ld hl, (0x9502)
2872 22 00 95 ld (0x9500), hl // Zeiger auf den 2ten Schlüssel
2875 21 46 94 ld hl, 0x9446 // 2. Schlüsselbereich
2878 11 47 94 ld de, 0x9447
287b 01 20 00 ld bc, 0x0020 // Länge
287e 36 00 ld (hl), 0x00
2880 ED B0 ldir // Lösche 2. Schlüsselbereich
2882 21 80 83 ld hl, 0x8380 // Zeiger auf 0x9502, s. 0x2851
2885 11 81 83 ld de, 0x8381
2888 01 7F 00 ld bc, 0x007f // Länge
288b 36 EE ld (hl), 0xee // Füllbyte
288d ED B0 ldir // Kopiere 0xee nach (0x8380 - 0x83ff), %1110 1110
// Einsprung aus Ergebnis CRC-Prüfung fehlerhaft; 0x2862; Lösche Passwort
288f 21 00 96 ld hl, 0x9600 // PWSP; Passwort Speicher, 32 byte - 256 bit
2892 11 01 96 ld de, 0x9601
2895 01 20 00 ld bc, 0x0020 // Länge 32 byte - 256 bit
2898 36 EE ld (hl), 0xee // Füllbyte
289a ED B0 ldir // schreibe 0xee nach 0x9600 - 0x961f, %1110 1110
289c C3 20 00 jp 0x0020 // RST 0x20, Aufruf PP Kaltstart
// CRC1 Check, Aufruf in DE = Prüfsumme
// Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
289f CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
28a2 2A 01 83 ld hl, (0x8301) // Adresse in der die Adresse zur CRC16 Prüfsumme steht
28a5 7A ld a, d // Vergleiche CRC in D mit gespeicherte CRC (HL)
28a6 BE cp (hl) // d <> (hl)
28a7 20 08 jrnz 0x08 // 0x28b1, CRC high wert falsch
28a9 7B ld a, e // Vergleiche CRC in E mit gespeicherte CRC (HL+1)
28aa 23 inc hl
28ab BE cp (hl) // e <> (hl)
28ac 20 03 jrnz 0x03 // 0x28b1, CRC low wert falsch
28ae AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
28af 18 02 jr 0x02 // 0x28b3, CRC OK, a = 0x00
// Einsprung CRC Fehler
28b1 3E FF ld a, 0xff // a = 0xff CRC-Fehler
// Einsprung OK
28b3 C9 ret
// Prüfe (HL) == 0x00
28b4 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
// Schleife BC
28b5 B6 or (hl)
28b6 ED A1 cpi // Verleich mit increment HL++, BC--
28b8 EA B5 28 jppe 0x28b5 // Jump Parity even
28bb B7 or a
28bc C8 retz // a == 0x00 OK
28bd 3E FF ld a, 0xff // a != 0x00 Fehler
28bf C9 ret
// Zählervariable (0xdc2e)--; Beriebsart BA/PP/Schlüsselwechsel; Wird nicht genutzt; LEICHE
28c0 F5 push af // rette AF
28c1 3A 2E DC ld a, (0xdc2e) // Steuerwort (0xfb)
28c4 3D dec a // 0xfa
28c5 32 2E DC ld (0xdc2e), a // Steuerwort
28c8 F1 pop af // wiederherstellen AF
28c9 C9 ret
// Einsprung aus Anfangsprüfung Schlüssel, CRC war OK
28ca 21 00 96 ld hl, 0x9600 // PWSP; Passwort Speicher, 32 byte
28cd 3E EE ld a, 0xee
28cf 06 20 ld b, 0x20 // Schleife 32 Runden
// Schleife 32 * 0xee?
28d1 BE cp (hl) <-\ // (0x9600) != 0xee, %11101110
28d2 C2 D7 02 jpnz 0x02d7 | // BLOCKIERUNG 4, Abbruch
28d5 36 00 ld (hl), 0x00 | // Lösche Passwort Speicher
28d7 23 inc hl |
28d8 10 F7 djnz 0xf7 >-/ // (0x9600 - 0x9620) != 0xee, 32 Runden
// Einsprung aus Passwortüberprüfung
28da CD 9E 29 call 0x299e // Passworteingabe Aufruf mit Rundenschlüssel
28dd 11 C2 83 ld de, 0x83c2 // Ziel Chiffrierung PWD
28e0 21 00 94 ld hl, 0x9400 // SSP Schlüsselspeicher, 1
28e3 3E 04 ld a, 0x04 // 4 Runden
28e5 CD 61 29 call 0x2961 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A
28e8 11 E2 83 ld de, 0x83e2 // Ziel Chiffrierung PWD mit Rundenschlüssel 2
283b 21 20 94 ld hl, 0x9420 // SSP Schlüsselspeicher, 2
283e 3E 01 ld a, 0x01 // 1 Runde
28f0 CD 61 29 call 0x2961 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A
28f3 21 E2 83 ld hl, 0x83e2 // Chiffrat PWD mit Rundenschlüssel 2
28f6 22 01 83 ld (0x8301), hl
28f9 21 C2 83 ld hl, 0x83c2 // Chiffrat PWD mit Rundenschlüssel 1
28fc 01 20 00 ld bc, 0x0020 // Länge 32 byte
28ff CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2902 FE FF cp 0xff // 0xff Fehler
2904 20 38 jrnz 0x38 // 0x293f Anzeige PASWWORTFEHLER
2906 21 80 83 ld hl, 0x8380
2909 E5 push hl
290a D1 pop de // DE = 0x8380
290b 3E AA ld a, 0xaa
290d 13 inc de // DE = 0x8381
290e 77 ld (hl), a // HL = 0x8380
290f 01 60 00 ld bc, 0x0060 // Länge 96 bytes
2912 ED B0 ldir // Fülle 0x8380 - 0x83ff mit 0xaa
2914 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
2917 3E 0D ld a, 0x0d // a = 0x0d Funktionsnr. = 13
2919 BE cp (hl) // (HL) == 0x0d; Funktion Chiffrieren - Dechiffrieren -Kontrollchiffrieren -Kontrolldechiffrieren?
291a 20 23 jrnz 0x23 // 0x293f -> Fehler
291c 23 inc hl // 0x8401
291d 3E 20 ld a, 0x20 // Funktionsnr. = 0x20
291f BE cp (hl) // (HL) == 0x20
2920 20 1D jrnz 0x1d // 0x293f -> Fehler
2922 23 inc hl // 0x8402
2923 3E 5D ld a, 0x5d
2925 BE cp (hl) // (HL) == 0x5d
2926 20 17 jrnz 0x17 // 0x293f -> Fehler
2928 23 inc hl // 0x8403
2929 3E 0C ld a, 0x0c
292b BE cp (hl) // (HL) == 0x0c
292c 20 11 jrnz 0x11 // 0x293f -> Fehler
292e 23 inc hl // 0x8404
292f 3E C2 ld a, 0xc2
2931 BE cp (hl) // (HL) == 0xc2
2932 20 0B jrnz 0x0b // 0x293f -> Fehler
2934 23 inc hl // 0x8405
2935 3E 4A ld a, 0x4a
2937 BE cp (hl) // (HL) == 0x4a
2938 20 05 jrnz 0x05 // 0x293f -> Fehler
293a 21 7D 26 ld hl, 0x267d // Schlüsseleingabe
293d E3 ex (sp), hl
293e C9 ret // Sprung in die Schlüsseleingabe 0x267d
// Einsprung CRC Schlüssel Passwort Fehler
293f 3A FE 97 ld a, (0x97fe) // Zeiger Nr. Textausgabe
2942 3C inc a
2943 32 FE 97 ld (0x97fe), a // a > 0
2946 FE 14 cp 0x14 // A == 0x14
2948 28 12 jrz 0x12 >-\ // 0x295c, ja -> "SELBSTTEST"
294a 3E 21 ld a, 0x21 | // "PASSWORTFEHLER ?"
294c CD 9A 10 call 0x109a | // Anzeige Befehls-Fehleranzeige
// Schleife Passworteingabe |
294f CD 2B 02 call 0x022b <-\ | // ein Zeichen von der Tastatur
2952 3A 02 DC ld a, (0xdc02) | | // ALDAT:-Datenübergaberegister Tastatur
2955 FE 43 cp 0x43 | | // ENTER
2957 20 F6 jrnz 0xf6 >-/ | // 0x294f, Schleife
2959 C3 DA 28 jp 0x28da | // neue Überprüfung Paswort
|
295c 21 35 02 ld hl, 0x0235 <-/ // Schlüsselspeicher löschen, Bereich 0x8380 - 0x97ff -> Blockierung 5
295f E3 ex (sp), hl // (SP) = HL = 0x0235
2960 C9 ret // Sprung nach 0x0235
// Passwortchiffrierung mit Feistel, Übergabe HL, DE, A, identisch mit 0x2ad7; Richtung Rückwärts
// Übergabe HL, DE, A
2961 ED 53 EA 83 ld (0x83ea), de // Übergabe Zieladresse
// Schleife A
2965 F5 push af <-\ // Rette AF
2966 11 42 DC ld de, 0xdc42 | // Übergabe HL aus vorherigem Aufruf! (0x9400, 0x9420)
2969 01 08 00 ld bc, 0x0008 | // Länge 8 byte
296c ED B0 ldir | // Kopie (HL) > (0xdc42), 8 byte
296e E5 push hl | // HL+8 [0x9408, 0x9428]
296f 21 42 DC ld hl, 0xdc42 | // von Ziel der vorherigen Kopie
2972 11 96 DE ld de, 0xde96 | // Ziel, für weitere Bearbeitung
2975 01 08 00 ld bc, 0x0008 | // Länge 8 byte
2978 ED B0 ldir | // Kopie (0xdc42) > (0xde96), 8 byte
297a CD 40 1C call 0x1c40 | // Feistel, Rückwärts
297d 21 96 DE ld hl, 0xde96 | // Wurmfolgen
2980 11 42 DC ld de, 0xdc42 |
2983 01 08 00 ld bc, 0x0008 | // Länge 8 byte
2986 ED B0 ldir | // Kopiere veränderte Folge > 0xdc42, 8 bytes
2988 ED 5B EA 83 ld de, (0x83ea) | // Zieladresse aus der Übergabe DE [0x83e2, 0x83c2] n*8
298c 21 42 DC ld hl, 0xdc42 |
298f 01 08 00 ld bc, 0x0008 | // Länge 8 byte
2992 ED B0 ldir | // Kopiere 0xdc42 > (de), 8 bytes
2994 ED 53 EA 83 ld (0x83ea), de | // Adresse aus Übergabe DE+8*A 0x8400 + 8*A; 0x8400 ... 0x8408 oder ... 0x8420
2998 E1 pop hl | // A * 8 + HL [0x9408, 0x9410, ... 0x9428, 0x9430 ...]
2999 F1 pop af | // wiederherstellen AF
299a 3D dec a | // A == 0x00?
299b 20 C8 jrnz 0xc8 >-/ // 0x2965; Schleife A
299d C9 ret
// Passworteingabe
299e 3E 19 ld a, 0x19 // "PASSWORT"
29a0 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
29a3 21 00 84 ld hl, 0x8400 // Klartextspeicher; GL.KTSPS
29a6 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
29a9 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
29ac 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
29af 21 28 84 ld hl, 0x8428 // 40 Bytes später
29b2 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
29b5 3E 08 ld a, 0x08
29b7 32 1A DC ld (0xdc1a), a // ADZS:-Adresse Zeitschlüssel
29ba AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
29bb 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
29be 32 27 DC ld (0xdc27), a // ZUAN3:-Einfügemode
29c1 21 03 DC ld hl, 0xdc03 <-\ // ZUALF:-Zustand Alpha-Tastendruck
29c4 CB 46 bit 0, (hl) | // Abfrage neues Zeichen
29c6 28 F9 jrz 0xf9 >-/ // 0x29c1-> JA
// CALL Einsprung Ein/Ausgabe Zufall-Passwort
29c8 CD 4A 09 call 0x094a // Textprozessor
29cb 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor 0x8400 + n
29ce 11 00 84 ld de, 0x8400 // Klartextspeicher; GL.KTSPS
29d1 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
29d2 ED 52 sbc hl, de // Länge > 0
29d4 20 09 jrnz 0x09 >--\ // 0x29df, Länge 8byte?
29d6 2A 1D DC ld hl, (0xdc1d) | // EADR:-End-Zeiger-TextProzessor
29d9 36 2E ld (hl), 0x2e | // Auffüllen mit 0x2e '.' oder '(' ASCII/ITA-2
29db 23 inc hl |
29dc 22 1D DC ld (0xdc1d), hl | // EADR:-End-Zeiger-TextProzessor
// Einsprung Länge > 0 |
29df 2A 1D DC ld hl, (0xdc1d)<-/ // EADR:-End-Zeiger-TextProzessor
29e2 22 C6 DC ld (0xdcc6), hl // Zeiger auf GL.EAKTS; Endadresse
29e5 CD 5D 2D call 0x2d5d // Zusammenziehen Passwort(0x8400) Rückgabe DE = (0xdcc6), 6 bit ACII nach 8 bit
29e8 2A C6 DC ld hl, (0xdcc6) // GL.EAKTS; neue Endadresse nach dem Zusammenziehen
29eb 11 00 84 ld de, 0x8400 // Klartextspeicher; GL.KTSPS
29ee AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
29ef ED 52 sbc hl, de // Länge des Passwortes
29f1 45 ld b, l // Schleifenzähler, 8 Runden bei zusammengezogenen Passwort
29f2 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
29f5 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
29f6 AE xor (hl) <-| // A = A XOR (HL)
29f7 23 inc hl | // neuer Wert, A = (HL-1) XOR (HL)
29f8 10 FC djnz 0xfc >-| // bis Länge < 1, Passwort 12 Zeichen > 8 Zeichen Zusammen
29fa F5 push af // rette AF, a = 0, Z-Flag = 1
29fb 21 20 84 ld hl, 0x8420 // Endadresse PWD Speicher
29fe ED 5B C6 DC ld de, (0xdcc6) // Endadresse, Zeiger auf 0x8409; GL.EAKTS
2a02 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2a03 ED 52 sbc hl, de // Länge
2a05 45 ld b, l // Länge in der Rest 0x17
2a06 F1 pop af // wiederherstellen AF, A = (HL-1) XOR (HL)
2a07 2A C6 DC ld hl, (0xdcc6) // Endadresse; Zeiger auf 0x8400; GL.EAKTS
2a0a 3C inc a <-| // A++
2a0b 77 ld (hl), a | // Endadress (0xdcc6) = A++ (aus vorherigen (HL-1) XOR (HL) Schleife
2a0c 23 inc hl | // Endadresse + 1
2a0d 10 FB djnz 0xfb >-| // bis Länge < 0, Auffüllen bis 0x8420
2a0f 11 52 DC ld de, 0xdc52
2a12 21 00 84 ld hl, 0x8400 // Klartextspeicher;GL.KTSPS
2a15 01 20 00 ld bc 0x0020 // Länge 32byte
2a18 ED B0 ldir // kopiere (0x8400) > (0xdc52), 32 Bytes. Klartextspeicher senden; GL.KTSPS
2a1a 21 52 DC ld hl, 0xdc52
2a1d 11 9E DE ld de, 0xde9e
2a20 01 08 00 ld bc, 0x0008 // Länge 8byte
2a23 ED B0 ldir // kopiere (0xdc52) > (0xde9e), 8 bytes
2a25 CD 69 1B call 0x1b69 // Rundenschlüssel für Feistel, Übergabe A = Füllzeichen, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
2a28 C9 ret
// Ausgabe Zufalls-Passwort
2a29 3E 00 ld a, 0x00
2a2b 32 D8 DC ld (0xdcd8), a // Wiederholungszähler, max 3
// Einsprung Schleife Wiederholungszähler A
2a2e 3E 40 ld a, 0x40 // BA: ZF-Erzeugung 0x40
2a30 32 90 DC ld (0xdc90), a // Betriebsart Zufallsgenerator bit 7, 6, 5
2a33 CD 15 08 call 0x0815 // Init Zufallserzeugung
2a36 3E 19 ld a, 0x19 // "PASSWORT"
2a38 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2a3b CD 1C 02 call 0x021c // Zeit 1sec
2a3e 3E 02 ld a, 0x02 // "MOMENT BITTE"
2a40 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2a43 CD 48 08 call 0x0848 // Ausschalten Zufallsgenerator
2a46 3A 90 DC ld a, (0xdc90) // Betriebsart Zufallsgenerator bit 7, 6, 5
2a49 CB 77 bit 6, a // ZF-Erzeugung Error
2a4b C2 D3 02 jpnz 0x02d3 // BLOCKIERUNG 3, HALT
2a4e 0E 20 ld c, 0x20 // Schleifenzähler - 32 Zufallsfolgen
2a50 06 0C ld b, 0x0c // Schleifenzähler DJNZ - 12 Zeichen
2a52 11 00 84 ld de, 0x8400 // Adresse Passwort
2a55 21 00 80 ld hl, 0x8000 // 32 Zufallsfolgen im Bereich von 0x00 bis 0xff
// Schleife C 32 Elemente
2a58 7E ld a, (hl)
2a58 E6 1F and 1f // Maskiere A = 0x00 ... 0x1f -> ITA2 Zeichen
2a5a E5 push hl // rette HL
2a5b C5 push bc // rette BC
2a5c 21 14 2B ld hl, 0x2b14 // Array Fs Zeichen; 0x01 bis 0x1e
2a60 01 1A 00 ld bc, 0x001a // BC Schleife, 26 Fs-Buchstaben
2a63 ED B1 cpir // BC == 0? Suche 26 Runden oder a == (HL)
2a65 20 07 jrnz 0x07 // 0x2a6e; nicht gefunden: 0x00, 0x02, 0x08, 0x1b,
2a67 12 ld (de), a // Gefunden, in 0x8400 ... abgelegt
2a68 13 inc de // bis 0x840c
2a69 C1 pop bc // BC wiederherstellen
2a6a 10 03 djnz 0x03 // 12 Runden, 0x2a6f
2a6c 18 15 jr 0x15 // 0x2a83
// Einsprung - Abbruch oder Neustart Zufallszahl
2a6e C1 pop bc // wiederherstellen BC
// Einsprung DJNZ 12 Runden
2a6f E1 pop hl // wiederherstellen HL
2a70 23 inc hl // erhöhe Adresse Zufallsfolgen
2a71 0D dec c // vermindere Rundenanzahl (32 ...)
2a72 20 E4 jrnz 0xe4 // 0x2a58 weiter, noch Zufallsfolgen vorhanden?
2a74 3A D8 DC ld a, (0xdcd8) // Ende der Zufallsfolgen erreicht; A = 0x00
2a77 3C inc a // Wiederholungszähler A = 0x01, 0x02, 0x03
2a78 FE 03 cp 0x03 // nach der dritten Runde Fehlermeldung
2a7a CA D3 02 jpz 0x02d3 // BLOCKIERUNG 3, HALT
2a7d 32 D8 DC ld (0xdcd8), a // Speichern erhöhten Wiederholungszähler
2a80 C3 2E 2A jp 0x2a2e // maximal 3 Runden Passworterzeugung
// Einsprung 12 Passwortbuchstaben gespeichert
2a83 E1 pop hl // Stack geradeziehen
2a84 21 00 84 ld hl, 0x8400 // abgelegtes Passwort in CCITT-2/ITA-2 6bit
2a87 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
2a8a 21 0C 84 ld hl, 0x840c // Endadresse Passwort
2a8d 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
2a90 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
2a93 21 28 84 ld hl, 0x8428 // 40 byte später
2a96 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
2a99 3E 08 ld a, 0x08
2a9b 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor
2a9e AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2a9f 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
2aa2 32 27 DC ld (0xdc27), a // ZUAN3:-Einfügemode
2aa5 21 03 DC ld hl, 0xdc03 // ZUALF:-Zustand Alpha-Tastendruck
2aa8 CB 86 res 0, (hl) // Lösche neues Zeichen
2aaa CD C8 29 call 0x29c8 // Einsprung Passworteingabe->Textprozessor; Zusammenziehen->Rundenschlüssel
2aad 11 00 84 ld de, 0x8400 // Zieladresse Chiffrat
2ab0 21 18 85 ld hl, 0x8518 // Startadresse Schlüssel 1
2ab3 3E 04 ld a, 0x04 // 4 Runden
2ab5 CD D7 2A call 0x2ad7 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A; vorwärts
2ab8 11 20 84 ld de, 0x8420 // Zieladresse Chiffrat
2abb 21 3A 85 ld hl, 0x853a // Startadresse Schlüssel 2
2abe 3E 01 ld a, 0x01 // 1 Runde
2ac0 CD D7 2A call 0x2ad7 // Passwortchiffrierung mit Feistel, Übergabe HL, DE, A; vorwärts
2ac3 21 00 84 ld hl, 0x8400 // Chiffrat
2ac6 01 20 00 ld bc, 0x0020 // Länge 32 byte
2ac9 CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
2acc 21 41 84 ld hl, 0x8441 // Zieladresse CRC des chiffrierten Passwortes
2acf 72 ld (hl), d
2ad0 23 inc hl
2ad1 73 ld (hl), e // (0x8441, 08x442) = CRC Summe Passwort
2ad2 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2ad3 32 FE 97 ld (0x97fe), a // Nr. Textausagbe
2ad6 C9 ret // Chiffrat PWD CRC abgelegt.
// Passwortchiffrierung mit Feistel, Übergabe HL, DE, A; identisch mit 0x2961 außer Richtung Vorwärts
// Übergabe HL, DE, A
2ad7 ED 53 EA 83 ld (0x83ea), de // rette Zeiger Zieladresse; 0x8400; 0x8420; 0x8518
// Schleife A, n* Runden aus der Übergabe
2adb F5 push af <-\ // rette AF, Einsprung Schleife, A = Schleifenzähler
2adc 11 42 DC ld de, 0xdc42 | // HL aus Übergabe 0x8518
2adf 01 08 00 ld bc, 0x0008 | // Länge 64bit, 8byte
2ae2 ED B0 ldir | // Kopie (HL) > (0xdc42) Länge 64bit, 8byte
2ae4 E5 push hl | // rette HL + 8
2ae5 21 42 DC ld hl, 0xdc42 |
2ae8 11 96 DE ld de, 0xde96 |
2aeb 01 08 00 ld bc, 0x0008 | // Länge 64bit, 8byte
2aee ED B0 ldir | // Kopie (0xdc42) > (0xde96) Länge 64bit, 8byte
2af0 CD 3D 1C call 0x1c3d | // Feistel vorwärts, Übergabe/Rückgabe 0xde96
2af3 21 96 DE ld hl, 0xde96 | // Wurmfolgen
2af6 11 42 DC ld de, 0xdc42 |
2af9 01 08 00 ld bc, 0x0008 | // Länge 64 bit
2afc ED B0 ldir | // Zurück - Kopieren (0xde96) > (0xdc42) Länge 64bit, 8byte
2afe ED 5B EA 83 ld de, (0x83ea) | // Übergabe DE n*8
2b02 21 42 DC ld hl, 0xdc42 |
2b05 01 08 00 ld bc, 0x0008 | // Länge 64bit, 8byte
2b08 ED B0 ldir | // Zurück - Kopieren (0xdc42) > 0x8400; 0x84 Länge 8 Byte
2b0a ED 53 EA 83 ld (0x83ea), de | // DE+8; Zeiger auf DE aus der Übergabe [0x8400, 0x8420]
2b0e E1 pop hl | // wiederherstellen HL, aus Übergabe HL + 8
2b0f F1 pop af | // wiederherstellen AF
2b10 3D dec a | // Schleifenzähler A--
2b11 20 C8 jrnz 0xc8 >-/ // 0x2adb, A != 0 springe in die Schleife
2b13 C9 ret
// Umwandlungstabelle Buchstaben - Fernschreibzeichen
2b14 01 03 05 06 07 09 0A 0B 0C 0D 0E 0F // E A S I U D R J N F C K
2b20 10 11 12 13 14 15 16 17 18 19 1A 1C 1D 1E // T Z L W H Y P Q O B G M X V
// DES-256 Dechiffrieren
2b2e 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher, Hauptbetriebsart-1; GL.HBA
2b31 FE 01 cp 0x01 // MIRA
2b33 28 08 jrz 0x08 // 0x2b3d
2b35 2A A4 DC ld hl, (0xdca4) // GO; Endadresse GTX-Speicher
2b38 01 00 90 ld bc, 0x9000 // Startadresse, GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
2b3b 18 06 jr 0x06 // 0x2b43
// Einsprung MIRA
2b3d 2A A2 DC ld hl, (0xdca2) // Hole End-Adresse von GTX (A-P)
2b40 01 00 8C ld bc, 0x8c00 // GeheimtextspeicherText (A-P)
// Einsprung GO
2b43 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2b44 ED 42 sbc hl, bc // Länge > 0, Länge > -1
2b46 CA 7E 02 jpz 0x027e // Kein Text -> Enter -> Menüprogramm
2b49 DA 76 02 jpc 0x0276 // Anzeige Meldung BLOCKIERUNG 1, Länge -1
2b4c 3A 2E DC ld a, (0xdc2e) // Steuerwort, sollte 0xfb sein
2b4f 32 2F DC ld (0xdc2f), a // Sichere Steuerwort vor Dechiffrierung, danach wiederherstellen!
2b52 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2b53 32 2E DC ld (0xdc2e), a // Steuerwort 0x00
2b56 3E 06 ld a, 0x06 // "DECHIFFRIEREN ?"
2b58 CD 9A 10 call 0x109a // Anzeige Befehls-Fehleranzeige
2b5b 11 1B 83 ld de, 0x831b // Kopie Schlüssel 1
2b5e 2A 81 DC ld hl, (0xdc81) // Zeiger auf Schlüssel 1
2b61 01 20 00 ld bc, 0x0020 // Länge = 32 * 8 bit
2b64 ED B0 ldir // kopiere 256 bit Schlüssel
2b66 2A 83 DC ld hl, (0xdc83) // Zeiger CRC;
2b69 22 01 83 ld (0x8301), hl // kopiere Zeiger auf CRC Schlüssel 1
2b6c 21 1B 83 ld hl, 0x831b // Kopie Schlüssel 1
2b6f 01 20 00 ld bc, 0x0020 // Länge = 32 * 8 bit
2b72 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2b75 FE FF cp 0xff // Error
2b77 CA DB 02 jpz 0x02db // BLOCKIERUNG 5
2b7a 21 1B 83 ld hl, 0x831b // Kopie Schlüssel 1
2b7d 11 9E DE ld de, 0xde9e // hole 8byte aus Schlüssel 1 Kopie und lege hier ab
2b80 01 08 00 ld bc, 0x0008 // Länge 8 byte = 64 bit
2b83 ED B0 ldir // kopiere (0x831b) > (0xde9e) 8 bytes, A = 0x00; 64 bit
2b85 CD 69 1B call 0x1b69 // Rundenschlüssel für Feistel, Übergabe A = 0x00, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
2b88 11 0B 83 ld de, 0x830b
2b8b 21 00 90 ld hl, 0x9000 // GeheimtextspeicherZifferncode, GTX-Speicher empfangen; GL.SPE
2b8e 01 08 00 ld bc, 0x0008 // Länge
2b91 ED B0 ldir // kopiere (0x9000) > (0x830b) 8 bytes; GL.SPE
2b93 21 08 90 ld hl, 0x9008 // Endadresse IV
2b96 22 01 83 ld (0x8301), hl
2b99 21 0B 83 ld hl, 0x830b // Startadresse GTX, Endadr. CRC16 IV
2b9c 01 08 00 ld bc, 0x0008 // IV
2b9f CD 9F 28 call 0x289f // CRC1 Check des IV, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2ba2 FE FF cp 0xff // Error
2ba4 CA DB 02 jpz 0x02db // BLOCKIERUNG 5
2ba7 3A 00 DC ld a, 0xdc00 // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
2baa FE 01 cp 0x01 // MIRA
2bac 28 10 jrz 0x10 // Sprung MIRA
// Dummy Dechiffrieren GO
2bae 2A A4 DC ld hl, (0xdca4) // GO
2bb1 01 0C 90 ld bc, 0x900c // Startadr. GTX
2bb4 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2bb5 ED 42 sbc hl, bc // Länge == -1
2bb7 DA DB 02 jpc 0x02db // BLOCKIERUNG 5
2bba 2B dec hl
2bbb 2B dec hl // HL - 1 (CRC16 Länge)
2bbc 18 0F jr 0x0f // 0x2bcd
// Dummy Dechiffrieren MIRA
2bbe 2A A4 DC ld hl, (0xdca4) // Endadresse Gesamter GTX
2bc1 01 0A 90 ld bc, 0x900a // Endadresse IV CRC
2bc4 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2bc5 ED 42 sbc hl, bc // Länge == 0, Länge == -1
2bc7 CA AE 2C jpz 0x2cae // RICHTIGE IV; JEDOCH KEIN GT (KONTROLLAUSSPRUNG)
2bca DA DB 02 jpc 0x02db // BLOCKIERUNG 5
// Einsprung nach Prüfung Länge > 0
2bcd 22 03 83 ld (0x8303), hl // Sichere Länge, GL.ANZA1; Geheimtextlänge Anzahl 1
2bd0 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2bd3 22 07 83 ld (0x8307), hl // Zeiger auf Textspeicher
2bd6 21 00 00 ld hl, 0x0000
2bd9 22 05 83 ld (0x8305), hl // speichere 0x0000
2bdc 21 0C 90 ld hl, 0x900c // erstes GTX Zeichen
2bdf 22 09 83 ld (0x8309), hl // Zeiger auf 0x900c
2be2 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
2be5 FE 01 cp 0x01 // MIRA
2be7 20 06 jrnz 0x06 // Sprung HBA GO
2be9 21 0A 90 ld hl, 0x900a // MIRA
// Einsprung GO
2bec 22 09 83 ld (0x8309), hl // Zeiger auf 0x900a oder 0x900c
2bef 21 0B 83 ld hl, 0x830b <-\ // Schleife bis Textende, HL Start IV
2bf2 11 96 DE ld de, 0xde96 | // Zieladresse Kopie IV
2bf5 01 08 00 ld bc, 0x0008 | // Länge
2bf8 ED B0 ldir | // kopiere IV (0x830b) > (0xde96)
2bfa CD 3D 1C call 0x1c3d | // Feistel vorwärts, Übergabe/Rückgabe 0xde96
2bfd 21 96 DE ld hl, 0xde96 | // Wurmfolgen
2c00 11 0B 83 ld de, 0x830b |
2c03 01 08 00 ld bc, 0x0008 | // Länge
2c06 ED B0 ldir | // kopiere Chiffr. IV (0xde96) > (0x830b) 8 bytes 64bit
2c08 21 0B 83 ld hl, 0x830b | // Wurmfolgen
2c0b ED 5B 09 83 ld de, (0x8309) | // Zeiger auf 0x900a oder 0x900c; GTX
2c0f DD 2A 07 83 ld ix, (0x8307) | // 0x8800 Klarttextspeicher empfangen
2c13 06 08 ld b, 0x08 |
// Schleife "B" 8 Runden |
2c15 1A ld a, (de) <-\ | // GTX xor Wurm
2c16 AE xor (hl) | | // a = (DE) xor (hl) Dechiffrieren
2c17 DD 77 00 ld (ix + 00), a | | // Klartext binär
2c1a 23 inc hl | |
2c1b 13 inc de | |
| // 0x8800 ... 0x8807 | |
2c1e 10 F5 djnz 0xf5 >-/ | // 8 Runden, 0x2c15
2c20 DD 22 07 83 ld (0x8307), ix | // 0x8807, sichere Zieladresse
2c24 ED 53 09 83 ld (0x8309), de | // Zeiger, sichere GTX-Adresse
2c28 2A 05 83 ld hl, (0x8305) | // HL = 0x0000, 0x0008, ...
2c2b 01 08 00 ld bc, 0x0008 |
2c2e 09 add hl, bc | // Zeiger HL + 0x08
2c2f 22 05 83 ld (0x8305), hl | // n+8 sichern
2c32 ED 5B 03 83 ld de, (0x8303) | // hole Zeiger DE; GL.ANZA1; Geheimtextlänge Anzahl 1
2c36 AF xor a | // Lösche A, Z-Flag = 1, carry-Flag = 0
2c37 ED 52 sbc hl, de | // Länge == -1
2c39 DA EF 2B jpc 0x2bef >-/ // Überlauf/Ungleich null
2c3c 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2c3f ED 4B 03 83 ld bc, (0x8303) // GL.ANZA1; Geheimtextlänge Anzahl 1
2c43 09 add hl, bc // Endadresse
2c44 22 A6 DC ld (0xdca6), hl // Speicher Adresse, für Auseinanderziehen
2c47 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2c4a 22 C4 DC ld (0xdcc4), hl // Startadresse auseinanderziehen
2c4d 2A A6 DC ld hl, (0xdca6) // doppelt gesicherte Endadresse
2c50 22 C2 DC ld (0xdcc2), hl // Endadresse Auseinanderziehen
2c53 CD 7F 2F call 0x2f7f // Auseinanderziehen Dechiffrieren, KT.ZA (0x8400); aus 8 Bit werden 6 Bit ASCII
2c56 2A C2 DC ld hl, (0xdcc2) // neue Endadresse Auseinanderziehen
2c59 22 A6 DC ld (0xdca6), hl // doppelt gesicherte Endadresse aktualisieren
2c5c 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2c5f 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
2c62 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
2c65 11 FF 03 ld de, 0x03ff // 1023 byte
2c68 19 add hl, de
2c69 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
2c6c 2A A6 DC ld hl, (0xdca6) // Endadresse Speicher: Text von Auseinanderziehen
2c6f 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
2c72 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2c73 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck lösche neues Zeichen
2c76 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
2c79 32 26 DC ld (0xdc26), a // ZUAN2:-Merkerstelle für Bedienermeldungen
2c7c 3E 02 ld a, 0x02 // Zustandszeiger = 2
2c7e 32 AB DC ld (0xdcab), a // Zustandszeiger MIRA/GO
2c81 32 01 DC ld (0xdc01), a // Betriebsartenregister: GT erstellen
2c84 3E 10 ld a, 0x10
2c86 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor
2c89 21 EC 87 ld hl, 0x87ec // Temporärer Speicherplatz
2c8c 36 00 ld (hl), 0x00
2c8e 11 ED 87 ld de, 0x87ed
2c91 01 13 00 ld bc, 0x0013 // Länge 19 byte; sichtbare Textlänge LCD
2c94 ED B0 ldir // Lösche (0x87ec) - (0x87ff) 0x13 bytes
2c96 CD 4A 09 call 0x094a // Textprozessor
2c99 21 00 88 ld hl, 0x8800 // Textspeicher empfangen
2c9c 22 A6 DC ld (0xdca6), hl
2c9f 01 FF 03 ld bc, 0x03ff // 1023 byte
2ca2 CD 5F 1B call 0x1b5f // Lösche Bereich; Übergabe HL, Länge BC
2ca5 3A 2F DC ld a, (0xdc2f) // ANZA1:-Länge KT-Chiff/Dechiff
2ca8 32 2E DC ld (0xdc2e), a // Steuerwort wiederherstellen nach Dechiffrierung!
2cab C3 BE 01 jp 0x01be // Menüprogramm
// RICHTIGE IV; JEDOCH KEIN GT (KONTROLLAUSSPRUNG)
2cae 3E 01 ld a, 0x01 // "BITTE WEITER"
2cb0 CD 9A 10 call 0x109a // Ausgabe LCD Meldung
2cb3 CD 2B 02 call 0x022b // ein Zeichen von der Tastatur
2cb6 3A 02 DC ld a, (0xdc02) // ALDAT:-Datenübergaberegister Tastatur
2cb9 FE 43 cp 0x43 // ENTER
2cbb 20 F6 jrnz 0xf6 // 0x2cb3, Tastendruck != "ENTER"
2cbd C3 BE 01 jp 0x01be // Menüprogramm
// Betriebsart Klartexterstellung
2cc0 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2cc1 32 2E DC ld (0xdc2e), a // Steuerwort 0x00
2cc4 3E 04 ld a, 0x04 // "TEXTERSTELLEN"
2cc6 CD 9A 10 call 0x109a // Ausgabe LCD Meldung
2cc9 CD 1C 02 call 0x021c // Zeit 1sec
2ccc 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2ccf 22 1B DC ld (0xdc1b), hl // ZADR:-Aktueller Zeiger-TextProzessor
2cd2 22 1F DC ld (0xdc1f), hl // AADRT:-Anfangsadresse Textspeicher
2cd5 11 FF 03 ld de, 0x03ff // Textlänge GO 1 kByte
2cd8 3A 00 DC ld a, (0xdc00) // Arbeitsspeicher,Hauptbetriebsart-1; GL.HBA
2cdb FE 01 cp 0x01 // MIRA
2cdd 20 03 jrnz 0x03 // Sprung HBA GO
2cdf 11 00 02 ld de, 0x0200 // Bei MIRA nur 1/2 kByte
2ce2 19 add hl, de // 0x8400 + Länge = 0x8600 oder 0x87ff
2ce3 22 21 DC ld (0xdc21), hl // EADRT:-Endadresse Textspeicher
2ce6 EB ex de, hl
2ce7 2A C6 DC ld hl, (0xdcc6) // GL.EAKTS
2cea 22 1D DC ld (0xdc1d), hl // EADR:-End-Zeiger-TextProzessor
2ced A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2cef ED 52 sbc hl, de // Länge == -1
2cf0 38 04 jrc 0x04 // 0x2f6
2cf2 ED 53 1D DC ld (0xdc1d), de // EADR:-End-Zeiger-TextProzessor
// Einsprung Länge == -1
2cf6 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2cf7 32 1A DC ld (0xdc1a), a // ZTP:Zustand TextProzessor Texteingabe
2cfa 32 03 DC ld (0xdc03), a // ZUALF:-Zustand Alpha-Tastendruck lösche neues Zeichen
2cfd 32 26 DC ld (0xdc26), a // ZUAN2:-Merkerstelle für Bedienermeldungen
2d00 32 27 DC ld (0xdc27), a // ZUAN3:-Einfügemode
2d03 32 01 DC ld (0xdc01), a // Betriebsartenregister: 0-KT erstellen
2d06 32 2A DC ld (0xdc2a), a // ALRC:-Adresse CRC-Wert Register
2d09 32 25 DC ld (0xdc25), a // ZUANZ:-Zustandsanzeige
2d0c 3E 01 ld a, 0x01 // Zustandszeiger = 1
2d0e 32 AB DC ld (0xdcab), a // Zustandszeiger MIRA/GO
2d11 21 EC 83 ld hl, 0x83ec
2d14 36 00 ld (hl), 0x00
2d16 11 ED 83 ld de, 0x83ed
2d19 01 13 00 ld bc, 0x0013 // Länge 19 byte
2d1c ED B0 ldir // Lösche (0x83ec) - (0x83ff) 19 bytes
2d1e CD 4A 09 call 0x094a // Textprozessor
2d21 21 10 5C ld hl, 0x5c10 // GTX Speicher senden (Add
2d24 01 FE 03 ld bc, 0x03fe // Länge 0x03fe
2d27 CD 5F 1B call 0x1b1f // CRC2 Berechnung und Prüfung, Übergabe HL Wertebereich, BC Länge, (0xdc2b) CRC für Prüfung; Rückgabe A 0 = io, 0xff = falsch
2d2a AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2d2b 32 2A DC ld (0xdc2a), a // ALRC:-Adresse CRC-Wert Register
2d2e 3E 02 ld a, 0x02 // "MOMENT BITTE"
2d30 CD 9A 10 call 0x109a // Ausgabe LCD Meldung
2d33 2A 1D DC ld hl, (0xdc1d) // EADR:-End-Zeiger-TextProzessor
2d36 22 C6 DC ld (0xdcc6), hl // GL.EAKTS
2d39 11 00 84 ld de, 0x8400 // Textspeicher; GL.KTSPS
2d3c A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2d3d ED 52 sbc hl, de // Länge == 0, Länge == -1
2d3f CA 7E 02 jpz 0x027e // Kein Text -> Enter -> Menüprogramm
2d42 DA DB 02 jpc 0x02db // BLOCKIERUNG 5
2d45 3E 23 ld a, 0x23 // DI, Zeitgeber, Vorteiler 256, neg. Flanke, RESET
2d47 D3 0B out (0x0b), a // CTC Kanal 3 Zeitgeber
2d49 DD 21 F6 3D ld ix, 0x3df6 // Zeiger CRC Check K-Box
2d4d FD 21 54 2D ld iy, 0x2d54 // Return-Trick Adresse 0x2d54 weiter nach PP
2d51 C3 8D 25 jp 0x258d // ROM-RAM Check, Übergabe IX + 0 & IX + 1 = Startbereich CRC , IX + 2 & IX + 3 Länge für CRC, IX + 4 & IX + 5 speichere CRC, BC Länge
2d54 C2 D3 02 jpnz 0x02d3 // BLOCKIERUNG 3, HALT
2d57 CD 5D 2D call 0x2d5d // Zusammenziehen Chiffrieren(0x8400); Rückgabe DE = (0xdcc6), 6 bit ASCII nach 8 bit
2d5a C3 D1 2D jp 0x2dd1 // weiter: Auffüllen zur Erreichung voller 5er Gruppen, Übergabe DE
// ZUSAMMENZIEHEN, 6 bit CCITT/ITA-2 nach 8 bit
// Übergabe (0xdcc6) Endadresse, die doppelt gespeicherte!
2d5d 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2d60 E5 push hl
2d61 D1 pop de // HL = DE = 0x8400
2d62 0E 01 ld c, 0x01 // Zustandszähler
// Einsprung; Schleife Zustandszähler a, c
2d64 79 ld a, c // Speicherung letzter Schritt; in der Schleife wird hier fortlaufend weitergezählt über "C"
2d65 0C inc c // nächster Schritt, Schleifenzähler
2d66 FE 02 cp 0x02 // a == 0x02
2d68 28 0D jrz 0x0d >-\ // ja springe, 0x2d77
2d6a FE 03 cp 0x03 | // a == 0x03
2d6c 28 1D jrz 0x1d >-\ | // ja springe, 0x2d8b
2d6e FE 04 cp 0x04 | | // a == 0x04
2d70 28 29 jrz 0x29 >-\ | | // ja springe, 0x2d9b
| | |
// Zustand 1 : vollständig übernehmen | | |
2d72 7E ld a, (hl) | | | // Zeichen aus 0x8400 ... holen
2d73 23 inc hl | | |
2d74 12 ld (de), a | | | // erstes Zeichen in 0x8400 + n ablegen
2d75 18 30 jr 0x30 >-\ | | | // 0x2da7; Endkontrolle
| | | |
// Zustand 2: 2 weg, 1 nach oben, Rest 4; C war == 0x02 |
2d77 1A ld a, (de) | | | <-/
2d78 CB 26 sla (hl) | | | // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0
2d7a CB 26 sla (hl) | | | // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0
2d7c CB 26 sla (hl) | | | // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0, carry = (HL bit5)
2d7e CB 17 rl a | | | // rotiere A, carry -> A0 -> A7 -> carry
2d80 CB 26 sla (hl) | | | // schiebe (HL), carry <- (HL.7) <- (HL.0) <- 0, carry = (HL bit4)
2d82 CB 17 rl a | | | // rotiere A, carry <- a7 <- a0 <- carry
2d84 12 ld (de), a | | | // (DE) = A; 0x8400 + n
2d85 13 inc de | | | // nächste Speicherstelle
2d86 7E ld a, (hl) | | | // hole nächsten 6 bit
2d87 23 inc hl | | | // neue Adresse
2d88 12 ld (de), a | | | // nächster Wert in 0x8400 + n abgelegt
2d89 18 1C jr 0x1c >-| | | // 0x2da7; Endkontrolle
| | |
// Zustand 3: 2 weg, 4 nach oben; C war == 0x03 | |
2d8b 1A ld a, (de) | | |
2d8c E6 F0 and 0xf0 | | <-/ // maskiere obere 4 bits
2d8e 46 ld b, (hl) | |
2d8f CB 38 srl b | | // schiebe B, 0 -> B7 -> B0 -> carry
2d91 CB 38 srl b | | // schiebe B, 0 -> B7 -> B0 -> carry, carry = B bit 1
2d93 B0 or b | | // A or B;
2d94 12 ld (de), a | |
2d95 13 inc de | |
2d96 7E ld a, (hl) | |
2d97 23 inc hl | |
2d98 12 ld (de), a | | // Ablegen im Speicher
2d99 18 0C jr 0x0c >-| | // 0x2da7; Endkontrolle
| |
// Zustand 4: alle Hoch; C war 0x04 | |
2d9b 1A ld a, (de) | <-/
2d9c 0F rrca | // rotieren A; A0 -> A7 -> A0 carry = A0
2d9d 0F rrca | // rotieren A; A0 -> A7 -> A0 carry = A0
2d9e E6 C0 and 0xc0 | // maskiere bits 7 und 6, hole nur bit 7 und 6 für das nächste byte
2da0 46 ld b, (hl) |
2da1 B0 or b | // A or B, 8 Informationsbit vollständig
2da2 12 ld (de), a |
2da3 13 inc de |
2da4 23 inc hl |
2da5 0E 01 ld c, 0x01 | // Schleifenvariable C wieder auf 1
// Endkontrolle |
2da7 D5 push de <-/ // rette DE in Stack
2da8 EB ex de, hl // tausche HL <> DE
2da9 2A C6 DC ld hl, (0xdcc6) // 0xdcc6 = GL.EAKTS; Endadresse
2dac A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2dad ED 52 sbc hl, de // Länge > 0
2daf EB ex de, hl // Rücktausch, Restlänge in DE
2db0 D1 pop de // Hole DE vom Stack
2db1 20 B1 jrnz 0xb1 // 0x2d64; Restlänge == 0 weiter, sonst Schleife 0x2d64
// Auffüllen bei Ende; C == 1 alles in Ordnung
2db3 0D dec c
2db4 28 16 jrz 0x16 // C == 0x00, 0x2dcc
2db6 0D dec c
2db7 20 06 jrnz 0x06 // C != 0x00, 0x2dbf
2db9 CB 27 sla a // schiebe A, carry <- A7 <- A0 <- 0
2dbb CB 27 sla a // schiebe A, carry <- A7 <- A0 <- 0, carry = A bit 6
2dbd 18 0B jr 0x0b // 0x2dca
// C = 3 : Hintere 4 auf 0; nicht 0x00
2dbf 0D dec c
2dc0 20 04 jrnz 0x04 // immer nocht nicht 0x00, 0x2dc6
2dc2 E6 F0 and 0xf0 // maskiere ober 4 bits
2dc4 18 04 jr 0x04 // 0x2dca
// C = 4 : 6 * rechts
2dc6 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
2dc7 0F rrca // rotieren A; A0 -> A7 -> A0 carry = A0
2dc8 E6 C0 and 0xc0 // 2 mal rotieren A7 -> A0 -> A7/Carry
// Einsprung Auffüllen C war 2
2dca 12 ld (de), a
2dcb 13 inc de
// Einsprung aus Auffüllen C war 1
2dcc ED 53 C6 DC ld (0xdcc6), de // GL.EAKTS; aktualisierte Endadress nach dem Zusammenziehen
2dd0 C9 ret
// Auffüllen zur Erreichung voller 5er Gruppen, Übergabe DE = (0xdcc6) Endadresse
2dd1 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2dd4 EB ex de, hl // DE 0x8400, HL Endardesse (0xdcc6)
2dd5 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2dd6 ED 52 sbc hl, de // Länge Text
2dd8 11 05 00 ld de, 0x0005
2ddb A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0
2ddc ED 52 sbc hl, de // -5 bis HL == 0x05 ist
2dde 28 12 jrz 0x12 // KEIN AUFFÜLLEN; differenz von 5 Zeichen/Länge == 0x00, 0x2df2
2de0 30 F9 jrnc 0xf9 // != 0x05, 0x2ddc, Textlänge durch 5 Teilbar?
2de2 19 add hl, de // +5
2de3 3E 05 ld a, 0x05
2de5 95 sub l // l - 5
2de6 47 ld b, a // b = 0x05, Schleifenzähler
2de7 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2de8 2A C6 DC ld a, (0xdcc6) // GL.EAKTS; Endadresse TxtSpeicher
2deb 77 ld (hl), a <-\ // (HL-5) = (0xdcc6); GL.EAKTS
2dec 23 inc hl | // ++HL
2ded 10 FC djnz 0xfc >-/ // 5 mal, 0x2dec
2def 22 C6 DC ld (0xdcc6), hl // GL.EAKTS
// Einsprung Länge teilbar durch 5
2df2 2A C6 DC ld hl, (0xdcc6) // GL.EAKTS, Endadresse TxtSpeicher
2df5 01 00 84 ld bc, 0x8400 // Textspeicher; GL.KTSPS
2df8 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2df9 ED 42 sbc hl, bc // Länge == 0, Länge == -1
2dfb CA 7E 02 jpz 0x027e // Kein Text -> Enter -> Menüprogramm
2dfe DA DB 02 jpc 0x02db // BLOCKIERUNG 5
2de1 22 03 83 ld (0x8303), hl // GL.ANZA1; Geheimtextlänge Anzahl 1; Länge des belegten TxtSpeichers
2de4 44 ld b, h
2de5 4D ld c, l // BC = HL = (0xdcc6) GL.EAKTS; Länge des belegten Txtspeichers
2de6 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2de9 CD 31 1B call 0x1b31 // CRC2-16 Schleife, Übergabe HL Adresse, BC Länge, Rückgabe CRC in DE
2deb ED 53 59 83 ld (0x8359), de // CRC in 0x8359 ablegen
2e10 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2e11 32 00 83 ld (0x8300), a // Aufrufzähler = 0x00
2e14 11 1B 83 ld de, 0x831b // Kopie Schlüssel 1
2e17 2A 81 DC ld hl, (0xdc81) // Schlüssel 1
2e1a 01 20 00 ld bc, 0x0020 // Länge 32 byte - 256 bit
2e1d ED B0 ldir // Kopiere von ((0xdc81)) > (0x831b)
2e1f 2A 83 DC ld hl, (0xdc83) // Zeiger Schlüssel 2
2e22 22 01 83 ld (0x8301), hl
2e25 21 1B 83 ld hl, 0x831b // Kopie Schlüssel 1
2e28 01 20 00 ld bc, 0x0020 // Länge 32 byte - 256 bit
2e2b CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2e2e FE FF cp 0xff // CRC Falsch
2e30 CA DB 02 jpz 0x02db // BLOCKIERUNG 5
2e33 21 1B 83 ld hl, 0x831b // Kopie Schlüssel 1
2e36 11 9E DE ld de, 0xde9e // Adresse für Schlüsselbearbeitung
2e39 01 08 00 ld bc, 0x0008 // Länge 64 bit
2e3c ED B0 ldir // Kopiere (0x831b) > (0xde9e) 8 byte, A = 0x00
2e3e CD 69 1B call 0x1b69 // Rundenschlüssel für Feistel, Übergabe A = 0x00, Schlüssel 0xde93 ... 0xdea5, Rückgabe 0xde00
2e41 11 0B 83 ld de, 0x830b // Zieladresse IV
2e44 21 77 DC ld hl, 0xdc77 // IV
2e47 01 08 00 ld bc, 0x0008 // Länge 64 bit
2e4a ED B0 ldir // Kopie (0xdc77) > (0x830b) 8 byte
2e4c 21 7F DC ld hl, 0xdc7f // CRCsy Länge 2; CRC der IV
2e4f 22 01 83 ld (0x8301), hl // Übergabe CRC für Check
2e52 21 0B 83 ld hl, 0x830b // Kopierte IV
2e55 01 08 00 ld bc, 0x0008 // Länge 64 bit
2e58 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2e5b FE FF cp 0xff // CRC falsch
2e5e CA DB 02 jpz 0x02db // BLOCKIERUNG 5
2e60 21 1C 5C ld hl, 0x5c1c // Adresse GTX Start
2e63 22 07 83 ld (0x8307), hl // in 0x8307
2e66 21 00 00 ld hl, 0x0000
2e69 22 05 83 ld (0x8305), hl
2e6c 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2e6f 22 09 83 ld (0x8309), hl
// Einsprung bis Textende erreicht
2e72 21 0B 83 ld hl, 0x830b <-\ // kopierte IV
2e75 11 96 DE ld de, 0xde96 |
2e78 01 08 00 ld bc, 0x0008 | // Länge 64 bit
2e7b ED B0 ldir | // kopiere (0x830b) > (0xde96) 8 bytes
2e7d CD 3D 1C call 0x1c3d | // Feistel vorwärts, Übergabe/Rückgabe 0xde96
2e80 21 96 DE ld hl, 0xde96 | // Berechnerte Wurmfolgen
2e83 11 0B 83 ld de, 0x830b | // chiffr. IV
2e86 01 08 00 ld bc, 0x0008 | // Länge 64 bit
2e89 ED B0 ldir | // kopiere 0xde96 > 0x830b 8 bytes
2e8b 21 0B 83 ld hl, 0x830b | // chiffr. IV
2e8e ED 5B 09 83 ld de, (0x8309) | // Klartext aus 0x8400; GL.KTSPS
2e92 DD 2A 07 83 ld ix, (0x8307) | // Zieladresse, 0x5c1c
2e96 06 08 ld b, 0x08 | // Schleife 8 Runden
2e98 1A ld a, (de) <-\ |
2e99 AE xor (hl) | | // Chiffriert
2e9a DD 77 00 ld (ix + 0x00), a | | // (IX + n) = (DE + n) xor (HL + n); n = 0 - 7
2e9d 23 inc hl | | // n = 0 ... 7
2e9e 13 inc de | |
2e9f DD 23 inc ix | | // 0x5c1c + 8, 0x5c1c ... 0x5c23
2ea1 10 F5 djnz 0xf5 >-/ | // 8 bytes verknüpft in ix abgelegt
2ea3 DD 22 07 83 ld (0x8307), ix | // 0x5c1c ++
2ea7 CD 58 1F call 0x1f58 | // Kontroll-Chiffrierung, Übergabe IX, Rückgabe A 0x00 OK, A 0xff Fehler
2eaa 2A 09 83 ld hl, (0x8309) | // Zeiger auf 0x8400
2ead 11 33 DC ld de, 0xdc33 | // SPAD1:-Zieladresse/chiff/dechiff
2eb0 06 08 ld b, 0x08 | // Schleife 8 Runden - 64bit
2eb2 1A ld a, (de) <-\ |
2eb3 AE xor (hl) | | // (DE) XOR (HL), Kontrolle Chiffrate ==
2eb4 C2 DB 02 jpnz 0x02db | | // BLOCKIERUNG 5
2eb7 23 inc hl | |
2eb8 13 inc de | |
2eb9 10 F7 djnz 0xf7 >-/ | // 8 bytes geprüft
2ebb 22 09 83 ld (0x8309), hl | // (0x8309) +8
2ebe 2A 05 83 ld hl, (0x8305) | // Zeiger auf ?, Länge des Textes
2ec1 01 08 00 ld bc, 0x0008 | // Länge 8 byte
2ec4 09 add hl, bc |
2ec5 22 05 83 ld (0x8305), hl | // Zeiger auf ?, Neue Adresse des Textes
2ec8 ED 5B 03 83 ld de, (0x8303) | // GL.ANZA1; Geheimtextlänge Anzahl 1
2ecc AF xor a | // Lösche A, Z-Flag = 1, carry-Flag = 0
2ecd ED 52 sbc hl, de | // Länge > -1
2ecf 30 0A jrnc 0x0a | >-\ // 0x2edb -> Textende
2ed1 3A 3B DC ld a, 0xdc3b | |
2ed4 B7 or a | | // A == 0?
2ed5 C2 DB 02 jpnz 0x02db | | // BLOCKIERUNG 5
2ed8 C3 72 2E jp 0x2e72 >-/ | // weiter Ergebnis der chiff. IV Aufruf Algorithmus bis Textende
// Einsprung Textende |
2edb 3A 3B DC ld a, (0xdc3b) <-/
2ede FE FF cp 0xff
2ee0 C2 DB 02 jpnz 0x02db // BLOCKIERUNG 5
2ee3 21 1C 5C ld hl, 0x5c1c // GTX Startadresse
2ee6 ED 4B 03 83 ld bc, (0x8303) // GL.ANZA1; Geheimtextlänge Anzahl 1
2eea 09 add hl, bc // End-Adresse GTX
2eeb 22 D2 DC ld (0xdcd2), hl
2eee 21 1C 5C ld hl, 0x5c1c // GTX Startadresse
2ef1 CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
2ef4 21 40 95 ld hl, 0x9540 // Ablageort CRC
2ef7 72 ld (hl), d // D aus CRC
2ef8 23 inc hl
2ef9 73 ld (hl), e // CRC (0x9540)
2efa 21 7F DC ld hl, 0xdc74
2efd 22 01 83 ld (0x8301), hl // Zeiger auf 0xdc74
2f00 21 77 DC ld hl, 0xdc77 // IV
2f03 01 08 00 ld bc, 0x0008 // Länge 8 byte
2f06 CD 9F 28 call 0x289f // CRC1 Check, Übergabe HL Start, BC Länge, (0x8301) CRC, Rückgabe A ok = 0, Falsch = 0xff
2f09 FE FF cp 0xff // Error
2f0b CA DB 02 jpz 0x02db // BLOCKIERUNG 5
2f0e 11 10 5C ld de, 0x5c10 // CRC OK, GTX Speicher senden (Add
2f11 21 77 DC ld hl, 0xdc77 // IV
2f14 01 08 00 ld bc, 0x0008 // Länge 8 byte
2f17 ED B0 ldir // kopiere (0xdc77) > (0x5c10), 8 bytes; GTX Speicher senden (Add
2f19 21 7F DC ld hl, 0xdc7f // CRCsy Länge 2; CRC der IV
2f1c 01 02 00 ld bc, 0x0002 // Länge, DE = 0x5c18
2f1f ED B0 ldir // kopiere (0xdc7f) > (0x5c18) 2 bytes
2f21 2A 03 83 ld hl, (0x8303) // GL.ANZA1; Geheimtextlänge Anzahl 1
2f24 23 inc hl
2f25 23 inc hl // wg. CRC -Wert
2f26 11 1A 5C ld de, 0x5c1a // Nach CRC Textlänge ablegen
2f29 7C ld a, h
2f2a 12 ld (de), a
2f2b 13 inc de // de = 0x5c1b
2f2c 7D ld a, l
2f2d 12 ld (de), a
2f2e 2A D2 DC ld hl, (0xdcd2)
2f31 06 14 ld b, 0x14 // Schleife 20 Runden
// Schleife
2f33 36 00 ld (hl), 0x00 <-\ // (HL) Löschen
2f35 23 inc hl |
2f36 10 FB djnz 0xfb >-/ // 0x2f33, Lösche (HL) + n
2f38 ED 4B 03 83 ld bc, (0x8303) // GL.ANZA1; Geheimtextlänge Anzahl 1
2f3c 21 1C 5C ld hl, 0x5c1c // CRC des GTX
2f3f CD B9 25 call 0x25b9 // Berechne CRC1, HL Startadresse, BC Länge, Rückgabe DE
2f42 2A D2 DC ld hl, (0xdcd2)
2f45 72 ld (hl), d // Ablage CRC D-Teil
2f46 23 inc hl
2f47 73 ld (hl), e // Prüfsumme in (0xdcd2, 0xdcd3)
2f48 23 inc hl
2f49 22 D2 DC ld (0xdcd2), hl // Zeiger auf CRC
2f4c 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2f4f 22 C4 DC ld (0xdcc4), hl // Zeiger auf 0x8400; Anfangsadresse Auseinanderziehen
2f52 2A C6 DC ld hl, (0xdcc6) // GL.EAKTS; doppelt gesicherte Endadresse
2f55 22 C2 DC ld (0xdcc2), hl // Zufallsfolge BITZ:-Bitzähler; Endadresse Auseinanderziehen
2f58 CD 7F 2F call 0x2f7f // Auseinanderziehen KontrollChiff., KT.ZA (0x8400); aus 8 Bit werden 6 Bit ASCII
2f5b 2A C2 DC ld hl, (0xdcc2) // Zufallsfolge BITZ:-Bitzähler; neue Endadresse Auseinanderziehen
2f5e 22 C6 DC ld (0xdcc6), hl // GL.EAKTS; doppelt gesicherte Endadresse aktualisieren
2f61 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2f62 32 2E DC ld (0xdc2e), a // Steuerwort 0x00
2f65 CD 4A 02 call 0x024a // CTC Kanal 3 Einschalten Tastatur CTC
2f68 C3 BE 01 jp 0x01be // Menüprogramm
// Lösche Sende-Empf.-Textspeicher, wird wo aufgerufen?
2f6b 21 F0 83 ld hl, 0x83f0 // GL.KTSPS-16
2f6e E5 push hl
2f6f D1 pop de // DE = HL = 0x83f0
2f70 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
2f71 13 inc de // DE = 0x83f1
2f72 77 ld (hl), a // (0x83f0) = 0x00
2f73 01 0E 04 ld bc, 0x040e // Länge
2f76 ED B0 ldir // lösche mit 0x00, (0x83f0 - 0x87ff)
2f78 21 00 84 ld hl, 0x8400 // Textspeicher; GL.KTSPS
2f7b 22 C6 DC ld (0xdcc6), hl // GL.EAKTS
2f7e C9 ret
// Auseinanderziehen; aus 8 Bit werden 6 Bit CCITT/ITA-2
// Input GL.SPAZ : Anfangsadresse KT; DE (0xdcc4)
// GL.EAAZ : Endadresse KT; HL (0xdcc2)
// Output GL.EAAZ : neue Endadresse KT
2f7f 2A C2 DC ld hl, (0xdcc2) // GL.EAAZ Endadresse Text
2f82 ED 5B C4 DC ld de, (0xdcc4) // GL.SPAZ Anfangsadresse Text
2f86 A7 and a // carry-Flag = 0, Z-Flag 1 bei A == 0; GL.EAAZ
2f87 ED 52 sbc hl, de // Länge > 5, < 1024
2f89 11 03 00 ld de, 0x0003 // Division durch 3
2f8c 01 00 00 ld bc, 0x0000 // BC Substraktionsrunden
2f8f 03 inc bc <-\ // Schleife bis carry == 1
2f90 A7 and a | // carry-Flag = 0, Z-Flag 1 bei A == 0
2f91 ED 52 sbc hl, de | // Länge > -1
2f93 30 FA jrnc 0xfa >-/ // 0x2f8f; Kein Übertrag
2f95 0B dec bc // Anzahl; Länge / 3
2f96 EB ex de, hl // Übertrag, Rette HL in DE
2f97 C5 push bc // DE = HL, HL Wird verworfen
2f98 E1 pop hl // HL = BC
2f99 29 add hl, hl
2f9a 29 add hl, hl // HL * 4
2f9b 7B ld a, e // E niederwertiger Teil der Länge
2f9c FE FD cp 0xfd // E == 0xfd, 0xfe, Negativer ungerade Übertrag
2f9e 28 06 jrz 0x06 >---\ // -3; 0x2fa6, e == 0xfd? Ja -Sprung
2fa0 FE FE cp 0xfe | // -2;
2fa2 28 01 jrz 0x01 >---\ | // 0x2fa5, e == 0xfe? Ja -Sprung
// negativer Übertrag -2 ausgleichen | |
2fa4 23 inc hl | | // +1;
// Negativer Übertrag -1 ausgleichen | |
2fa5 23 inc hl <---/ | // +1; Korrekturwert
// Einsprung -3 |
2fa6 ED 5B C4 DC ld de, (0xdcc4) <---/ // DE = Anfangsadresse: 0x8400, 0x8800; Chiffrieren - Dechiffrieren
2faa 19 add hl, de // neue Endadresse, berechnet
2fab EB ex de, hl // HL in DE sichern
2fac 2A C2 DC ld hl, (0xdcc2) // HL = aus Übergabe Zeiger 0xdca6, 0xdcc6
2faf EB ex de ,hl // Rücktausch; HL = Länge + 0x8400 oder 0x8800; DE = Zeiger 0xdca6 oder 0xdcc6
2fb0 22 C2 DC ld (0xdcc2), hl // Zeiger 0xdcc2 mit Länge + 0x8400 oder 0x8800 kopieren
2fb3 2B dec hl // Neue Endadresse
2fb4 1B ld a, (de) // A = (0xdca6 oder 0xdcc6)
2fb5 D5 push de
2fb6 DD E1 pop ix // IX Quelle; IX = Zeiger DE (Endadresse) sichern
2fb8 ED 44 neg // Zähler 1...3,(4); 2kompliment von a; |a| = -a = a
// Länge <> 0; weiter auseinanderziehen
2fba FE 03 cp 0x03 <---\ // hintere 6 zuerst
2fbc 20 0B jrnz 0x0b >---\ | // 0x2fc9 a == 0x03? Nein Sprung
2fbe DD 56 00 ld d, (ix + 0x00) | | // Auseinanderziehen von der letzten Stelle beginnend zur ersten Stelle.
2fc1 CB BA res 7, d | | // IX Zeiger auf Endadresse
2fc3 CB B2 res 6, d | | // Lösche bit 6 und 7, enspricht 0x3f AND D, Wert >= 0x3f!
2fc5 72 ld (hl), d | | // ablegen in neue Endadresse
2fc6 2B dec hl | | // Zeiger auf nächste vorherige Adresse
2fc7 18 43 jr 0x43 | >---\ | // 0x300c
// Einsprung a <> 0x03 | | |
2fc9 FE 04 cp 0x04 <---/ | | // vordere 2, hintere 4
2fcb 20 18 jrnz 0x18 >---\ | | // 0x2fe5, a == 0x04? Nein Sprung
2fcd DD 56 00 ld d, (ix + 0x00) | | |
2fd0 DD 2B dec ix | | |
2fd2 DD 5E 00 ld e, (ix + 0x00) | | | // DE 16 bit 2mal rotieren
2fd5 CB 22 sla d | | | // schiebe D, carry < D7 < D0 < 0
2fd7 CB 13 rl e | | | // rotiere E, carry < E7 < E0 < carry von D7
2fd9 CB 22 sla d | | | // schiebe D, carry < D7 < D0 < 0
2fdb CB 13 rl e | | | // rotiere E, carry < E7 < E0 < carry von D7
2fdd CB BB res 7, e | | |
2fdf CB B3 res 6, e | | | // Lösche bit 6 und 7, enspricht 0x3f AND E, Wert => 0x3f!
2fe1 73 ld (hl), e | | |
2fe2 2B dec hl | | |
2fe3 18 27 jr 0x27 | >---+ | // 0x300c
// Einsprung a <> 0x04 | | |
2fe5 FE 01 cp 0x01 <---/ | | // vordere 4, hintere 2
2fe7 20 18 jrnz 0x18 >---\ | | // 0x3001, A == 0x01? Nein Sprung
2fe9 DD 56 00 ld d, (ix + 0x00) | | |
2fec DD 2B dec ix | | |
2fee DD 5E 00 ld e, (ix + 0x00) | | | // DE 16 bit rotieren über carry
2ff1 CB 1B rr e | | | // rotiere E, carry > E7 > E0 > carry > E7
2ff3 CB 1A rr d | | | // rotiere D, carry > D7 > D0 > carry > D7
2ff5 CB 1B rr e | | | // rotiere E, carry > E7 > E0 > carry > E7
2ff7 CB 1A rr d | | | // rotiere D, carry > D7 > D0 > carry > D7
2ff9 CB 3A srl d | | | // schiebe D, 0 > D7 > D0 > carry
2ffb CB 3A srl d | | | // schiebe D, 0 > D7 > D0 > carry, carry = D bit 1
2ffd 72 ld (hl), d | | | // Lösche bit 6 und 7, enspricht 0x3f AND E, Wert => 0x3f!
2ffe 2B dec hl | | |
2fff 18 0B jr 0x0b | >-+ | // 0x300c
// Einsprung a <> 0x01 | | |
3001 DD 56 00 ld d, (ix + 0x00) <-/ | | // vordere, die ersten, 6
3004 DD 2B dec ix | |
3006 CB 3A slr d | | // schiebe D, 0 > D7 > D0 > carray
3008 CB 3A slr d | | // Lösche bit 6 und 7, entspricht 0x3f AND E, Wert => 0x3f!
300a 72 ld (hl), d | | // Speichern in Adresse 0x85xx neue Endadresse
300b 2B dec hl | | // Rückwärts bis 0x8500
// Einsprung Test a = 4, 3, 1, Teste A = 5 | |
300c 3C inc a <---/ | // Schleifen-Berechnung
300d FE 05 cp 0x05 | //
300f 20 02 jrnz 0x02 >---\ | // 0x3013, A == 0x05 ja dann A = 1 sonst weiter
3011 3E 01 ld a, 0x01 | |
// Einsprung a <> 0x05 | |
3013 ED 5B C4 DC ld de, (0xdcc4) <--/ | // Lade aus Übergabe: 0x8400, 0x8800
3017 1B dec de |
3018 A7 and a | // carry-Flag = 0, Z-Flag 1 bei A == 0
3019 EB ex de, hl | // Retten DE
301a ED 52 sbc hl, de | // Länge
301c EB ex de, hl | // Länge in DE
301d C2 BA 2F jpnz 0x2fba >---/ // Subtraktion Länge != 0x00 ja Weiter auseinanderziehen
3020 C9 ret // Länge == 0, Schleifenende Auseinanderziehen
// Aufruf von PP, Kaltstart
3021 21 00 00 ld hl, 0x0000
3024 22 00 81 ld (0x8100), hl // Variablenspeicher
3027 3E 55 ld a, 0x55
3029 FE 55 cp 0x55
302b CA 32 30 jpz 0x3032
302e C3 F6 3B jp 0x3bf6 // DI - HALT
3031 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3032 FE AA cp 0xaa
3034 C2 3B 30 jpnz 0x303b
3037 C3 F6 3B jp 0x3bf6 // DI - HALT
303a F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
303b 32 09 81 ld (0x8109), a
303d 3E 00 ld a, 0x00
3040 3A 09 81 ld a, (0x8109)
3043 FE 55 cp 0x55
3045 CA 4C 30 jpz 0x304c
3048 C3 F6 3B jp 0x3bf6 // DI - HALT
304b F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
304c C3 53 30 jp 0x3053
304f C3 F6 3B jp 0x3bf6 // DI - HALT
3052 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3053 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3056 23 inc hl
3057 22 00 81 ld (0x8100), hl // Variablenspeicher
305a 3E 00 ld a, 0x00
305c C6 55 add a, 0x55
305e C2 65 30 jpnz 0x3065
3061 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3064 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3065 D2 5C 30 jpnc 0x305c
3068 C6 AA add a, 0xaa
306a FE FE cp 0xfe
306c C2 FA 3B jpnz 0x3bfa // Sperre Int - HALT
306f C6 02 add a, 0x02
3071 CA 78 30 jpz 0x3078
3074 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3077 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3078 2A 00 81 ld hl, (0x8100) // Variablenspeicher
307b 23 inc hl
307c 22 00 81 ld (0x8100), hl // Variablenspeicher
307f 3E 03 ld a, 0x03
3081 FE 00 cp 0x00
3083 21 09 81 ld hl, 0x8109
3086 3E 00 ld a, 0x00
3088 77 ld (hl), a
3089 3E FF ld a, 0xff
308b 7E ld a, (hl)
308c FE 00 cp 0x00
308e CA 95 30 jpz 0x3095
3091 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3094 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3095 3E FF ld a, 0xff
3097 77 ld (hl), a
3098 3E 00 ld a, 0x00
309a 7E ld a, (hl)
309b FE FF cp 0xff
309d CA A4 30 jpz 0x30a4
30a0 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30a3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30a4 3E 55 ld a, 0x55
30a6 77 ld (hl), a
30a7 3E 00 ld a, 0x00
30a9 7E ld a, (hl)
30aa FE 55 cp 0x55
30ac CA B3 30 jpz 0x30b3
30af C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30b2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30b3 3E AA ld a, 0xaa
30b5 77 ld (hl), a
30b6 3E 00 ld a, 0x00
30b8 7E ld a, (hl)
30b9 FE AA cp 0xaa
30bb CA C2 30 jpz 0x30c2
30be C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30c1 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30c2 2A 00 81 ld hl, (0x8100) // Variablenspeicher
30c5 23 inc hl
30c6 22 00 81 ld (0x8100), hl // Variablenspeicher
30c9 3E 03 ld a, 0x03
30cb FE 00 cp 0x00
30cd 21 00 00 ld hl, 0x0000
30d0 11 00 00 ld de, 0x0000
30d3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
30d4 ED 52 sbc hl, de // == 0
30d6 CA DD 30 jpz 0x30dd
30d9 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30dc F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30dd 21 FF FF ld hl, 0xffff
30e0 11 FF FF ld de, 0xffff
30e3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
30e4 ED 52 sbc hl, de // > 0
30e6 CA ED 30 jpnz 0x30ed
30e9 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30ec F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30ed 21 AA AA ld hl, 0xaaaa
30f0 11 AA AA ld de, 0xaaaa
30f3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
30f4 ED 52 sbc hl, de // > 0
30f6 CA FD 30 jpnz 0x30fd
30f9 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
30fc F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
30fd 21 55 55 ld hl, 0x5555
3100 11 55 55 ld de, 0x5555
3103 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3104 ED 52 sbc hl, de // > 0
3106 CA 0D 31 jpnz 0x310d
3109 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
310c F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
310d 21 FF FF ld hl, 0xffff
3110 11 AA AA ld de, 0xffff
3113 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3114 ED 52 sbc hl, de // > -1
3116 D2 1D 31 jpnc 0x311d
3119 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
311c F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
311d 21 55 55 ld hl, 0x5555
3120 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3121 ED 52 sbc hl, de // > -1
3123 DA 2A 31 jpc 0x312a
3126 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3129 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
312a 2A 00 81 ld hl, (0x8100) // Variablenspeicher
312d 23 inc hl
312e 22 00 81 ld (0x8100), hl // Variablenspeicher
3131 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3132 FE 03 cp 0x03
3134 26 00 ld h, 0x00
3136 3E FF ld a, 0xff
3138 7C ld a, h
3139 FE 00 cp 0x00
313b CA 42 31 jpz 0x3142
313e C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3141 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3142 26 FF ld h, 0xff
3144 3E 00 ld a, 0x00
3146 7C ld a, h
3147 FE FF cp 0xff
3149 CA 50 31 jpz 0x3150
314c C3 FA 3B jp 0x3bfa // Sperre Int - HALT
314f F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3150 26 55 ld h, 0x55
3152 3E 00 ld a, 0x00
3154 7C ld a, h
3155 FE 55 cp 0x55
3157 CA 5E 31 jpz 0x315e
315a C3 FA 3B jp 0x3bfa // Sperre Int - HALT
315d F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
315e 26 AA ld h, 0xaa
3160 3E 00 ld a, 0x00
3162 7C ld a, h
3163 FE AA cp 0xaa
3165 CA 6C 31 jpz 0x316c
3168 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
316b F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
316c 2A 00 81 ld hl, (0x8100) // Variablenspeicher
316f 23 inc hl
3170 22 00 81 ld (0x8100), hl // Variablenspeicher
3173 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3174 2E 00 ld l, 0x00
3176 3E FF ld a, 0xff
3178 7D ld a, l
3179 FE 00 cp 0x00
317b CA 82 31 jpz 0x3182
317e C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3181 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3182 2E FF ld l, 0xff
3184 3E 00 ld a, 0x00
3186 7D ld a, l
3187 FE FF cp 0xff
3189 CA 90 31 jpz 0x3190
318c C3 FA 3B jp 0x3bfa // Sperre Int - HALT
318f F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3190 2E 55 ld l, 0x55
3192 3E 00 ld a, 0x00
3194 7D ld a, l
3195 FE 55 cp 0x55
3197 CA 9E 31 jpz 0x319e
319a C3 FA 3B jp 0x3bfa // Sperre Int - HALT
319d F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
319e 2E AA ld l, 0xaa
31a0 3E 00 ld a, 0x00
31a2 7D ld a, l
31a3 FE AA cp 0xaa
31a5 CA AC 31 jpz 0x31ac
31a8 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
31ab F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
31ac 2A 00 81 ld hl, (0x8100) // Variablenspeicher
31af 23 inc hl
31b0 22 00 81 ld (0x8100), hl // Variablenspeicher
31b3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
31b4 FE 03 cp 0x03
31b6 3E 00 ld a, 0x00
31b8 6F ld l, a
31b9 3E FF ld a, 0xff
31bb 7D ld a, l
31bc FE 00 cp 0x00
31be CA C5 31 jpz 0x31c5
31c1 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
31c4 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
31c5 3E FF ld a, 0xff
31c7 6F ld l, a
31c8 3E 00 ld a, 0x00
31ca 7D ld l, a
31cb FE FF cp 0xff
31cd CA D4 31 jpz 0x31d4
31d0 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
31d3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
31d4 3E AA ld a, 0xaa
31d6 6F ld l, a
31d7 3E 00 ld a, 0x00
31d9 7D ld a, l
31da FE AA cp 0xaa
31dc CA E3 31 jpz 0x31e3
31df C3 FA 3B jp 0x3bfa // Sperre Int - HALT
31e2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
31e3 3E 55 ld a, 0x55
31e5 6F ld l, a
31e6 3E 00 ld a, 0x00
31e8 7D ld a, l
31e9 FE 55 cp 0x55
31eb CA F2 31 jpz 0x31f2
31ee C3 FA 3B jp 0x3bfa // Sperre Int - HALT
31f1 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
31f2 2A 00 81 ld hl, (0x8100) // Variablenspeicher
31f5 23 inc hl
31f6 22 00 81 ld (0x8100), hl // Variablenspeicher
31f9 21 00 00 ld hl, 0x0000
31fb 11 FF FF ld de, 0xffff
31ff EB ex de, hl
3200 7D ld a, l
3201 FE FF cp 0xff
3203 CA 0A 32 jpz 0x320a
3206 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3209 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
320a 7C ld a, h
320b FE FF cp 0xff
320d CA 14 32 jpz 0x3214
3210 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3213 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3214 21 55 55 ld hl, 0x5555
3217 11 AA AA ld de, 0xaaaa
321a EB ex de, hl
321b 7D ld a, l
321c FE AA cp 0xaa
321e CA 25 32 jpz 0x3225
3221 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3224 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3225 7C ld a, h
3226 FE AA cp 0xaa
3228 CA 2F 32 jpz 0x322f
322b C3 FA 3B jp 0x3bfa // Sperre Int - HALT
322e F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
322f 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3232 23 inc hl
3233 22 00 81 ld (0x8100), hl // Variablenspeicher
3236 21 09 81 ld hl, 0x8109
3239 3E 01 ld a, 0x01
// Einsprung
323b 77 ld (hl), a
323c BE cp (hl)
323d CA 44 32 jpz 0x3244 // PP
3240 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3243 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3244 FE 00 cp 0x00
3246 CA 4E 32 jpz 0x324e // Weiter
3249 C6 01 add a, 0x01
324b C3 3B 32 jp 0x323b // Springe zurück - Zähler noch nicht 0x00
// weiter
324e 77 ld (hl), a
324f C6 01 add a, 0x01
3251 BE cp (hl)
3252 C2 59 32 jpnz 0x3259
3255 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3258 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3259 FE 00 cp 0x00
325a CA 61 32 jpz 0x3261 // Weiter
325e C3 4E 32 jp 0x324e // Zähler noch nicht 0x00
// weiter
3261 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3264 23 inc hl
3265 22 00 81 ld (0x8100), hl // Variablenspeicher
3268 21 09 81 ld hl, 0x8109
326b 3E FF ld a, 0xff
326d 3D dec a
326e 77 ld (hl), a
326f C6 01 add a, 0x01
3271 D6 01 sub 0x01
3273 BE cp (hl)
3274 CA 7B 32 jpz 0x327b
3277 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
327a F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
327b FE 00 cp 0x00
327d C2 6D 32 jpnz 0x326d // Zähler noch nicht 0x00
3280 C3 87 32 jp 0x3287 // Weiter
3283 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3286 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3287 2A 00 81 ld hl, (0x8100) // Variablenspeicher
328a 23 inc hl
328b 22 00 81 ld (0x8100), hl // Variablenspeicher
328e 21 00 00 ld hl, 0x0000
3291 22 0A 81 ld (0x810a), hl
3294 21 FF FF ld hl, 0xffff
3297 2A 0A 81 ld hl, (0x810a)
329a 11 00 00 ld de, 0x0000
329d AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
329e ED 52 sbc hl, de // == 0
32a0 CA A7 32 jpz 0x32a7 // Weiter
32a3 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
32a6 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
32a7 21 FF FF ld hl, 0xffff
32aa 22 0A 81 ld (0x810a), hl
32ad 21 00 00 ld hl, 0x0000
32b0 2A 0A 81 ld hl, (0x810a)
32b3 11 FF FF ld de, 0xffff
32b6 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
32b7 ED 52 sbc hl, de // == 0
32b9 CA C0 32 jpz 0x32c0 // Weiter
32bc C3 FA 3B jp 0x3bfa // Sperre Int - HALT
32bf F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
32c0 21 55 55 ld hl, 0x5555
32c3 22 0A 81 ld (0x810a), hl
32c6 21 00 00 ld hl, 0x0000
32c9 2A 0A 81 ld hl, (0x810a)
32cc 11 55 55 ld de, 0x5555
32cf AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
32d0 ED 52 sbc hl, de // == 0
32d2 CA D9 32 jpz 0x32d9 // Weiter
32d5 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
32d8 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
32d9 21 AA AA ld hl, 0xaaaa
32dc 22 0A 81 ld (0x810a), hl
32df 21 00 00 ld hl, 0x0000
32e2 2A 0A 81 ld hl, (0x810a)
32e5 11 AA AA ld de, 0xaaaa
32e8 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
32e9 ED 52 sbc hl, de // == 0
32eb CA F2 32 jpz 0x32f2 // Weiter
32ee C3 FA 3B jp 0x3bfa // Sperre Int - HALT
32f1 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
32f2 2A 00 81 ld hl, (0x8100) // Variablenspeicher
32f5 23 inc hl
32f6 22 00 81 ld (0x8100), hl // Variablenspeicher
32f9 11 00 00 ld de, 0x0000
32fc ED 53 0A 81 ld (0x810a), de
3300 11 FF FF ld de, 0xffff
3303 ED 5B 0A 81 ld de, (0x810a)
3307 21 00 00 ld hl, 0x0000
330a AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
330b ED 52 sbc hl, de // == 0
330d CA 14 33 jpz 0x3314 // Weiter
3310 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3313 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3314 11 FF FF ld de, 0xffff
3317 ED 53 0A 81 ld (0x810a), de
331b 11 00 00 ld de, 0x0000
331e ED 5B 0A 81 ld de, (0x810a)
3322 21 FF FF ld hl, 0xffff
3325 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3326 ED 52 sbc hl, de // == 0
3328 CA 2F 33 jpz 0x332f // Weiter
332b C3 FA 3B jp 0x3bfa // Sperre Int - HALT
332e F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
332f 11 55 55 ld de, 0x5555
3332 ED 53 0A 81 ld (0x810a), de
3336 11 00 00 ld de, 0x0000
3339 ED 5B 0A 81 ld de, (0x810a)
333d 21 55 55 ld hl, 0x5555
3340 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3341 ED 52 sbc hl, de // == 0
3343 CA 4A 33 jpz 0x334a // Weiter
3346 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3349 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
334a 11 AA AA ld de, 0xaaaa
334d ED 53 0A 81 ld (0x810a), de
3351 11 00 00 ld de 0x0000
3354 ED 5B 0A 81 ld de, (0x810a)
3358 21 AA AA ld hl, 0xaaaa
335b AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
335c ED 52 sbc hl, de // == 0
335e CA 65 33 jpz 0x3365 // Weiter
3361 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3364 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3365 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3368 23 inc hl
3369 22 00 81 ld (0x8100), hl // Variablenspeicher
336c 21 00 00 ld hl, 0x0000
336f 11 01 00 ld de, 0x0001
3372 23 inc hl
3373 22 03 81 ld (0x8103), hl
3376 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3377 ED 52 sbc hl, de // == 0
3379 CA 80 33 jpz 0x3380 // Weiter
337c C3 FA 3B jp 0x3bfa // Sperre Int - HALT
337f F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3380 2A 03 81 ld hl, (0x8103)
3383 23 inc hl
3384 EB ex de, hl
3385 7C ld a, h
3386 FE 02 cp 0x02
3388 C2 72 33 jpnz 0x3372 // Zähler <> 0x02
338b C3 92 33 jp 0x3392 // Weiter
338e C3 FA 3B jp 0x3bfa // Sperre Int - HALT
3391 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3392 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3395 23 inc hl
3396 22 00 81 ld (0x8100), hl // Variablenspeicher
3399 21 01 00 ld hl, 0x0001
339c 11 00 00 ld de, 0x0000
339f 13 inc de
33a0 22 03 81 ld (0x8103), hl
33a3 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
33a4 ED 52 sbc hl, de // == 0
33a6 CA AD 33 jpz 0x33ad // Weiter
33a9 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
33ac F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
33ad 2A 03 81 ld hl, (0x8103)
33b0 23 inc hl
33b1 7C ld a, h
33b2 FE 02 cp 0x02
33b4 C2 9F 33 jpnz 0x339f // Zähler <> 0x02
33b7 C3 BE 33 jp 0x33be // Weiter
33ba C3 FA 3B jp 0x3bfa // Sperre Int - HALT
33bd F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
33be 2A 00 81 ld hl, (0x8100) // Variablenbereich
33c1 23 inc hl
33c2 22 00 81 ld (0x8100), hl // Variablenspeicher
33c5 DD 21 00 00 ld ix, 0x0000
33c9 21 01 00 ld hl, 0x0001
33cc DD 23 inc ix
33ce DD 22 0A 81 ld (0x810a), ix // 0x0001 ...
33d2 ED 5B 0A 81 ld de, (0x810a)
33d6 22 03 81 ld (0x8103), de
33d9 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
33da ED 52 sbc hl, de // == 0
33dc CA E3 33 jpz 0x33e3 // Weiter
33df C3 FA 3B jp 0x3bfa // Sperre Int - HALT
33e2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
33e3 2A 03 81 ld hl, (0x8103)
33e6 23 inc hl
33e7 7C ld a, h
33e8 FE 02 cp 0x02
33ea C2 CC 33 jpnz 0x33cc // Zähler <> 0x02
33ed C3 F4 33 jp 0x33f4 // Weiter
33f0 C3 FA 3B jp 0x3bfa // Sperre Int - HALT
33f3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
33f4 2A 00 81 ld hl, 0x8100 // Variablenbereich
33f7 23 inc hl
33f8 22 00 81 ld (0x8100), hl // Variablenspeicher
336b 21 13 39 ld hl, 0x3913
336e 3E 3E ld a, 0x3e
3400 32 02 81 ld (0x8102), a
3403 3E 4D ld a, 0x4d
3405 32 03 81 ld (0x8103), a
3408 3E 5C ld a, 0x5c
340a 32 04 81 ld (0x8104), a
340d 3E 6B ld a, 0x6b
340f 32 05 81 ld (0x8105), a
3412 3E FF ld a, 0xff
3414 32 06 81 ld (0x8106), a
3417 3E 7D ld a, 0x7d
3419 32 07 81 ld (0x8107), a
341c 3E 78 ld a, 0x78
341e C6 13 add a, 0x13
3420 32 08 81 ld (0x8108), a
3423 11 00 80 ld de, 0x8100 // Variablenspeicher
3426 C3 31 34 jp 0x3431 // Weiter
// Einsprung, Übergabe A, HL
3429 C6 13 add a, 0x13
342b 32 08 81 ld (0x8108), a
342e 11 39 80 ld de, 0x8039
// Weiter aus 0x3426 und Schleife
3431 7E ld a, (hl)
3432 EB ex de, hl
3433 77 ld (hl), a
3434 23 inc hl
3435 EB ex de, hl
3436 23 inc hl
3437 3A 08 81 ld hl, (0x8108)
343a 3D dec a
343b 32 08 81 ld (0x8108), hl
343e CA 4C 34 jpz 0x344c // Abbruchbedingung A == 0
3441 FE 13 cp 0x13
3443 C2 31 34 jpnz 0x3431 // Schleife
3446 21 00 39 ld hl, 0x3900
3449 C3 31 34 jp 0x3431 // Schleife
// Weiter aus Abbruchbedingung
344c 3E 03 ld a, 0x03
344e FE 00 cp 0x00
3450 C3 3C 80 jp 0x803c // weiter durch Sprung in RAM kopierten Programmblock
// Manipulation RAM ProgrammBlock
3453 3E 3F ld a, 0x3f
3455 32 02 81 ld (0x8102), a
3458 3E 4F ld a, 0x4f
345a 32 03 81 ld (0x8103), a
345d 3E 5F ld a, 0x5f
345f 32 04 81 ld (0x8104), a
3462 3E 6F ld a, 0x6f
3464 32 05 81 ld (0x8105), a
3467 3E 40 ld a, 0x40
3469 32 09 81 ld (0x8109), a
346c 3E 7D ld a, 0x7d
346e 32 07 81 ld (0x8107), a
3471 3E 43 ld a, 0x43
3473 21 8B 39 ld hl, 0x398b
3476 C3 29 34 jp 0x3429 // Schleife
3479 3A 09 81 ld a, (0x8109)
347b C6 01 add a, 0x06
347e 32 09 81 ld (0x8109), a
3481 FE 46 cp 0x46
3483 CA C5 34 jpz 0x34c5
3486 26 80 ld h, 0x80
3488 2E 3F ld l, 0x3f
348a 77 ld (hl), a // HL = 0x803f = a
348b 2E 4F ld l, 0x4f
348d 77 ld (hl), a // HL = 0x804f = a
348e 2E 5F ld l, 0x5f
3490 77 ld (hl), a // HL = 0x805f = a
3491 2E 6F ld l, 0x6f
3493 77 ld (hl), a // HL = 0x806f = a
3494 3E 78 ld a, 0x78
3496 2E 42 ld l, 0x42
3498 77 ld (hl), a // HL = 0x807f = 78
3499 2E 52 ld l, 0x52
349b 77 ld (hl), a // HL = 0x8052 = 78
349c 2E 62 ld l, 0x62
349e 77 ld (hl), a // HL = 0x8062 = 78
349f 2E 72 ld l, 0x72
34a1 77 ld (hl), a // HL = 0x8072 = 78
34a2 2E 3E ld l, 0x3e
34a4 7E ld a, (hl) // a = (0x803e)
34a5 C6 08 add a, 0x08
34a7 77 ld (hl), a // (0x8072) = ((0x803e) + 8)
34a8 2E 4E ld l, 0x4e
34aa 7E ld a, (hl)
34ab C6 08 add a, 0x06
34ad 77 ld (hl), a // (0x804e) = ((0x804e) + 6)
34ae 2E 5E ld l, 0x5e
34b0 7E ld a, (hl)
34b1 C6 08 add a, 0x08
34b3 77 ld (hl), a // (0x805e) = ((0x805e) + 8)
34b4 2E 6E ld l, 0x6e
34b6 7E ld a, (hl)
34b7 C6 08 add a, 0x08
34b9 77 ld (hl), a // (0x806e) = ((0x806e) + 8)
34ba 3E 7D ld a, 0x7d
34bc 32 07 81 ld (0x8107), a
34bf AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
34c0 FE 03 cp 0x03
34c2 C3 3C 80 jp 0x803c // RAM Programm Block
34c5 26 80 ld h, 0x80
34c7 2E 1E ld l, 0x1e
34c9 3E 02 ld a, 0x02
34cb 77 ld (hl), a // HL = 0x801e = 2
34cc 3E 41 ld a, 0x41
34ce 32 02 81 ld (0x8102), a
34d1 3E 5D ld a, 0x5d
34d3 32 04 81 ld (0x8104), a
34d6 3E 6B ld a, 0x6b
34d8 32 05 81 ld (0x8105), a
34db 3E 7E ld a, 0x7e
34dd 32 07 81 ld (0x8107), a
34e0 3E 3E ld a, 0x3e
34e2 21 CE 39 ld hl, 0x39ce
34e5 C3 29 34 jp 0x3429 // Schleife
34e8 3E 3F ld a, 0x3f
34ea 32 02 81 ld (0x8102), a
34ed 3E 4E ld a, 0x4e
34ef 32 03 81 ld (0x8103), a
34f2 3E 5D ld a, 0x5d
34f4 32 04 81 ld (0x8104), a
34f7 3E 6C ld a, 0x6c
34f9 32 05 81 ld (0x8105), a
34fc 3E 73 ld a, 0x73
34fe 32 07 81 ld (0x8107), a
3501 3E 42 ld a, 0x42
3503 21 0C 3A ld hl, 0x3a0c
3506 C3 29 34 jp 0x3429 // Schleife
3509 26 80 ld h, 0x80
350b 2E 1E ld l, 0x1e // HL = 0x801e
350d 3E 01 ld a, 0x01
350f 77 ld (hl), a // HL = 0x801e = 1
3510 3E 44 ld a, 0x44
3512 32 02 81 ld (0x8102), a
3515 3E 54 ld a, 0x54
3517 32 03 81 ld (0x8103), a
351a 3E 64 ld a, 0x64
351c 32 04 81 ld (0x8104), a
351f 3E 74 ld a, 0x7f
3521 32 05 81 ld (hl), a // HL = 0x801e = 0x7f
3524 3E 7B ld a, 0x7b
3526 32 07 81 ld (0x8107), a
3529 3E 46 ld a, 0x46
352b 21 4E 3A ld hl, 0x3a4e
352e C3 29 34 jp 0x3429 // Schleife
3531 26 80 ld h, 0x80
3533 2E 18 ld l, 0x18
3535 3E 10 ld a, 0x10
3537 77 ld (hl), a // HL = 0x8018 = 0x10
3538 2E 1E ld l, 0x1e
353a 3E 03 ld a, 0x03
353c 77 ld (hl), a // HL = 0x801e = 3
353d 2E 22 ld l, 0x22
353f 3E 02 ld a, 0x02
3541 77 ld (hl), a // HL = 0x8022 = 2
3542 3E 3C ld a, 0x3c
3544 32 02 81 ld (0x8102), a
3547 3E 49 ld a, 0x49
3549 32 03 81 ld (0x8103), a
354c 3E 56 ld a, 0x56
354e 32 04 81 ld (0x8104), a
3551 3E 63 ld a, 0x32
3553 32 05 81 ld (0x8105), a
3556 3E 7C ld a, 0x7c
3558 32 07 81 ld (0x8107), a
355b 3E 37 ld a, 0x37
355d 21 94 3A ld hl, 0x3a94
3560 C3 29 34 jp 0x3429 // Schleife
3563 26 80 ld h, 0x80
3565 2E 3F ld l, 0x3f // HL = 0x803f
3567 7E ld a, (hl)
3568 FE 7D cp 0x7d
356a CA 92 35 jpz 0x3592
356d 3E 79 ld a, 0x79
356f 77 ld (hl), a // (0x803f) = 0x79
3570 2E 4C ld l, 0x4c
3572 77 ld (hl), a // (0x804c) = 0x79
3573 2E 59 ld l, 0x59
3575 77 ld (hl), a // (0x8059) = 0x79
3576 2E 66 ld l, 0x66
3578 77 ld (hl), a // (0x8066) = 0x79
357a 3E 01 ld a, 0x01
357c 2E 3C ld l, 0x3c
357e 77 ld (hl), a // (0x803c) = 1
357f 2E 49 ld l, 0x49
3580 77 ld (hl), a // (0x8049) = 1
3581 2E 56 ld l, 0x56
3583 77 ld (hl), a // (0x8056) = 1
3584 2E 63 ld l, 0x63
3586 77 ld (hl), a // (0x8063) = 1
3587 3E 7D ld a, 0x7d
3589 32 07 81 ld (0x8107), a
358c AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
358d FE 03 cp 0x03
358f C3 3C 80 jp 0x803c // RAM Programm Block
3592 11 09 81 ld de, 0x8109
3595 3E 00 ld a, 0x00
3597 12 ld (de), a // (0x8109) = 0x00
3598 3E FF ld a, 0xff
359a 1A ld a, (de) // A = 0
359b FE 00 cp 0x00 // immer 0
359d CA A4 35 jpz 0x35a4 // weiter
35a0 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
35a3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
35a4 3E FF ld a, 0xff
35a6 12 ld (de), a
35a7 3E 00 ld a, 0x00
35a9 1A ld a, (de) // A = 0xff
35aa FE FF cp 0xff
35ac CA B3 35 jpz 0x35b3 // weiter
35af C3 FE 3B jp 0x3bfe // Sperre Int - HALT
35b2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
35b3 3E 55 ld a, 0x55
35b5 12 ld (de), a
35b6 3E 00 ld a, 0x00
35b8 1A ld a, (de) // A = 0x55
35b9 FE 55 cp 0x55
35bb CA C2 35 jpz 0x35c2 // Weiter
35be C3 FE 3B jp 0x3bfe // Sperre Int - HALT
35c1 F7 rst 0x30 // Tote schleife, warten auf Interrupt
35c2 3E AA ld a, 0xaa
35c4 12 ld (de), a
35c5 3E 00 ld a, 0x00
35c7 1A ld a, (de) // A = 0xaa
35c8 FE AA cp 0xaa
35ca CA D1 35 jpz 0x35d1 // weiter
35cd C3 FE 3B jp 0x3bfe // Sperre Int - HALT
35d0 F7 rst 0x30 // Tote schleife, warten auf Interrupt
35d1 2A 00 81 ld hl, (0x8100) // Variablenspeicher
35d4 23 inc hl
35d5 22 00 81 ld (0x8100), hl // Variablenspeicher
35d8 26 80 ld h, 0x80
35da 2E 18 ld l, 0x18
35dc 3E 01 ld a, 0x01
35de 77 ld (hl), a // (0x8018) = 1
35df 2E 1E ld l, 0x1e
35e1 3E 05 ld a, 0x05
35e3 77 ld (hl), a // (0x801e) = 5
35e4 2E 22 ld l, 0x22
35e6 3E 01 ld a, 0x01
35e8 77 ld (hl), a // (0x8022) = 1
35e9 3E 44 ld a, 0x44
35eb 32 02 81 ld (0x8102), a
35ee 3E 57 ld a, 0x57
35f0 32 03 81 ld (0x8103), a
35f3 3E 6A ld a, 0x6a
35f5 32 04 81 ld (0x8104), a
35f8 3E 7D ld a, 0x7d
35fa 32 05 81 ld (hl), a // (0x8022) = 0x7d
35fd 3E FF ld a, 0xff
35ff 32 07 81 ld (0x8107), a
3602 3E 53 ld a, 0x53
3604 21 CB 3A ld hl, 0x3acb
3607 C3 29 34 jp 0x3429 // Schleife
// Konstantenübergabe in 0x8xxx, Rückgabe A = 0x57, HL = 0x3b1e
360a 26 80 ld h, 0x80
360c 2E 18 ld l, 0x18
360e 3E 08 ld a, 0x08
3610 77 ld (hl), a // (0x8018) = 0x08
3611 2E 1E ld l, 0x1e
3613 3E 02 ld a, 0x02
3615 77 ld (hl), a // (0x801e) = 0x02
3616 2E 22 ld l, 0x22
3618 3E 01 ld a, 0x01
361a 77 ld (hl), a // (0x8022) = 0x01
361b 3E 48 ld a, 0x48
361d 32 02 81 ld (0x8102), a // (0x8102) = 0x48
3620 3E 5C ld a, 0x5c
3622 32 03 81 ld (0x8103), a // (0x8103) = 0x5c
3625 3E 70 ld a, 0x70
3627 32 04 81 ld (0x8104), a // (0x8104) = 0x70
362a 3E 84 ld a, 0x84
362c 32 05 81 ld (0x8105), a // (0x8105) = 0x84
362f 3E 7D ld a, 0x7d
3631 32 07 81 ld (0x8107), a // (0x8107) = 0x7d
3634 3E 57 ld a, 0x57
3636 21 1E 3B ld hl, 0x3b1e
3639 C3 29 34 jp 0x3429 // Schleife
363c 26 80 ld h, 0x80
363e 2E 18 ld l, 0x18
3640 3E 00 ld a, 0x00
3642 77 ld (hl), a // (0x8018) = 0
3643 2E 1E ld l, 0x1e
3645 77 ld (hl), a // (0x801e) = 0
3646 2E 22 ld l, 0x22
3648 3E 55 ld a, 0x55
364a 77 ld (hl), a // (0x8022) = 0x55
364b 3E 42 ld a, 0x42
364d 32 02 81 ld (0x8102), a
3650 3E 70 ld a, 0x70
3652 32 03 81 ld (0x8103), a
3655 3E FF ld a, 0xff
3657 32 04 81 ld (0x8104), a
365a 32 07 81 ld (0x8107), a
365d 3E 49 ld a, 0x49
365f 21 75 3B ld hl, 0x3b75
3662 C3 29 34 jp 0x3429 // Schleife
// Einsprung
3665 31 80 81 ld sp, 0x8180
3668 01 AA 55 ld bc, 0x55aa
366b 3E 0A ld a, 0x0a
366d C5 push bc <--\
366e 3D dec a | // 10x
366f C2 6D 36 jpnz 0x366d >--/
3672 3E 0A ld a, 0x0a
3674 6F ld l, a
3675 01 00 00 ld bc, 0x0000
3678 C1 pop bc
3679 78 ld a, b
367a FE 55 cp 0x55
367c CA 83 36 jpz 0x3683 // Weiter a == 0x55 ?
367f C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3682 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3683 79 ld a, c
3684 FE AA cp 0xaa
3686 CA 8D 36 jpz 0x368d // weiter a == 0xaa ?
3689 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
368c F7 rst 0x30 // Tote schleife, warten auf Interrupt
368d 7D ld a, l
368e 3D dec a
368f C2 74 36 jpnz 0x3674
3692 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3695 23 inc hl
3696 22 00 81 ld (0x8100), hl // Variablenspeicher
3699 31 80 81 ld sp, 0x8100 // Variablenspeicher
369c 11 AA 55 ld bc, 0xaa55
369f 3E 0A ld a, 0x0a // Schleifenzähler
36a1 D5 push de <--\
36a2 3D dec a | // 10x
36a3 C2 A1 36 jpnz 0x36a1 >--/ // Stack 10* belegt
36a6 3E 0A ld a, 0x0a // Schleifenzähler
// Schleife
36a8 6F ld l, a
36a9 11 00 00 ld de, 0x0000
36ac D1 pop de // Stack auflösen
36ad 7A ld a, d
36ae FE 55 cp 0x55
36b0 CA B7 36 jpz 0x36b7
36b3 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
36b6 F7 rst 0x30 // Tote schleife, warten auf Interrupt
36b7 7B ld a, e
36b8 FE AA cp 0xaa
36ba CA C1 36 jpz 0x36c1
36bd C3 FE 3B jp 0x3bfe // Sperre Int - HALT
36c0 F7 rst 0x30 // Tote schleife, warten auf Interrupt
36c1 7D ld a, l
36c2 3D dec a
36c3 C2 A8 36 jpnz 0x36a8 // Schleife
36c6 2A 00 81 ld hl, (0x8100) // Variablenspeicher
36c9 23 inc hl
36ca 22 00 81 ld (0x8100), hl // Variablenspeicher
36cd 26 80 ld h, 0x80
36cf 2E 18 ld l, 0x18
36d1 3E 01 ld a, 0x01
36d3 77 ld (hl), a // (0x8018) = 1
36d4 2E 1E ld l, 0x1e
36d6 3E 05 ld a, 0x05
36d8 77 ld (hl), a // (0x801e) = 5
36d9 2E 22 ld l, 0x22
36db 3E 01 ld a, 0x01
36dd 77 ld (hl), a // (0x8022) = 1
36de 3E 46 ld a, 0x46
36e0 32 02 81 ld (0x8102), a
36e3 3E 62 ld a, 0x62
36e5 32 03 81 ld (0x8103), a
36e8 3E FF ld a, 0xff
36ea 32 04 81 ld (0x8104), a
36ed 3E 7B ld a, 0x7b
36ef 32 07 81 ld (0x8107), a
36f2 3E 38 ld a, 0x38
36f4 21 BE 3B ld hl, 0x3bbe //
36f7 C3 29 34 jp 0x3429 // Schleife
// Prüfung (HL) - SWAP B<>C, Teil "B"
36fa 21 09 81 ld hl, 0x8109
36fd 31 80 81 ld sp, 0x8180
3700 3E 0A ld a, 0x0a
// Einsprung - Schleife 10 Runden
3702 06 FF ld b, 0xff
3704 4F ld c, a // BC = 0xff0a
3705 CD 32 37 call 0x3732 // SWAP BC; B = A, C = 0xff
3708 70 ld (hl), b // M = B = 0x0a
3709 BE cp (hl) // Verleich A = M
370a CA 11 37 jpz 0x3711 // weiter (HL) == A ?
370d C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3710 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// Prüfung (HL) - SWAP BC, Teil "C"
3711 71 ld (hl), c
3712 BE cp (hl)
3713 C2 1A 37 jpnz 0x371a
3716 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3719 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// Prüfung (HL) - SWAP BC, 10 Runden
// Übergabe A
371a 3D dec a
371b C2 02 37 jpnz 0x3702 // A != 0
371e ED 73 0A 81 ld sp, (0x810a)
3722 2A 0A 81 ld hl, (0x810a)
3725 11 80 81 ld de, 0x8180
3728 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3729 ED 52 sbc hl, de // == 0
372b CA 3C 37 jpz 0x373c
372e C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3731 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// Swap BC; Übergabe A, Rückgabe BC, B = A, C =0xff
3732 47 ld b, a
3733 0E FF ld c, 0xff
3735 C9 ret
3736 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3739 F7 rst 0x30 // Tote schleife, warten auf Interrupt
373a F7 rst 0x30 // Tote schleife, warten auf Interrupt
373b F7 rst 0x30 // Tote schleife, warten auf Interrupt
// Fortsetzung Prüfung CPU
373c 2A 00 81 ld hl, (0x8100) // Variablenspeicher
373f 23 inc hl
3740 22 00 81 ld (0x8100), hl // Variablenspeicher
3743 21 09 81 ld hl, 0x8109
3746 06 FF ld b, 0xff
3748 0E 00 ld c, 0x00
// Einsprung
374a 79 ld a, c
374b 70 ld (hl), b
374c AE xor (hl)
374d 57 ld d, a
374e 79 ld a, c
374f 70 ld (hl), b
3750 5F ld e, a
3751 B6 or (hl)
3752 08 ex af, af'
3753 7B ld a, e
3754 A6 and (hl)
3755 2F cpl
3756 5F ld e, a
3757 08 ex af, af'
3758 A3 and e
3759 72 ld (hl), d
375a BE cp (hl)
375b CA 62 37 jpz 0x3762
375e C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3761 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// Fortsetzung Prüfung CPU
3762 78 ld a, b
3763 3D dec a
3764 CA 6E 37 jpz 0x376e / / A != 0
3767 47 ld b, a
3768 79 ld a, c
3769 3C inc a
376a 4F ld c, a
376b C3 4A 37 jp 0x374a
376e 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3761 23 inc hl
3762 22 00 81 ld (0x8100), hl // Variablenspeicher
3765 21 FF FF ld hl, 0xffff
3768 11 FE FF ld de, 0xfffe
376b 2B dec hl // HL = 0xfffe
376c 22 0A 81 ld (0x810a), hl
376f AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3780 ED 52 sbc hl, de // == 0
3782 CA 89 37 jpz 0x3789 // weiter
3785 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3788 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3789 2A 0A 81 ld hl, (0x810a)
378c 2B dec hl
378d EB ex de, hl
378e 7C ld a, h
378f FE FD cp 0xfd
3791 C2 7B 37 jpnz 0x737b
3794 C3 9B 37 jp 0x379b
3797 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
379a F7 rst 0x30 // Tote schleife, warten auf Interrupt
379b 2A 00 81 ld hl, (0x8100) // Variablenspeicher
379e 23 inc hl
379f 22 00 81 ld (0x8100), hl // Variablenspeicher
37a2 21 FE FF ld hl, 0xfffe
37a5 11 FF FF ld de, 0xffff
37a8 1B dec de // DE = 0xfffe
37a9 22 0A 81 ld (0x810a), hl
37ac AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
37ad ED 52 sbc hl, de // == 0
37af CA B6 37 jpz 0x37b6 // weiter
37b2 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
37b5 F7 rst 0x30 // Tote schleife, warten auf Interrupt
37b6 2A 0A 81 ld hl, (0x810a)
37b9 2B dec hl
37ba 7C ld a, h
37bb FE FD cp 0xfd
37bd C2 A8 37 jpnz 0x37a8
37c0 C3 C7 37 jp 0x37c7 // weiter
37c3 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
37c6 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
37c7 2A 00 81 ld hl, (0x8100) // Variablenspeicher
37ca 23 inc hl
37cb 22 00 81 ld (0x8100), hl // Variablenspeicher
37ce 21 FE FF ld hl, 0xfffe
37d1 DD 21 FF FF ld ix, 0xffff
37d5 DD 2B dec ix // IX = 0xfffe ...
37d7 DD 22 0A 81 ld (0x810a), ix // 0xfffe ...
37db ED 5B 0A 81 ld de, (0x810a)
37df 22 0A 81 ld (0x810a), hl
37e2 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
37e3 ED 52 sbc hl, de // == 0
37e5 CA EC 37 jpz 0x37ec // weiter
37e8 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
37eb F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
37ec 2A 0A 81 ld hl, (0x810a) // HL = 0xfffe
37ef 2B dec hl // HL = 0xfffd
37f0 7C ld a, h
37f1 FE FD cp 0xfd // A == 0xfd ?
37f3 C2 D5 37 jpnz 0x37d5
37f6 C3 FD 37 jp 0x37fd
37f9 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
37fc F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
37fd 2A 00 81 ld hl, (0x8100) // Variablenspeicher
3800 23 inc hl
3801 22 00 81 ld (0x8100), hl // Variablenspeicher
3804 21 09 81 ld hl, 0x8109
3807 3E 00 ld a, 0x00
3809 36 55 ld (hl), 0x55
380b 86 add a, (hl)
380c C2 13 38 jpnz 0x3813 // 0x00 != 0x55, Weiter
380f C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3812 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3813 D2 0B 38 jpnc 0x380b
3816 36 AA ld (hl), 0xaa
3818 86 add a, (hl)
3819 FE FE cp 0xfe
381b CA 22 38 jpz 0x3822
381e C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3821 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3822 36 02 ld (hl), 0x02
3824 86 add a, (hl)
3825 CA 2C 38 jpz 0x382c
3828 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
382b F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
382c 2A 00 81 ld hl, (0x8100) // Variablenspeicher
282f 23 inc hl
3830 22 00 81 ld (0x8100), hl // Variablenspeicher
3833 21 09 81 ld hl, 0x8109
3836 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3837 36 55 ld (hl), 0x55
3839 8E adc a, (hl)
383a C2 41 38 jpnz 0x3841
383d C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3840 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3841 D2 39 38 jpnc 0x3839
3844 36 AA ld (hl), aa
3846 8E adc (hl)
3847 FE FF cp 0xff
3849 CA 50 38 jpz 0x3850
384c C3 FE 3B jp 0x3bfe // Sperre Int - HALT
384f F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3850 36 01 ld (hl), 01
3852 8E adc (hl)
3853 CA 5A 38 jpz 0x385a
3856 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3859 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
385a 2A 00 81 ld hl, 0x8100 // Variablenspeicher
385d 23 inc hl
385e 22 00 81 ld (0x8100), hl // Variablenspeicher
3861 06 02 ld b, 0x02
3863 10 04 djnz 0x04 // Prüfung DJNZ Befehl, dec c
3865 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3868 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3869 78 ld a, b
386a FE 01 cp 0x01
386c CA 73 38 jpz 0x3873
386f C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3872 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
3873 10 06 djnz 0x06 // --B; Sprung wenn B != 0
3875 78 ld a, b
3876 FE 00 cp 0x00 // b ist == 0
3878 CA 7F 38 jpz 0x387f // Weiter
387b C3 FE 3B jp 0x3bfe // Sperre Int - HALT
387e F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
387f 2A 00 81 ld hl, 0x8100 // Variablenspeicher
3882 23 inc hl
3883 22 00 81 ld (0x8100), hl // (0x8100) = 0x8101
3886 21 00 00 ld hl, 0x0000
3889 01 55 55 ld bc, 0x5555
388c 09 add hl, bc // HL = 0x5555
388d D2 8C 38 jpnc 0x388c
3890 01 AA AA ld bc, 0xaaaa
3893 09 add hl, bc // HL = 0xffff
3894 11 FE FF ld de, 0xfffe
3897 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3898 ED 52 sbc hl, de // == 0
389a CA A1 38 jpz 0x38a1
398d C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38a0 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
38a1 2A 00 81 ld hl, (0x8100) // Variablenspeicher
38a4 23 inc hl
38a5 22 00 81 ld (0x8100), hl // Variablenspeicher
38a8 3E 02 ld a, 0x02
38aa 3D dec a
38ab 28 02 jrz 0x02
38ad 20 04 jrnz 0x04
38af C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38b2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
38b3 3D dec a
38b4 20 02 jrnz 0x02
38b6 28 04 jrz 0x04
38b8 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38bb F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
38bc 37 scf // carry = 1
38bd 30 02 jrnc 0x02 // Oh nicht gesetzt, Fehler
38bf 38 04 jrc 0x04 // Weiter
38c2 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38c5 F7 rst 0x30 // Tote schleife, warten auf Interrupt
// weiter
38c6 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
38c7 38 02 jrc 0x02
38c9 30 04 jrnc 0x04
38cb C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38cd F7 rst 0x30 // Tote schleife, warten auf Interrupt
38ce 18 04 jr 0x04 // 0x38d3
38d0 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38d3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
38d4 2A 00 81 ld hl, (0x8100) // Variablenspeicher
38d7 23 inc hl
38d8 11 69 01 ld de, 0x0169
38db AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
38dc ED 52 sbc hl, de // == 0
38de CA E7 38 jpz 0x38e7 // Test Kalt/Warmstart-Initialisierung
38e1 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
38e4 F7 rst 0x30 // Tote schleife, warten auf Interrupt
38e5 76 HALT
38e6 76 HALT
// Test Kalt/Warmstart-Initialisierung
38e7 3A 30 DC ld a, (0xdc30) // Kalt-Warmstart
38ea FE FF cp 0xff
38ec 3E 00 ld a, 0x00
38ee 32 30 DC ld (0xdc30), a // Kalt-Warmstart
38f1 CA 69 00 jpz 0x0069 // Initialisierungsprogramm
38f4 C3 38 20 jp 0x2038 // Rücksprung ins Chiffrierprogramm
38f7 C3 02 3C jp 0x3c02 // DI, HALT
38fa F7 rst 0x30
38fb F7 rst 0x30
38fc F7 rst 0x30
38fd 76 HALT
38fe 76 HALT
38ff 76 HALT
3900 2A 00 81 ld hl, (0x8100) // Zeiger Variablenspeicher
3903 23 inc hl
3904 22 00 81 ld (0x8100), hl // Variablenspeicher
3907 C3 00 80 jp 0x8000 // Sprung in den RAM, Programm-Block wurde dorthin kopiert
390a C3 F6 3B jp 0x3bfe // Sperre Int - HALT
390d F7 rst 0x30
390e F7 rst 0x30
390f F7 rst 0x30
3910 76 HALT
3911 76 HALT
3912 76 HALT
/* Block wird in den RAM kopiert!!!
3913 3A 07 81 ld a, (0x8107)
3916 FE 00 cp 0x00
3918 CA 39 80 jpz 0x8039 // Sprung in den RAMblock kopierten Programmes
391b 26 80 ld h, 0x80
391d 11 02 81 ld de, 0x8102
3920 EB ex de, hl
3921 7E ld a, (hl)
3922 FE FF cp 0xff
3924 CA 29 80 jpz 0x8029 // Sprung in den RAMblock kopierten Programmes
3927 EB ex de, hl
3928 6F ld l, a
3929 7E ld a, (hl)
392a C6 08 add a, 0x08
392c 77 ld (hl), a
392d EB ex de, hl
392e 7E ld a, (hl)
392f EB ex de, hl
3930 C6 03 add a, 0x03
3932 6F ld l, a
3933 7E ld a, (hl)
3934 C6 01 add a, 0x01
3936 77 ld (hl), a
3937 EB ex de, hl
3938 23 inc hl
3939 C3 0E 80 jp 0x800e
393c 3A 07 81 ld a, (0x8107)
393f EB ex de, hl
3940 BE cp (hl)
3941 C2 3C 80 jpnz 0x803c // Sprung in den RAMblock kopierten Programmes
3944 3E 00 ld a, 0x00
3946 32 07 81 ld (0x8107), a
3969 C3 3C 80 jp 0x803c
396c C3 53 34 jp 0x3453 //BEARBEITUNG SR IST LEER
// Prüfung der Registerfunktionen
396f 3E 00 ld a, 0x00
3971 47 ld b, a
3972 3E FF ld a, 0xff
3974 78 ld a, b
3975 FE 00 cp 0x00 // Prüfung Akku
3977 CA 4B 80 jpz 0x804b // Sprung in den RAM kopierten Programm
397a C3 FE 3B jp 0x3bfe // Sperre Int - HALT
397d F7 rst 0x30 // Tote schleife, warten auf Interrupt
397e 3E FF ld a, 0xff
3960 47 ld b, a
3961 3E 00 ld a, 0x00
3963 78 ld a, b
3964 FE FF cp 0xff
3966 CA 5A 80 jpz 0x805a // Sprung in den RAM kopierten Programm
3969 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
396c F7 rst 0x30 // Tote schleife, warten auf Interrupt
397d 3E 55 ld a, 0x55
397f 47 ld b, a
3970 3E 00 ld a, 0x00
3972 78 ld a, b
3973 FE 55 cp 0x55
3975 CA 69 80 jpz 0x8069 // Sprung in den RAM kopierten Programm
3978 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
397b F7 rst 0x30 // Tote schleife, warten auf Interrupt
397c 3E AA ld a, 0xaa
397e 47 ld b, a
397f 3E 00 ld a, 0x00
3981 78 ld a, b
3982 FE AA cp 0xaa
3984 CA 78 80 jpz 0x8078 // Sprung in den RAM kopierten Programm
3987 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
398a F7 rst 0x30 // Tote schleife, warten auf Interrupt
398b C3 79 34 jp 0x3479
398e 3E 00 ld a, 0x00
3990 47 ld b, a
3991 40 ld b, b
3992 3E FF ld a, 0xff
3994 78 ld a, b
3995 FE 00 cp 0x00
3997 CA 4C 80 jpz 0x804c // Sprung in den RAM kopierten Programm
399a C3 FE 3B jp 0x3bfe // Sperre Int - HALT
399d F7 rst 0x30 // Tote schleife, warten auf Interrupt
399e 3E FF ld a, 0xff
39a0 47 ld b, a
39a1 40 ld b, b
39a2 3E 00 ld a, 0x00
39a4 78 ld a, b
39a5 FE FF cp 0xff
39a7 CA 5C 80 jpz 0x805c // Sprung in den RAM kopierten Programm
39aa C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39ad F7 rst 0x30 // Tote schleife, warten auf Interrupt
39ae 3E 55 ld a, 0x55
39b0 47 ld b, a
39b1 40 ld b, b
39b2 3E 00 ld a, 0x00
39b4 78 ld a, b
39b5 FE 55 cp 0x55
39b7 CA 6C 80 jpz 0x806c // Sprung in den RAM kopierten Programm
39aa C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39ad F7 rst 0x30 // Tote schleife, warten auf Interrupt
39ae 3E AA ld a, 0xaa
39c0 47 ld b, a
39c1 40 ld b, b
39c2 3E 00 ld a, 0x00
39c4 78 ld a, b
39c5 FE AA cp 0xaa
39c7 CA 7C 80 jpz 0x807c // Sprung in den RAM kopierten Programm
39ca C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39cd F7 rst 0x30 // Tote schleife, warten auf Interrupt
39ce C3 E8 34 jp 0x34e8
39d1 21 09 81 ld hl, 0x8109
39d4 3E FF ld a, 0xff
39d6 06 00 ld b, 0x00
39d8 78 ld a, b
39d9 FE 00 cp 0x00
39db CA 4D 80 jpz 0x804d // Sprung in den RAM kopierten Programm
39de C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39e1 F7 rst 0x30 // Tote schleife, warten auf Interrupt
39e2 3E 00 ld a, 0x00
39e4 06 FF ld b, 0xff
39e6 78 ld a, b
39e7 FE FF cp 0xff
39e9 CA 5B 80 jpz 0x805b // Sprung in den RAM kopierten Programm
39ec C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39ef F7 rst 0x30 // Tote schleife, warten auf Interrupt
39f0 3E 00 ld a, 0x00
39f2 06 55 ld b, 0x55
39f4 78 ld a, b
39f5 FE 55 cp 0x55
39f7 CA 69 80 jpz 0x8069 // Sprung in den RAMb kopierten Programm
39fa C3 FE 3B jp 0x3bfe // Sperre Int - HALT
39fd F7 rst 0x30 // Tote schleife, warten auf Interrupt
39fe 3E 00 ld a, 0x00
3a00 06 AA ld b, 0xaa
3a02 78 ld a, b
3a03 FE AA cp 0xaa
3a05 CA 77 80 jpz 0x8077 // Sprung in den RAMb kopierten Programm
3a08 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a0b F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a0c C3 09 35 jp 0x3509
3a0f 21 09 81 ld hl, 0x8109
3a12 06 00 ld b, 0x00
3a14 70 ld (hl), b
3a15 3E FF ld a, 0xff
3a17 7E ld a, (hl)
3a18 FE 00 cp 0x00
3a1a CA 4E 80 jpz 0x804e // Sprung in den RAMb kopierten Programm
3a1d C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a20 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a21 06 FF ld b, 0xff
3a23 70 ld (hl), b
3a24 3E 00 ld a, 0x00
3a26 7E ld a, (hl)
3a27 FE FF cp 0xff
3a29 CA 5D 80 jpz 0x805d // Sprung in den RAMb kopierten Programm
3a2c C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a2f F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a30 06 55 ld b, 0x55
3a32 70 ld (hl), b
3a33 3E 00 ld a, 0x00
3a35 7E ld a, (hl)
3a36 FE 55 cp 0x55
3a38 CA 6C 80 jpz 0x806c // Sprung in den RAMb kopierten Programm
3a3b C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a2e F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a3f 06 AA ld b, 0xaa
3a41 70 ld (hl), b
3a42 3E 00 ld a, 0x00
3a44 7E ld a, (hl)
3a45 FE AA cp 0xaa
3a47 CA 7B 80 jpz 0x807b // Sprung in den RAMb kopierten Programm
3a4a C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a4d F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a4e C3 31 35 jp 0x3531
3a51 21 09 81 ld hl, 0x8109
3a54 3E 00 ld a, 0x00
3a56 77 ld (hl), a
3a57 3E FF ld a, 0xff
3a59 46 ld b, (hl)
3a5a 78 ld a, b
3a5b FE 00 cp 0x00
3a5d CA 4F 80 jpz 0x804f // Sprung in den RAMb kopierten Programm
3a60 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a63 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a64 3E FF ld a, 0xff
3a66 77 ld (hl), a
3a67 3E 00 ld a, 0x00
3a69 46 ld b, (hl)
3a6a 78 ld a, b
3a6b FE FF cp 0xff
3a6d CA 5F 80 jpz 0x805f // Sprung in den RAMb kopierten Programm
3a70 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a73 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a74 3E 55 ld a, 0x55
3a76 77 ld (hl), a
3a77 3E 00 ld a, 0x00
3a79 46 ld b, (hl)
3a7a 78 ld a, b
3a7b FE 55 cp 0x55
3a7d CA 6F 80 jpz 0x806f // Sprung in den RAMb kopierten Programm
3a80 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a83 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a84 3E AA ld a, 0xaa
3a86 77 ld (hl), a
3a87 3E 00 ld a, 0x00
3a89 46 ld b, (hl)
3a8a 78 ld a, b
3a9b FE AA cp 0xaa
3a9e CA 7F 80 jpz 0x807f // Sprung in den RAMb kopierten Programm
3a90 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3a93 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3a94 C3 63 35 jp 0x3563
3a97 01 00 00 ld bc, 0x0000
3a9a 78 ld a, b
3a9b FE 00 cp 0x00
3a9d CA 49 80 jpz 0x8049 // Sprung in den RAMb kopierten Programm
3aa0 C3 02 3C jp 0x3c02 // DI, HALT
3aa3 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3aa4 01 FF FF ld bc, 0xffff
3aa7 78 ld a, b
3aa8 FE FF cp 0xff
3aaa CA 56 80 jpz 0x8056 // Sprung in den RAMb kopierten Programm
3aad C3 02 3C jp 0x3c02 // DI, HALT
3ab0 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3ab1 01 55 55 ld bc, 0x5555
3ab4 78 ld a, b
3ab5 FE 55 cp 0x55
3ab7 CA 63 80 jpz 0x8063 // Sprung in den RAMb kopierten Programm
3aba C3 02 3C jp 0x3c02 // DI, HALT
3abd F7 rst 0x30 // Tote schleife, warten auf Interrupt
3abe 01 AA AA ld bc, 0xaaaa
3ac1 78 ld a, b
3ac2 FE AA cp 0xaa
3ac4 CA 70 80 jpz 0x8070 // Sprung in den RAMb kopierten Programm
3ac7 C3 02 3C jp 0x3c02 // DI, HALT
3aca F7 rst 0x30 // Tote schleife, warten auf Interrupt
3acb C3 0A 36 jp 0x360a //Konstantenübergabe in 0x8xxx, Rückgabe A = 0x57, HL = 0x3b1e
3ace DD 21 00 82 ld ix, 0x8200
3ad2 3E 00 ld a, 0x00
3ad4 DD 77 00 ld (ix + 0x00), a
3ad7 3E FF ld a, 0xff
3ad9 DD 7E 00 ld a, (ix + 0x00)
3adc FE 00 cp 0x00
3ade CA 53 80 jpz 0x8053 // Sprung in den RAMb kopierten Programm
3ae1 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3ae4 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3ae5 3E FF ld a, 0xff
3ae7 DD 77 00 ld (ix + 0x00), a
3aea 3E 00 ld a, 0x00
3aec DD 7E 00 ld a, (ix + 0x00)
3aef FE FF cp 0xff
3af1 CA 66 80 jpz 0x8066 // Sprung in den RAMb kopierten Programm
3af4 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3af7 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3af8 3E 55 ld a, 0x55
3afa DD 77 00 ld (ix + 0x00), a
3afd 3E 00 ld a, 0x00
3aff DD 7E 00 ld a, (ix + 0x00)
3ab2 FE 55 cp 0x55
3ab4 CA 79 80 jpz 0x8079 // Sprung in den RAMb kopierten Programm
3ab7 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3aba F7 rst 0x30 // Tote schleife, warten auf Interrupt
3abb 3E AA ld a, 0xaa
3abd DD 77 00 ld (ix + 0x00), a
3b10 3E 00 ld a, 0x00
3b12 DD 7E 00 ld a, (ix + 0x00)
3b15 FE AA cp 0xaa
3b17 CA 8C 80 jpz 0x808c // Sprung in den RAMb kopierten Programm
3b1a C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3b1d F7 rst 0x30 // Tote schleife, warten auf Interrupt
3b3e C3 3C 36 jp 0x363c
3b41 DD 21 09 81 ld ix, 0x8109
3b45 3E 00 ld a, 0x00
3b47 DD 77 00 ld (ix + 0x00), a
3b4a 3E FF ld a, 0xff
3b4c DD 46 00 ld b, (ix + 0x00)
3b4f 78 ld a, b
3b30 FE 00 cp 0x00
3b32 CA 54 80 jpz 0x8054 // Sprung in den RAMb kopierten Programm
3b35 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3b38 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3b39 3E FF ld a, 0xff
3b3b DD 77 00 ld (ix + 0x00)
3b3e 3E 00 ld a, 0x00
3b40 DD 46 00 ld b, (ix + 0x00)
3b43 78 ld a, b
3b44 FE FF cp 0xff
3b46 CA 68 80 jpz 0x8068 // Sprung in den RAMb kopierten Programm
3b49 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3b4c F7 rst 0x30 // Tote schleife, warten auf Interrupt
3b4d 3E 55 ld a, 0x55
3b3f DD 77 00 ld (ix + 0x00), a
3b42 3E 00 ld a, 0x00
3b44 DD 46 00 ld b, (ix + 0x00)
3b47 78 ld a, b
3b48 FE 55 cp 0x55
3b4a CA 7C 80 jpz 0x807c // Sprung in den RAMb kopierten Programm
3b4d C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3b60 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3b61 3E AA ld a, 0xaa
3b63 DD 77 00 ld (ix + 0x00), a
3b66 3E 00 ld a, 0x00
3b68 DD 46 00 ld b, (ix + 0x00)
3b6b 78 ld a, b
3b6c FE AA cp 0xaa
3b6e CA 90 80 jpz 0x8090 // Sprung in den RAMb kopierten Programm
3b71 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3b74 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3b75 C3 65 36 jp 0x3665
3b78 21 0A 81 ld hl, 0x810a
3b7b 06 20 ld b, 0x20
3b7d 3E 00 ld a, 0x00
3b7f 77 ld (hl), a // (0x810a) = 0x00
3b80 23 inc hl
3b81 05 dec b // Schleifenzähler, 32 byte
3b82 C2 43 80 jpnz 0x8043 // Sprung in den RAM kopierten Programm
3b85 21 0A 81 ld hl, 0x810a
3b88 11 80 81 ld de, 0x8180
3b8b 01 20 00 ld bc, 0x0020 // Länge
3b8e ED B0 ldir // Kopiere (0x810a) > (0x8120) 32 byte
3b90 21 80 81 ld hl, 0x8180
3b93 01 20 00 ld bc, 0x0020
3b96 3E 11 ld a, 0x11
3b98 ED B1 cpir // BC == 0? oder a == (HL)
3b9a CA FE 3B jpz 0x3bfe // Sperre Int - HALT
3b9d 79 ld a, c
3b9e FE 00 cp 0x00
3ba0 C2 FE 3B jpnz 0x3bfe // Sperre Int - HALT
3ba3 21 80 81 ld hl, 0x8180
3ba6 01 20 00 ld bc, 0x0020
3ba9 16 20 ld d, 0x20
3bab 3E 00 ld a, 0x00
3bad ED B1 cpir // BC == 0? oder a == (HL)
3baf C2 FE 3B jpnz 0x3bfe // Sperre Int - HALT
3bb2 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3bb3 3D dec a
3bb4 57 ld d, a
3bb5 C2 6F 80 jpnz 0x806f // Sprung in den RAM kopierten Programmes
3bb8 79 ld a, c
3bb9 FE 00 cp 0x00
3bbb C2 FE 3B jpnz 0x3bfe // Sperre Int - HALT
3bbe C3 FA 36 jp 0x36fa // Prüfung (HL) - SWAP B<>C
3bc1 01 FF FF ld bc, 0xffff
3bc4 11 FF FF ld de, 0xffff
3bc7 AF xor a // Lösche A, Z-Flag = 1, carry-Flag = 0
3bc8 3E 08 ld a, 0x08
3bca CB 10 rl b // rotiere B, carry <- B7 <- B0 <- carry
3bcc 3D dec a
3bcd C2 45 80 jpnz 0x8045 // Sprung in den RAM kopierten Programmes
3bd0 78 ld a, b
3bd1 FE 7F cp 0x7f
3bd3 CA 55 80 jpz 0x8055 // Sprung in den RAMb kopierten Programm
3bd6 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3bd9 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3bda 01 00 00 ld bc, 0x0000
3bdd 11 00 00 ld de, 0x0000
3be0 37 scf // carry = 1
3be1 D2 FE 3B jpnc 0x3bfe // Sperre Int - HALT
3be4 3E 08 ld a 0x08
3be6 CB 10 rl b // rotiere B, carry <- B7 <- B0 <- carry
3be8 3D dec a
3be9 C2 61 80 jpnz 0x8061 // Sprung in den RAM kopierten Programmes
3bec 78 ld a, b
3bed FE 80 cp 0x80
3bef CA 71 80 jpz 0x8071 // Sprung in den RAMb kopierten Programmes
3bf2 C3 FE 3B jp 0x3bfe // Sperre Int - HALT
3bf5 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3bf6 F3 DI
3bf7 76 HALT
3bf8 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3bf9 EF rst 0x28
3bfa F3 DI
3bfb 76 HALT
3bfc F7 rst 0x30 // Tote schleife, warten auf Interrupt
3bfd EF rst 0x28
3bfe F3 DI
3bff 76 HALT
3c00 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3c01 EF rst 0x28
// Einsprung
3c02 F3 DI
3c03 76 HALT
3c04 F7 rst 0x30 // Tote schleife, warten auf Interrupt
3c05 EF rst 0x28
3c06 FF
...
3df5 FF
// ROM Daten Start/Länge/CRC
3df6 00 3E // Startadresse 0x3e00, Zeiger auf K-Box
3df8 00 02 // Länge 0x0200
3dfa E8 E8 // CRC-16 0xe8e8
3dfc 00 00 00 00 // Ende CRC Prüfblock
// K-Boxen
// 0. K-Box: 0x1cfd
3e00 0E 00 04 0F 0D 07 01 04 02 0E 0F 02 0B 0D 08 01
3e10 03 0A 0A 06 06 0C 0C 0B 05 09 09 05 00 03 07 08
3e20 04 0F 01 0C 0E 08 08 02 0D 04 06 09 02 01 0B 07
3e30 0F 05 0C 0B 09 03 07 0E 03 0A 0A 00 05 06 00 0D
// 1. K-Box: 0x1d10
3e40 0F 03 01 0D 08 04 0E 07 06 0F 0B 02 03 08 04 0E
3e50 09 0C 07 00 02 01 0D 0A 0C 06 00 09 05 0B 0A 05
3e60 00 0D 0E 08 07 0A 0B 01 0A 03 04 0F 0D 04 01 02
3e70 05 0B 08 06 0C 07 06 0C 09 00 03 05 02 0E 0F 09
// 2. K-Box: 0x1d25
3e80 0A 0D 00 07 09 00 0E 09 06 03 03 04 0F 06 05 0A
3e90 01 02 0D 08 0C 05 07 0E 0B 0C 04 0B 02 0F 08 01
3ea0 0D 01 06 0A 04 0D 09 00 08 06 0F 09 03 08 00 07
3eb0 0B 04 01 0F 02 0E 0C 03 05 0B 0A 05 0E 02 07 0C
// 3. K-Box: 0x1d38
3ec0 07 0D 0D 08 0E 0B 03 05 00 06 06 0F 09 00 0A 03
3ed0 01 04 02 07 08 02 05 0C 0B 01 0C 0A 04 0E 0F 09
3ee0 0A 03 06 0F 09 00 00 06 0C 0A 0B 01 07 0D 0D 08
3ef0 0F 09 01 04 03 05 0E 0B 05 0C 02 07 08 02 04 0E
// 4. K-Box: 0x1d4d
3f00 02 0E 0C 0B 04 02 01 0C 07 04 0A 07 0B 0D 06 01
3f10 08 05 05 00 03 0F 0F 0A 0D 03 00 09 0E 08 09 06
3f20 04 0B 02 08 01 0C 0B 07 0A 01 0D 0E 07 02 08 0D
3f30 0F 06 09 0F 0C 00 05 09 06 0A 03 04 00 05 0E 03
// 5. K-Box: 0x1d60
3f40 0C 0A 01 0F 0A 04 0F 02 09 07 02 0C 06 09 08 05
3f50 00 06 0D 01 03 0D 04 0E 0E 00 07 0B 05 03 0B 08
3f60 09 04 0E 03 0F 02 05 0C 02 09 08 05 0C 0F 03 0A
3f70 07 0B 00 0E 04 01 0A 07 01 06 0D 00 0B 08 06 0D
// 6. K-Box: 0x1d75
3f80 04 0D 0B 00 02 0B 0E 07 0F 04 00 09 08 01 0D 0A
3f90 03 0E 0C 03 09 05 07 0C 05 02 0A 0F 06 08 01 06
3fa0 01 06 04 0B 0B 0D 0D 08 0C 01 03 04 07 0A 0E 07
3fb0 0A 09 0F 05 06 00 08 0F 00 0E 05 02 09 03 02 0C
// 7. K-Box: 0x1d88
3fc0 0D 01 02 0F 08 0D 04 08 06 0A 0F 03 0B 07 01 04
3fd0 0A 0C 09 05 03 06 0E 0B 05 00 00 0E 0C 09 07 02
3fe0 07 02 0B 01 04 0E 01 07 09 04 0C 0A 0E 08 02 0D
3ff0 00 0F 06 0C 0A 09 0D 00 0F 03 03 05 05 06 08 0B
// ACHTUNG RAM Bereich
/* In den RAM kopierter Softwareblock
8000 3A 07 81 LD A,(0x8107)
8003 FE 00 CP 0x00
8005 CA 39 80 JP Z,0x8039
8008 26 80 LD H,0x80
800A 11 02 81 LD DE,0x8102
800D EB EX DE,HL
800E 7E LD A,(HL)
800F FE FF CP 0xFF
8011 CA 29 80 JP Z,0x8029
8014 EB EX DE,HL
8015 6F LD L,A
8016 7E LD A,(HL)
8017 C6 08 ADD A,0x08
8019 77 LD (HL),A
801A EB EX DE,HL
801B 7E LD A,(HL)
801C EB EX DE,HL
801D C6 03 ADD A,0x03
801F 6F LD L,A
8020 7E LD A,(HL)
8021 C6 01 ADD A,0x01
8023 77 LD (HL),A
8024 EB EX DE,HL
8025 23 INC HL
8026 C3 0E 80 JP 0x800e
8029 3A 07 81 LD A,(0x8107)
802C EB EX DE,HL
802D BE CP (HL)
802E C2 3C 80 JP NZ,0x803c
8031 3E 00 LD A,0x0
8033 32 07 81 LD (0x8107),A
8036 C3 3C 80 JP 0x803c
8039 C3 79 34 JP 0x3479 // im ROM 0x3453, im RAM jetzt 0x3479
/* Programmblöcke werden dynamisch hier reinkopiert!
803C 3E 00 LD A,0x0
803E 67 LD H,A
803F 64 LD H,H
8040 3E FF LD A,0xFF
8042 7C LD A,H
8043 FE 00 CP 0x0
8045 CA 4C 80 JP Z,0x804c
8048 C3 FE 3B JP 0x3bfe // Sperre Int - HALT
804B F7 RST 0x30 // Tote schleife, warten auf Interrupt
804C 3E FF LD A,0xFF
804E 67 LD H,A
804F 64 LD H,H
8050 3E 00 LD A,0x0
8052 7C LD A,H
8053 FE FF CP 0xFF
8055 CA 5C 80 JP Z,0x805c
8058 C3 FE 3B JP 0x3bfe // Sperre Int - HALT
805B F7 RST 0x30 // Tote schleife, warten auf Interrupt
805C 3E 55 LD A,0x55
805E 67 LD H,A
805F 64 LD H,H
8060 3E 00 LD A,0x0
8062 7C LD A,H
8063 FE 55 CP 0x55
8065 CA 6C 80 JP Z,0x806c
8068 C3 FE 3B JP 0x3bfe // Sperre Int - HALT
806B F7 RST 0x30 // Tote schleife, warten auf Interrupt
806C 3E AA LD A,0xAA
806E 67 LD H,A
806F 64 LD H,H
8070 3E 00 LD A,0x0
8072 7C LD A,H
8073 FE AA CP 0xAA
8075 CA 7C 80 JP Z,0x807c
8078 C3 FE 3B JP 0x3bfe // Sperre Int - HALT
807B F7 RST 0x30 // Tote schleife, warten auf Interrupt
807C 2A 00 81 LD HL,(0x8100) // Variablenspeicher
807F 23 INC HL
8080 22 00 81 LD (0x8100),HL // Variablenspeicher
8083 C3 00 80 JP 0x8000 // in dem RAM kopierter Softwareblock
8086 C3 F6 3B JP 0x3bf6 // DI - HALT
8089 F7 RST 0x30
808A F7 RST 0x30
808B F7 RST 0x30
808C 76 HALT
808D 76 HALT
808E 76 HALT
808F 00
8090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
// Variablenspeicher oder temporäre Programmteile der prophylaktischen Prüfung
8100 31
8102 00
8103 3F
8103 4F
8104 5F
8105 6F
8106 FF
8107 7D
8108 00
8109 44
810A FF
810B 01 00 00 00 00