Zur Übersicht - INFO - Neueste 50 Beiträge - Neuer Beitrag - Suchen - FAQ - Zum CC1-Forum - Zum CC-Pro-Forum

Re: C-Programm übersetzen Kategorie: Progr. Assembler, TaskingTools, OS (von Frank Neul - 27.04.2008 11:31)
Als Antwort auf Re: C-Programm übersetzen von André H. - 9.04.2008 11:00

Hallo André,

vielen Dank für die Info.

dann bist du meine Rettung! Das Problem liegt wahrscheinlich im Bereich ASM Adaption
auf die CC2 Hardware (Memorymodell, SP, IR, Timing etc..)

Ich habe das C-Programm minimiert (Ein-/Ausgabe numerisch, Parameterübergabe aus C2) und erfolgreich in TurboC getestet.
Den gleichen C-Source habe ich dann mittels Tasking in ASM übersetzt und den ASM Text an die CC2 adaptiert.

Und es funktiert...  mit Einschränkungen.

Unter gewissen Prämissen hängt das Programm. Das ASM Programm ist nach klar lesbar und parallel
zum C-Code sind die Prozeduren, Variablen, Konstanten,  etc. zu lesen und verstehen.

Habe ich beispielsweise nur eine Dame auf dem Schachfeld funktioniert die Zugprüfung. Ist es nur ein Turm
bleibt er hängen. Bei der Eingrenzung "wandert" der Fehler, bis er weg ist. Dann funktioniert auch der Turm.
Ein oder zweimal (ohne �nderung) anschlie�end hängt er wieder. Das bedeutet die UNIT kommt nicht wieder
aus dem Call ins C2 zurück. Eine zweite Testthreat zum Beispiel bleibt ebenfalls hängen.

Das Programm benutzt 30000H als Codesegment, 80000H als Datasegment und 34000H als Constantsegment.
Zum Download benutze ich "dein" CC2-Tool Programm. Das OS ist das aktuelle.

Das ASM Programm an sich muss eigentlich funktionieren, alle Fehleranalysen haben das gezeigt. Es wurde
per Compiler aus einem C-programm erstellt welches felhlerfrei läuft, wenn man es per TurboC compiliert.
Es läuft ebenfalls, mit Modifikationen, als C2 Source, nur eben grottenlangsam.

Meine Bitte:
Schau dir doch bitte mal das ASM Programm an. Wenn du hier Tips geben kannst bin ich dir dankbar.
Für mich ist das eine gro�e Hilfe, da das Programm, wie beschrieben, nach riesiegem Aufwand eigentlich läuft.
Als sonstige Alternative bleibt mir nur die Harwareplattform zu wechseln und auf z.B. AVR umzusteigen.

Ich schicke dir parallel per E-Mail (wie geht das eigentlich übers Formum?) die C und ASM Sources,
sowie das C2 Modul.


Tausend Dank vorab

Frank Neul



;******************************************************************/
;* Author    : Frank W. Neul (frank.neul@t-online.de              */
;* Vorlage   : Frank W. Neul (frank.neul@t-online.de              */
;* Datum     : 04.04.2008                                         */
;* Getestet  : Nein                                               */
;* Getestet  : Nein                                               */
;******************************************************************/

$case
$segmented
$model(large)
$extend
$nomod166
$stdnames(reg164ci.def)

regdef R0-R15
 
;***********************************************************
userseg SECTION CODE word at 30000h
assume dpp3:userseg
assume dpp3:system
assume dpp2:dataseg
assume dpp1:constseg
;***********************************************************

; Definition der OS-Routinen
OSseg           EQU     0
POP_R4          EQU     0765AH  ;uses: R4, R12, R13, R14  ; Wert in R4
POP_LNG         EQU     07680H  ;return in R4, R5         ; Wert in R4(Lo-Word), R5(Hi-Word)
PUSH_LNG        EQU     075fEH                            ; Wert in R12, R13
PUSH_R12        EQU     075D6H  ;push R12                 ; Wert in R12

Version         EQU        110  ;Aktuelle Version der Routine


;***********************************************************
;Holt Parameter (int R2,R3,R4,R5)
getparm proc far
    calls OSseg,POP_R4   ;int count vom Stack in R4 holen
    mov R5,R4            ;4.Parameter in R5
    calls OSseg,POP_R4   ;int count vom Stack in R4 holen
    mov R6,R4            ;3.Parameter in R6 zwischenspeichern
    calls OSseg,POP_R4   ;int count vom Stack in R4 holen
    mov R3,R4            ;2.Parameter in R3
    calls OSseg,POP_R4   ;int count vom Stack in R4 holen
    mov R2,R4            ;1.Parameter in R2
        mov R4,R6                    ;3. Parameter aus R6 zurückholen
    ret                  ;Ruecksprung
getparm endp
;***********************************************************

;***********************************************************
;Setzt Parameter (R2) returns long
setparm proc far
    pop R1               ;2 x POP
    pop R1
        mov R13,#0           ;Lower Word auf Null
    mov R12,R2           ;R2 als Ergebnis
    calls OSseg,PUSH_LNG ;Longwert auf den Stack laden
        ret
setparm endp
;***********************************************************



;***********************************************************
; Function _main
_main   proc    far
    movw        dpp2,#pag dataseg       ;Daten:      Data Page Pointers
        movw    dpp1,#pag constseg      ;Konstanten: Data Page Pointers
        call    getparm                 ;Hole Parameter (long R2,R3,R4,R5)
        call    _main_start             ;main_start ist die ausführende C-Funktion
    movw        dpp2,#02h                       ;DPP2 Originalwert setzen (2)
        movw    dpp1,#01h                       ;DPP1 Originalwert setzen (1)
    jmp         setparm                         ;Ã?bergebe R2 als: returns int
        ret
_main endp
        ; End of function
        ; End of section


; Function _main_start
_main_start     proc    far
        call    __save_1
        movw    r8,r2
        movw    r9,r3
        movw    r10,r4
        movw    r6,r5
        movw    r7,#01h
        cmpw    r8,#01h
        jmp     cc_ne,_3
        call    _initialisiere
_3:
        cmpw    r8,#02h
        jmp     cc_ne,_4
        movw    r2,r9
        movw    r3,r10
        movw    r4,r6
        call    _zugnr_eingabe
; TEST DEBUG ----------------------------
        movw    r7,r2  ; Original
;      movw    r7,_LocalStack
_4:
        cmpw    r8,#03h
        jmp     cc_ne,_5
        movw    _SpielerSpieler,ZEROS
        call    _computer_zug
_5:
        cmpw    r8,#04h
        jmp     cc_ne,_6
        cmpw    r9,#01h
        jmp     cc_ne,_7
        movw    r7,_Message
_7:
        cmpw    r9,#02h
        jmp     cc_ne,_8
        movw    r7,_Zug_Schlag
_8:
        cmpw    r9,#03h
        jmp     cc_ne,_9
        movw    r7,_Zug_Figur
_9:
        cmpw    r9,#04h
        jmp     cc_ne,_10
        movw    r7,_Zug_Von
_10:
        cmpw    r9,#05h
        jmp     cc_ne,_11
        movw    r7,_Zug_Nach
_11:
        cmpw    r9,#06h
        jmp     cc_ne,_12
        movw    r7,_Zug_Umwandlung
_12:
        cmpw    r9,#07h
        jmp     cc_ne,_13
        movw    r11,r10
        shl     r11,#01h
        movw    r7,[r11+#dpp2:_Brett]
        _13:
        cmpw    r9,#08h
        jmp     cc_ne,_14
        movw    r7,_SollTiefe
_14:
_6:
        cmpw    r8,#05h
        jmp     cc_ne,_15
        cmpw    r9,#01h
        jmp     cc_ne,_16
        movw    _Message,r6
_16:
        cmpw    r9,#02h
        jmp     cc_ne,_17
        movw    _Zug_Schlag,r6
_17:
        cmpw    r9,#03h
        jmp     cc_ne,_18
        movw    _Zug_Figur,r6
_18:
        cmpw    r9,#04h
        jmp     cc_ne,_19
        movw    _Zug_Von,r6
_19:
        cmpw    r9,#05h
        jmp     cc_ne,_20
        movw    _Zug_Nach,r6
_20:
        cmpw    r9,#06h
        jmp     cc_ne,_21
        movw    _Zug_Umwandlung,r6
_21:
        cmpw    r9,#07h
        jmp     cc_ne,_22
        shl     r10,#01h
        movw    [r10+#dpp2:_Brett],r6
_22:
        cmpw    r9,#08h
        jmp     cc_ne,_23
        movw    _SollTiefe,r6
_23:
_15:
        cmpw    r8,#06h
        jmp     cc_ne,_24
        movw    r7,#Version  
_24:
        movw    r2,r7
        jmp     __restore_2
        ret
_main_start endp
        ; End of function
        ; End of section

        global  _sgn
; Function _sgn
_sgn    proc    far
        cmpw    r2,#00h
        jmp     cc_ne,_26
        movw    r2,#00h
        ret
_26:
        cmpw    r2,#00h
        jmp     cc_sle,_28
        movw    r2,#01h
        ret
_28:
        movw    r2,#0ffffh
        ret
_sgn endp
        ; End of function
        ; End of section

        global  _abs
; Function _abs
_abs    proc    far
        movw    r11,#00h
        cmpw    r2,#00h
        jmp     cc_slt,_31
        movw    r11,r2
_31:
        cmpw    r2,#00h
        jmp     cc_sge,_32
        negw    r2
        movw    r11,r2
_32:
        movw    r2,r11
        ret
_abs endp
        ; End of function
        ; End of section

        global  _initialisiere
; Function _initialisiere
_initialisiere  proc    far
        movw    _ZugNr,ZEROS
        movw    r11,#dpp1:_GrundStellung
        movw    r12,#dpp2:_Brett
        movw    r13,#00h
_34:
        movw    [r12+],[r11]
        addw    r11,#02h
        cmpi1   r13,#77h
        jmp     cc_ult,_34
        movw    r11,#19h
        movw    _wKoenig,r11
        movw    r11,#5fh
        movw    _sKoenig,r11
        movw    r11,#dpp2:_Rochade
        movw    r12,#00h
_35:
        movw    [r11],ZEROS
        addw    r11,#02h
        cmpi1   r12,#02h
        jmp     cc_ult,_35
        movw    r11,#15h
        movw    r12,#dpp2:_Bewegt+2ah
_36:
        movw    [r12],ZEROS
        addw    r12,#02h
        cmpi1   r11,#62h
        jmp     cc_ult,_36
        movw    _Ep_Feld,ZEROS
        movw    r11,#1964h
        movw    _MatSumme,r11
        movw    _MatBilanz,ZEROS
        movw    _StapelGrenze,ZEROS
        movw    r11,#04h
        movw    _SollTiefe,r11
        movw    _Tiefe,ZEROS
        movw    r11,#01h
        movw    _Farbe,r11
        ret
_initialisiere endp
        ; End of function
        ; End of section

        global  _init_spielbaum
; Function _init_spielbaum
_init_spielbaum proc    far
        cmpw    ZEROS,_Tiefe
        jmp     cc_eq,_37
        movw    r11,#dpp2:_Ep_Feld
        movw    [r11],_Ep_Feld+02h
        movw    r11,#dpp2:_MatBilanz
        movw    [r11],_MatBilanz+02h
        movw    r11,#dpp2:_MatSumme
        movw    [r11],_MatSumme+02h
        movw    _Tiefe,ZEROS
_37:
        ret
_init_spielbaum endp
        ; End of function
        ; End of section

        global  _naechstbesterzug
; Function _naechstbesterzug
_naechstbesterzug       proc    far
        movw    r2,#0ffffh
        movw    r11,#8300h
        movw    r12,_Tiefe
        shl     r12,#01h
        movw    r13,[r12+#dpp2:_StapelGrenze]
        movw    r3,#dpp2:_StapelGrenze+02h
        addw    r3,r12
        jmp     _38
_39:
        movw    r12,r13
        shl     r12,#03h
        subw    r12,r13
        shl     r12,#01h
        movw    r12,[r12+#dpp2:_ZugStapel+0ch]
        cmpw    r12,r11
        jmp     cc_sle,_40
        movw    r2,r13
        movw    r11,r12
_40:
        addw    r13,#01h
_38:
        cmpw    r13,[r3]
        jmp     cc_slt,_39
        cmpw    r2,#00h
        jmp     cc_slt,_41
        movw    r11,r2
        shl     r11,#03h
        subw    r11,r2
        shl     r11,#01h
        movw    r12,#8300h
        movw    [r11+#dpp2:_ZugStapel+0ch],r12
_41:
        ret
_naechstbesterzug endp
        ; End of function
        ; End of section

        global  _alpha_beta
; Function _alpha_beta
_alpha_beta     proc    far
        call    __save_3
        movw    r8,r2
        movw    r9,r3
        movw    r10,r4
        subw    _KnotenAnzahl,ONES
        subcw   _KnotenAnzahl+02h,ONES
        call    __cocofun_8
        movw    r4,_Farbe
        call    _bewerte_stellung
        movw    r6,r2
        movw    r1,_InSchach
        cmpw    r1,#01h
        jmp     cc_ne,_43
        movw    r13,_Tiefe
        movw    r11,r13
        addw    r11,r10
        movw    r12,#01h
        addw    r12,_MaxErweiterung
        cmpw    r11,r12
        jmp     cc_slt,_44
_43:
        movw    r13,_Tiefe
        cmpw    r13,#02h
        jmp     cc_slt,_45
        movw    r11,r13
        addw    r11,r10
        cmpw    r11,_MaxErweiterung
        jmp     cc_sge,_46
        movw    r11,r13
        shl     r11,#01h
        movw    r12,[r11+#_NachFeld]
        movw    r11,[r11+#_NachFeld+0fffeh]
        cmpw    r12,r11
        jmp     cc_ne,_47
        movw    r11,r8
        subw    r11,#96h
        cmpw    r6,r11
        jmp     cc_slt,_48
        movw    r11,r9
        addw    r11,#96h
        cmpw    r6,r11
        jmp     cc_sgt,_49
_44:
        addw    r10,#01h
_49:
_48:
_47:
_46:
_45:
        cmpw    r10,#0fffbh
        jmp     cc_slt,_50
        movw    r11,#7d00h
        subw    r11,r13
        cmpw    r6,r11
        jmp     cc_eq,_51
        cmpw    r13,#14h
        jmp     cc_sge,_52
        cmpw    r6,r9
        jmp     cc_slt,_53
        movw    r11,r10
        addw    r11,r1
        cmpw    r11,#01h
        jmp     cc_sgt,_54
_50:
_51:
_52:
        movw    r2,r6
        jmp     _55
_54:
_53:
        movw    r2,r10
        call    _generiere_zuege
        cmpw    r10,#00h
        jmp     cc_sle,_56
        movw    r7,#8300h
        jmp     _58
_56:
        movw    r7,r6
        jmp     _58
_59:
        movw    r2,r0
        call    _zug_ausfuehren
        movw    r2,r9
        negw    r2
        movw    r3,r8
        negw    r3
        movw    r4,r10
        subw    r4,#01h
        call    _alpha_beta
        negw    r2
        movw    r6,r2
        movw    r2,r0
        call    _zug_zuruecknehmen
        cmpw    r6,r7
        jmp     cc_sle,_60
        movw    r7,r6
        cmpw    r6,r9
        jmp     cc_slt,_61
        cmpw    r10,#00h
        jmp     cc_sle,_62
        movw    r2,r0
        call    _kopiere_hvar
        jmp     _63
_61:
        cmpw    r6,r8
        jmp     cc_sle,_64
        cmpw    r10,#00h
        jmp     cc_sle,_65
        movw    r2,r0
        call    _kopiere_hvar
_65:
        movw    r8,r6
_64:
_60:
_58:
        call    _naechstbesterzug
        movw    r0,r2
        cmpw    r0,#00h
        jmp     cc_sge,_59
_62:
_63:
        cmpw    r6,r9
        jmp     cc_slt,_66
        cmpw    r0,#00h
        jmp     cc_slt,_67
        movw    r11,_Tiefe
        shl     r11,#03h
        addw    r11,#dpp2:_KillerTab
        movw    r12,r11
        addw    r12,#04h
        movw    r13,r11
        movw    [r12],[r13+]
        movw    r13,[r13]
        movw    [r12+#02h],r13
        movw    r12,r0
        shl     r12,#03h
        subw    r12,r0
        shl     r12,#01h
        addw    r12,#dpp2:_ZugStapel
        movw    [r11],[r12]
        movw    r12,[r12+#02h]
        movw    [r11+#02h],r12
_67:
_66:
        movw    r11,#7cffh
        subw    r11,_Tiefe
        negw    r11
        cmpw    r7,r11
        jmp     cc_ne,_68
        cmpw    r1,#00h
        jmp     cc_ne,_69
        movw    r2,#00h
        jmp     _70
_69:
_68:
        movw    r2,r7
_70:
_55:
        jmp     __restore_4
        ret
_alpha_beta endp
        ; End of function
        ; End of section

        global  _kopiere_hvar
; Function _kopiere_hvar
_kopiere_hvar   proc    far
        movw    r11,r2
        shl     r11,#03h
        subw    r11,r2
        shl     r11,#01h
        addw    r11,#dpp2:_ZugStapel
        call    __cocofun_22
        addw    r13,#dpp2:_HVar
        shl     r12,#02h
        addw    r13,r12
        movw    [r13],[r11]
        movw    r11,[r11+#02h]
        movw    [r13+#02h],r11
        movw    r11,#01h
        call    __cocofun_22
        movw    r14,#dpp2:_HVar+50h
        addw    r14,r13
        addw    r13,#dpp2:_HVar
        movw    r4,r12
        shl     r4,#02h
        addw    r13,r4
        shl     r12,#02h
        addw    r14,r12
_72:
        movw    r12,r11
        shl     r12,#02h
        movw    r4,r13
        addw    r4,r12
        movw    r5,r14
        addw    r5,r12
        movw    r12,[r5]
        jmp     cc_ne,_73
        movw    [r4],[r5+]
        movw    r5,[r5]
        movw    [r4+#02h],r5
        ret
_73:
        movw    [r4],[r5+]
        movw    r5,[r5]
        movw    [r4+#02h],r5
        addw    r11,#01h
        jmp     _72
        ret
_kopiere_hvar endp
        ; End of function
        ; End of section

; Function __cocofun_22
__cocofun_22    proc    far
; Function body __cocofun_22
        movw    r12,_Tiefe
        movw    r13,r12
        shl     r13,#02h
        addw    r13,r12
        shl     r13,#04h
        ret
__cocofun_22 endp
        ; End of function
        ; End of section

        global  _zug_ausfuehren
; Function _zug_ausfuehren
_zug_ausfuehren proc    far
        movw    [-r15],r8
        movw    [-r15],r9
        movw    r11,r2
        subw    _ZugNr,ONES
        shl     r2,#03h
        subw    r2,r11
        shl     r2,#01h
        addw    r2,#dpp2:_ZugStapel
        movw    r14,[r2]
        movw    r4,[r2+#02h]
        movw    r5,[r2+#0ah]
        movw    _LetzterZug,r11
        subw    _Tiefe,ONES
        movw    r13,_Tiefe
        shl     r13,#01h
        movw    [r13+#_NachFeld],r4
        addw    r13,#dpp2:_Ep_Feld
        movw    [r13],ZEROS
        call    __cocofun_9
        movw    r3,r11
        addw    r3,#dpp2:_MatBilanz
        movw    r12,[r11+#dpp2:_MatBilanz+0fffeh]
        negw    r12
        movw    [r3],r12
        movw    r8,_Tiefe
        shl     r8,#01h
        addw    r8,#dpp2:_MatSumme
        movw    r11,[r11+#dpp2:_MatSumme+0fffeh]
        movw    [r8],r11
        shl     r14,#01h
        movw    r11,r14
        addw    r11,#dpp2:_Bewegt
        movw    r12,[r11]
        addw    r12,#01h
        movw    [r11],r12
        movw    r9,r4
        shl     r9,#01h
        movw    r11,r9
        addw    r11,#dpp2:_Bewegt
        movw    r12,[r11]
        addw    r12,#01h
        movw    [r11],r12
        cmpw    r5,#00h
        jmp     cc_eq,_75
        movw    r11,r5
        shl     r11,#01h
        addw    r11,#dpp2:_Brett
        movw    r12,[r11]
        jmp     cc_ne,_76
        movw    [r13],r5
        jmp     _77
_76:
        movw    [r11],ZEROS
        movw    r11,[r3]
        subw    r11,#64h
        movw    [r3],r11
        jmp     _78
_75:
        movw    r11,[r2+#04h]
        jmp     cc_eq,_79
        shl     r11,#01h
        movw    r11,[r11+#dpp1:_FigMaterial]
        movw    r12,[r3]
        subw    r12,r11
        movw    [r3],r12
        cmpw    r11,#64h
        jmp     cc_eq,_80
        movw    r12,[r8]
        subw    r12,r11
        movw    [r8],r12
_80:
_79:
_77:
_78:
        addw    r14,#dpp2:_Brett
        movw    r13,r9
        addw    r13,#dpp2:_Brett
        movw    [r13],[r14]
        movw    [r14],ZEROS
        movw    r11,[r2+#06h]
        jmp     cc_eq,_81
        movw    r12,_Farbe
        mulu    r12,r11
        movw    [r13],MDL
        shl     r11,#01h
        movw    r11,[r11+#dpp1:_FigMaterial]
        subw    r11,#64h
        movw    r12,[r3]
        subw    r12,r11
        movw    [r3],r12
        movw    r2,r8
        addw    r11,[r2]
        addw    r11,#64h
        movw    [r8],r11
        jmp     _82
_81:
        movw    r11,#08h
        addw    r11,r2
        movw    r12,[r11]
        cmpw    r12,#01h
        jmp     cc_ne,_83
        movw    r11,#00h
        movw    [r9+#dpp2:_Brett+02h],r11
        movw    r11,_Farbe
        shl     r11,#01h
        movw    [r9+#dpp2:_Brett+0fffeh],r11
        jmp     _84
_83:
        movw    r11,[r11]
        cmpw    r11,#02h
        jmp     cc_ne,_85
        movw    r11,#00h
        movw    [r9+#dpp2:_Brett+0fffch],r11
        movw    r11,_Farbe
        shl     r11,#01h
        movw    [r9+#dpp2:_Brett+02h],r11
_84:
        movw    r12,#01h
        movw    [r11+#dpp2:_Rochade+02h],r12
_85:
_82:
        movw    r11,[r13]
        cmpw    r11,#06h
        jmp     cc_ne,_86
        movw    _wKoenig,r4
        jmp     _87
_86:
        call    __cocofun_23
_87:
        movw    r11,_Farbe
        negw    r11
        movw    _Farbe,r11
        movw    r9,[r15+]
        movw    r8,[r15+]
        ret
_zug_ausfuehren endp
        ; End of function
        ; End of section

; Function __cocofun_23
__cocofun_23    proc    far
; Function body __cocofun_23
        cmpw    r11,#0fffah
        jmp     cc_ne,_88
        movw    _sKoenig,r4
_88:
        ret
__cocofun_23 endp
        ; End of function
        ; End of section

        global  _zug_zuruecknehmen
; Function _zug_zuruecknehmen
_zug_zuruecknehmen      proc    far
        addw    _ZugNr,ONES
        movw    r5,r2
        shl     r5,#03h
        subw    r5,r2
        shl     r5,#01h
        addw    r5,#dpp2:_ZugStapel
        movw    r4,[r5]
        movw    r2,[r5+#02h]
        movw    r11,[r5+#0ah]
        movw    r12,_Farbe
        negw    r12
        movw    _Farbe,r12
        addw    _Tiefe,ONES
        shl     r2,#01h
        movw    r12,r2
        addw    r12,#dpp2:_Brett
        movw    r13,r4
        shl     r13,#01h
        movw    r3,r13
        addw    r3,#dpp2:_Brett
        movw    [r3],[r12]
        movw    [r12],ZEROS
        cmpw    r11,#00h
        jmp     cc_eq,_89
        movw    r14,[r5+#04h]
        cmpw    r14,#01h
        jmp     cc_ne,_90
        shl     r11,#01h
        movw    r12,_Farbe
        negw    r12
        movw    [r11+#dpp2:_Brett],r12
        jmp     _91
_90:
_89:
        movw    r11,[r5+#04h]
        jmp     cc_eq,_92
        movw    r14,_Farbe
        negw    r14
        mulu    r14,r11
        movw    [r12],MDL
_92:
_91:
        addw    r13,#dpp2:_Bewegt
        movw    r11,[r13]
        subw    r11,#01h
        movw    [r13],r11
        movw    r11,r2
        addw    r11,#dpp2:_Bewegt
        movw    r12,[r11]
        subw    r12,#01h
        movw    [r11],r12
        movw    r11,#08h
        addw    r11,r5
        movw    r12,[r11]
        cmpw    r12,#01h
        jmp     cc_ne,_93
        movw    r11,_Farbe
        shl     r11,#01h
        movw    [r2+#dpp2:_Brett+02h],r11
        movw    r12,#00h
        movw    [r2+#dpp2:_Brett+0fffeh],r12
        jmp     _94
_93:
        movw    r11,[r11]
        cmpw    r11,#02h
        jmp     cc_ne,_95
        movw    r11,_Farbe
        shl     r11,#01h
        movw    [r2+#dpp2:_Brett+0fffch],r11
        movw    r12,#00h
        movw    [r2+#dpp2:_Brett+02h],r12
_94:
        movw    r12,#00h
        movw    [r11+#dpp2:_Rochade+02h],r12
_95:
        movw    r11,[r5+#06h]
        jmp     cc_eq,_96
        movw    [r3],_Farbe
_96:
        movw    r11,[r3]
        cmpw    r11,#06h
        jmp     cc_ne,_97
        movw    _wKoenig,r4
        ret
_97:
jmp __cocofun_23
ret
_zug_zuruecknehmen endp
; End of function
; End of section

global _sbauerbewertung
; Function _sbauerbewertung
_sbauerbewertung proc far
movw [-r15],r8
movw [-r15],r9
movw r13,#0bh
subw r13,r3
call __cocofun_9
movw r14,[r11+#dpp2:_MatSumme]
cmpw r14,#0a8ch
jmp cc_sle,_100
movw r11,r2
shl r11,#01h
movw r8,[r11+#dpp1:_sBFeldWert]
cmpw r5,#04h
jmp cc_sge,_101
cmpw r4,#06h
jmp cc_sge,_102
cmpw r4,#02h
jmp cc_sgt,_103
_102:
cmpw r13,#04h
jmp cc_sle,_104
subw r8,#0fh
jmp _105
_100:
movw r8,r13
shl r8,#02h
_101:
_103:
_104:
_105:
shl r4,#02h
movw r11,r4
addw r11,#dpp2:_Bauern
movw r12,[r4+#dpp2:_Bauern+0fffeh]
jmp cc_ne,_106
movw r12,[r4+#dpp2:_Bauern+06h]
jmp cc_ne,_107
subw r8,#0ch
movw r12,[r4+#dpp2:_Bauern+02h]
cmpw r12,#01h
jmp cc_sle,_108
subw r8,#0ch
_108:
_107:
_106:
movw r12,[r4+#dpp2:_Bauern+02h]
cmpw r12,#01h
jmp cc_sle,_109
subw r8,#0fh
_109:
movw r5,r2
shl r5,#02h
movw r9,[r5+#dpp2:_BKontrolle+02h]
cmpw r9,#00h
jmp cc_sgt,_110
movw r12,[r5+#dpp2:_BKontrolle+0ffdah]
cmpw r12,#00h
jmp cc_sle,_111
_110:
addw r8,r13
_111:
movw r11,[r11]
jmp cc_ne,_112
cmpw r9,#00h
jmp cc_ne,_113
;---------------------------------------
; TEST
movw r3,#dpp2:_BKontrolle-28h
; movw r3,#dpp2:_BKontrolle+0ffd8h
;---------------------------------------
addw r3,r5
movw r11,[r5+#dpp2:_BKontrolle+0ffdah]
cmpw r11,[r3]
jmp cc_sge,_114
subw r8,#0ah
movw r11,[r4+#dpp2:_Tuerme]
cmpw r11,#00h
jmp cc_sle,_115
subw r8,#08h
jmp _116
_114:
_113:
movw r11,r2
movw r12,r2
shl r12,#02h
addw r12,#dpp2:_BKontrolle
jmp _117
_118:
movw r3,[r12]
cmpw r3,#00h
jmp cc_sgt,_119
subw r12,#28h
subw r11,#0ah
_117:
cmpw r11,#26h
jmp cc_sgt,_118
cmpw r14,#0a8ch
jmp cc_sge,_120
movw r11,r13
shl r11,#04h
addw r8,r11
movw r11,r4
addw r11,#dpp2:_Tuerme
movw r12,[r4+#dpp2:_Tuerme+02h]
cmpw r12,#00h
jmp cc_sle,_121
movw r12,r13
shl r12,#01h
addw r8,r12
_121:
movw r11,[r11]
cmpw r11,#00h
jmp cc_sle,_122
movw r11,r13
shl r11,#01h
subw r8,r11
_122:
cmpw r14,#00h
jmp cc_ne,_123
movw r11,r13
shl r11,#03h
addw r8,r11
_123:
cmpw r9,#00h
jmp cc_sgt,_124
movw r11,[r5+#dpp2:_BKontrolle+0ffdah]
cmpw r11,#00h
jmp cc_sle,_125
_124:
movw r11,r13
shl r11,#02h
addw r8,r11
_125:
shl r2,#01h
movw r11,[r2+#dpp2:_Brett+0ffech]
cmpw r11,#00h
jmp cc_sge,_126
movw r11,[r5+#dpp2:_BKontrolle+0ffdah]
jmp cc_ne,_127
shl r13,#02h
subw r8,r13
jmp _128
_120:
movw r11,r13
shl r11,#03h
addw r8,r11
cmpw r9,#00h
jmp cc_sgt,_129
movw r11,[r5+#dpp2:_BKontrolle+0ffdah]
cmpw r11,#00h
jmp cc_sle,_130
_129:
shl r13,#01h
addw r8,r13
_130:
_126:
_127:
_128:
_115:
_116:
_112:
_119:
movw r2,r8
movw r9,[r15+]
movw r8,[r15+]
ret
_sbauerbewertung endp
; End of function
; End of section

global _wbauerbewertung
; Function _wbauerbewertung
_wbauerbewertung proc far
movw [-r15],r0
movw [-r15],r8
call __cocofun_9
movw r13,[r11+#dpp2:_MatSumme]
cmpw r13,#0a8ch
jmp cc_sle,_132
movw r11,r2
shl r11,#01h
movw r14,[r11+#dpp1:_wBFeldWert]
cmpw r5,#04h
jmp cc_sge,_133
cmpw r4,#06h
jmp cc_sge,_134
cmpw r4,#02h
jmp cc_sgt,_135
_134:
cmpw r3,#04h
jmp cc_sle,_136
subw r14,#0fh
jmp _137
_132:
movw r14,r3
shl r14,#02h
_133:
_135:
_136:
_137:
shl r4,#02h
movw r11,r4
addw r11,#dpp2:_Bauern
movw r12,[r4+#dpp2:_Bauern+0fffch]
jmp cc_ne,_138
movw r12,[r4+#dpp2:_Bauern+04h]
jmp cc_ne,_139
subw r14,#0ch
movw r12,[r11]
cmpw r12,#01h
jmp cc_sle,_140
subw r14,#0ch
_140:
_139:
_138:
movw r11,[r11]
cmpw r11,#01h
jmp cc_sle,_141
subw r14,#0fh
_141:
movw r5,r2
shl r5,#02h
movw r8,[r5+#dpp2:_BKontrolle]
cmpw r8,#00h
jmp cc_sgt,_142
call __cocofun_15
jmp cc_sle,_143
_142:
addw r14,r3
_143:
movw r11,[r4+#dpp2:_Bauern+02h]
jmp cc_ne,_144
cmpw r8,#00h
jmp cc_ne,_145
movw r0,#dpp2:_BKontrolle+28h
addw r0,r5
movw r11,[r5+#dpp2:_BKontrolle+2ah]
cmpw r11,[r0]
jmp cc_sle,_146
subw r14,#0ah
movw r11,[r4+#dpp2:_Tuerme+02h]
cmpw r11,#00h
jmp cc_sle,_147
subw r14,#08h
jmp _148
_146:
_145:
movw r11,r2
jmp _149
_150:
movw r12,r11
shl r12,#02h
movw r12,[r12+#dpp2:_BKontrolle+02h]
cmpw r12,#00h
jmp cc_sgt,_151
addw r11,#0ah
_149:
cmpw r11,#51h
jmp cc_slt,_150
cmpw r13,#0a8ch
jmp cc_sge,_152
movw r11,r3
shl r11,#04h
addw r14,r11
movw r11,[r4+#dpp2:_Tuerme]
cmpw r11,#00h
jmp cc_sle,_153
movw r11,r3
shl r11,#01h
addw r14,r11
_153:
movw r11,[r4+#dpp2:_Tuerme+02h]
cmpw r11,#00h
jmp cc_sle,_154
movw r11,r3
shl r11,#01h
subw r14,r11
_154:
cmpw r13,#00h
jmp cc_ne,_155
movw r11,r3
shl r11,#03h
addw r14,r11
_155:
cmpw r8,#00h
jmp cc_sgt,_156
call __cocofun_15
jmp cc_sle,_157
_156:
movw r11,r3
shl r11,#02h
addw r14,r11
_157:
shl r2,#01h
movw r11,[r2+#dpp2:_Brett+14h]
cmpw r11,#00h
jmp cc_sge,_158
movw r11,#dpp2:_BKontrolle+28h
addw r11,r5
movw r11,[r11]
jmp cc_ne,_159
shl r3,#02h
subw r14,r3
jmp _160
_152:
movw r11,r3
shl r11,#03h
addw r14,r11
cmpw r8,#00h
jmp cc_sgt,_161
call __cocofun_15
jmp cc_sle,_162
_161:
shl r3,#01h
addw r14,r3
_162:
_158:
_159:
_160:
_147:
_148:
_144:
_151:
movw r2,r14
movw r8,[r15+]
movw r0,[r15+]
ret
_wbauerbewertung endp
; End of function
; End of section

; Function __cocofun_15
__cocofun_15 proc far
; Function body __cocofun_15
movw r11,#dpp2:_BKontrolle+28h
addw r11,r5
movw r11,[r11]
cmpw r11,#00h
ret
__cocofun_15 endp
; End of function
; End of section

global _bewerte_stellung
; Function _bewerte_stellung
_bewerte_stellung proc far
call __save_3
subw r15,#1ch
movw r8,r2
movw r9,r3
movw [r15+#1ah],r4
cmpw r4,#01h
jmp cc_ne,_164
call __cocofun_24
jmp cc_eq,_165
movw r2,_wKoenig
movw r3,#0ffffh
jmp _166
_164:
call __cocofun_16
jmp cc_ne,_167
_165:
movw r2,#7d00h
subw r2,_Tiefe
jmp _168
_167:
movw r2,_sKoenig
movw r3,#01h
_166:
call _attackiert_feld
movw _InSchach,r2
call __cocofun_9
movw r12,[r11+#dpp2:_MatBilanz]
movw [r15+#18h],r12
movw r11,[r11+#dpp2:_MatSumme]
movw [r15+#0ch],r11
cmpw r11,#02bch
jmp cc_sle,_169
subw r8,#15eh
movw r11,[r15+#18h]
cmpw r11,r8
jmp cc_slt,_170
addw r9,#015eh
cmpw r11,r9
jmp cc_sle,_171
_170:
movw r2,[r15+#18h]
jmp _172
_171:
_169:
call _init_bewertung
movw r8,#00h
movw [r15+#10h],r8
movw [r15+#0eh],r8
movw [r15+#06h],r8
movw [r15+#12h],r8
movw [r15+#14h],r8
movw r11,_Rochade+04h
movw [r15+#16h],r11
movw r1,_Rochade
movw r11,r8
cmpw ZEROS,_Bewegt+2ch
jmp cc_sge,_173
movw r11,#01h
_173:
movw r12,[r15+#16h]
addw r12,r11
movw [r15+#0ah],r12
movw r11,#00h
cmpw ZEROS,_Bewegt+2eh
call __cocofun_3
cmpw ZEROS,_Bewegt+34h
call __cocofun_3
cmpw ZEROS,_Bewegt+36h
call __cocofun_3
cmpw ZEROS,_Bewegt+0b8h
jmp cc_sge,_177
movw r11,#01h
_177:
movw r12,r1
addw r12,r11
movw [r15],r12
movw r11,#00h
cmpw ZEROS,_Bewegt+0bah
call __cocofun_17
cmpw ZEROS,_Bewegt+0c0h
call __cocofun_17
cmpw ZEROS,_Bewegt+0c2h
call __cocofun_27
movw r11,#02h
movw [r15+#08h],r11
_181:
movw r9,[r15+#08h]
shl r9,#02h
movw r11,[r15+#08h]
addw r9,r11
shl r9,#01h
addw r9,#01h
movw r10,#01h
movw r7,r9
shl r7,#01h
movw r11,r7
addw r11,#dpp2:_Brett
movw [r15+#02h],r11
addw r7,#dpp1:_ZentrumTab
movw r0,#dpp2:_Bauern+04h
addw r11,#14h
movw [r15+#04h],r11
_182:
movw r11,[r15+#02h]
movw r6,[r11]
cmpw r6,#0fffah
jmp cc_ne,_183
movw r11,[r15+#0ch]
cmpw r11,#0a8ch
jmp cc_sge,_184
movw r2,r7
subw r8,[r2]
jmp _185
_184:
movb rh4,#00h
cmpw r1,#00h
call __cocofun_11
cmpw ZEROS,_Bewegt+0beh
jmp cc_sge,_187
movb rl4,#01h
_187:
movb rh5,#00h
cmpw ZEROS,_Bewegt+0c4h
jmp cc_sge,_188
movb rh5,#01h
_188:
movb rl5,#00h
cmpw ZEROS,_Bewegt+0b6h
jmp cc_sge,_189
movb rl5,#01h
_189:
andb rh5,rl5
orb rl4,rh5
andb rh4,rl4
jmp cc_eq,_190
addw r8,#23h
_190:
movw r11,[r7]
shl r11,#02h
addw r8,r11
movw r12,#0ffffh
movw r13,r10
shl r13,#02h
movw r14,r9
shl r14,#01h
movw r5,r13
addw r5,#dpp2:_Tuerme
addw r13,#dpp2:_Bauern
addw r5,#0fffch
addw r13,#0fffch
_191:
movw r11,r12
shl r11,#01h
movw r4,r11
addw r4,r14
movw r4,[r4+#dpp2:_Brett+0ffech]
cmpw r4,#0ffffh
jmp cc_ne,_192
subw r8,#0fh
_192:
addw r11,r14
movw r11,[r11+#dpp2:_Brett+0ffd8h]
cmpw r11,#0ffffh
jmp cc_ne,_193
subw r8,#06h
_193:
movb rh4,#00h
movw r11,[r13]
jmp cc_ne,_194
movb rh4,#01h
_194:
movb rl4,#00h
movw r11,[r5]
cmpw r11,#00h
jmp cc_sle,_195
movb rl4,#01h
_195:
andb rh4,rl4
jmp cc_eq,_196
addw r8,#0ch
_196:
addw r5,#04h
addw r13,#04h
cmpi1 r12,#00h
jmp cc_sle,_191
_185:
_183:
cmpw r6,#0fffbh
jmp cc_ne,_197
movw r11,[r15]
cmpw r11,#04h
jmp cc_sge,_198
cmpw r9,#5bh
jmp cc_sge,_199
addw r8,#0fh
jmp _200
_198:
movw r11,#0ah
movw MDL,_wKoenig
call __cocofun_5
movw MDL,_wKoenig
call __cocofun_6
addw r8,r12
_199:
_200:
_197:
cmpw r6,#0fffch
jmp cc_ne,_201
movw r11,[r7]
movw r12,r11
shr r12,#0fh
addw r12,r11
ashr r12,#01h
subw r8,r12
_201:
cmpw r6,#0fffdh
jmp cc_ne,_202
;-----------------------------------
;TEST
movw r11,dpp3:0ff00h
; movw r11,0ff00h
;-----------------------------------
shr r11,#06h
andw r11,#01h
movb rh4,#00h
cmpw r9,r11
call __cocofun_11
cmpw r9,#4bh
call __cocofun_25
orb rh4,rl4
movw r11,[r15+#04h]
movw r11,[r11]
movb rl4,#00h
cmpw r11,#0ffffh
call __cocofun_25
andb rh4,rl4
jmp cc_eq,_206
addw r8,#14h
_206:
movw r11,[r15+#10h]
addw r11,#01h
movw [r15+#10h],r11
_202:
cmpw r6,#0fffeh
jmp cc_ne,_207
movw r11,#00h
cmpw r9,#26h
jmp cc_sgt,_208
movw r11,#01h
_208:
movw r12,[r15+#14h]
addw r12,r11
movw [r15+#14h],r12
call __cocofun_4
subw r8,r11
movw r11,[r0]
jmp cc_ne,_211
subw r8,#08h
movw r11,[r0+#02h]
jmp cc_ne,_212
subw r8,#05h
_212:
_211:
_207:
cmpw r6,#0ffffh
jmp cc_ne,_213
movw r2,r9
movw r3,[r15+#08h]
movw r4,r10
movw r5,[r15]
call _sbauerbewertung
subw r8,r2
movw r11,[r15+#06h]
addw r11,#01h
movw [r15+#06h],r11
_213:
cmpw r6,#01h
jmp cc_ne,_214
movw r2,r9
movw r3,[r15+#08h]
movw r4,r10
movw r5,[r15+#0ah]
call _wbauerbewertung
addw r8,r2
movw r11,[r15+#06h]
addw r11,#01h
movw [r15+#06h],r11
_214:
cmpw r6,#02h
jmp cc_ne,_215
;-----------------------------------
; TEST
movw r11,dpp3:0ff04h
; movw r11,0ff04h
;-----------------------------------
shr r11,#07h
andw r11,#01h
cmpw r9,r11
movw r11,#01h
subcw r11,#00h
movw r12,[r15+#12h]
addw r12,r11
movw [r15+#12h],r12
call __cocofun_4
addw r8,r11
movw r11,[r0+#02h]
jmp cc_ne,_218
addw r8,#08h
movw r11,[r0]
jmp cc_ne,_219
addw r8,#05h
_219:
_218:
_215:
cmpw r6,#03h
jmp cc_ne,_220
movw r11,r9
shl r11,#01h
;-----------------------------------
; TEST
movw r12,dpp3:0ff00h
; movw r12,0ff00h
;-----------------------------------
shr r12,#03h
andw r12,#01h
movb rh4,#00h
cmpw r9,r12
call __cocofun_11
cmpw r9,#2dh
call __cocofun_25
orb rh4,rl4
movw r11,[r11+#dpp2:_Brett+0ffech]
movb rl4,#00h
cmpw r11,#01h
call __cocofun_25
andb rh4,rl4
jmp cc_eq,_224
subw r8,#14h
_224:
movw r11,[r15+#0eh]
addw r11,#01h
movw [r15+#0eh],r11
_220:
cmpw r6,#04h
jmp cc_ne,_225
movw r11,[r7]
movw r12,r11
shr r12,#0fh
addw r12,r11
ashr r12,#01h
addw r8,r12
_225:
cmpw r6,#05h
jmp cc_ne,_226
movw r11,[r15+#0ah]
cmpw r11,#04h
jmp cc_sge,_227
cmpw r9,#1ch
jmp cc_sle,_228
subw r8,#0fh
jmp _229
_227:
movw r11,#0ah
movw MDL,_sKoenig
call __cocofun_5
movw MDL,_sKoenig
call __cocofun_6
subw r8,r12
_228:
_229:
_226:
cmpw r6,#06h
jmp cc_ne,_230
movw r11,[r15+#0ch]
cmpw r11,#0a8ch
jmp cc_sge,_231
movw r2,r7
addw r8,[r2]
movw r11,_sKoenig
movw r2,r9
subw r2,r11
call _abs
movb rh4,#00h
cmpw r2,#02h
call __cocofun_11
cmpw r2,#14h
call __cocofun_25
orb rl4,rh4
jmp cc_eq,_234
movw r11,#0ah
movw r12,[r15+#0ch]
jmp cc_ne,_235
movw r11,#1eh
_235:
movw r12,#01h
cmpw r12,_Farbe
jmp cc_ne,_236
subw r8,r11
jmp _237
_236:
addw r8,r11
jmp _238
_231:
movb rh4,#00h
movw r11,[r15+#16h]
call __cocofun_11
cmpw ZEROS,_Bewegt+32h
jmp cc_sge,_240
movb rl4,#01h
_240:
movb rh5,#00h
cmpw ZEROS,_Bewegt+38h
jmp cc_sge,_241
movb rh5,#01h
_241:
;-----------------------------------
; TEST
movw r11,dpp3:0ff04h
; movw r11,0ff04h
;-----------------------------------
shr r11,#01h
andw r11,#01h
shl r11,#01h
movb rl5,#00h
movw r11,[r11+#dpp2:_Bewegt]
cmpw r11,#00h
jmp cc_sle,_242
movb rl5,#01h
_242:
andb rh5,rl5
orb rl4,rh5
andb rh4,rl4
jmp cc_eq,_243
subw r8,#23h
_243:
movw r11,[r7]
shl r11,#02h
subw r8,r11
movw r13,#0ffffh
movw r14,r10
shl r14,#02h
movw r5,r9
shl r5,#01h
addw r5,#dpp2:_Brett
addw r5,#0fffeh
_244:
movw r11,r5
addw r5,#02h
movw r12,[r11+#14h]
cmpw r12,#01h
jmp cc_ne,_245
addw r8,#0fh
_245:
movw r11,[r11+#28h]
cmpw r11,#01h
jmp cc_ne,_246
addw r8,#06h
_246:
movw r11,r13
shl r11,#02h
movw r12,r11
addw r12,r14
movb rh4,#00h
movw r12,[r12+#dpp2:_Bauern+02h]
jmp cc_ne,_247
movb rh4,#01h
_247:
addw r11,r14
movb rl4,#00h
movw r11,[r11+#dpp2:_Tuerme+02h]
cmpw r11,#00h
jmp cc_sle,_248
movb rl4,#01h
_248:
andb rh4,rl4
jmp cc_eq,_249
subw r8,#0ch
_249:
cmpi1 r13,#01h
jmp cc_slt,_244
_234:
_237:
_238:
_230:
addw r0,#04h
movw r11,[r15+#02h]
addw r11,#02h
movw [r15+#02h],r11
addw r7,#02h
movw r11,[r15+#04h]
addw r11,#02h
movw [r15+#04h],r11
addw r9,#01h
cmpi1 r10,#07h
jmp cc_sle,_182
movw r11,[r15+#08h]
cmpi1 r11,#09h
movw [r15+#08h],r11
jmp cc_ult,_181
movw r11,[r15+#06h]
jmp cc_ne,_250
movw r11,[r15+#0ch]
cmpw r11,#15eh
jmp cc_sle,_251
cmpw r11,#28ah
jmp cc_eq,_252
call __cocofun_9
movw r2,[r11+#dpp2:_MatBilanz]
call _abs
cmpw r2,#64h
jmp cc_sge,_253
movw r11,[r15+#0ch]
cmpw r11,#02bch
jmp cc_sgt,_254
_252:
_251:
movw r2,#00h
jmp _255
_254:
_253:
_250:
movw r11,_Tiefe
movw r12,[r15+#0eh]
cmpw r12,#02h
jmp cc_slt,_256
addw r8,#0fh
_256:
movw r12,[r15+#10h]
cmpw r12,#02h
jmp cc_slt,_257
subw r8,#0fh
_257:
movw r12,[r15+#12h]
cmpw r12,#00h
jmp cc_sle,_258
movw r12,_sKoenig
cmpw r12,#51h
jmp cc_slt,_259
addw r8,#0ah
movw r12,[r15+#12h]
cmpw r12,#01h
jmp cc_sle,_260
addw r8,#19h
_260:
_259:
_258:
movw r12,[r15+#14h]
cmpw r12,#00h
jmp cc_sle,_261
movw r12,_wKoenig
cmpw r12,#26h
jmp cc_sgt,_262
subw r8,#0ah
movw r12,[r15+#14h]
cmpw r12,#01h
jmp cc_sle,_263
subw r8,#19h
_263:
_262:
_261:
movw r12,[r15+#1ah]
cmpw r12,#0ffffh
jmp cc_ne,_264
negw r8
_264:
cmpw r11,#01h
jmp cc_slt,_265
shl r11,#01h
movw r12,[r11+#dpp2:_Mobilitaet]
movw r11,[r11+#dpp2:_Mobilitaet+0fffeh]
subw r12,r11
movw r11,r12
ashr r11,#03h
shr r11,#0ch
addw r11,r12
ashr r11,#04h
subw r8,r11
_265:
movw r2,[r15+#18h]
addw r2,r8
_255:
_172:
_168:
addw r15,#1ch
jmp __restore_4
ret
_bewerte_stellung endp
; End of function
; End of section

; Function __cocofun_27
__cocofun_27 proc far
; Function body __cocofun_27
jmp cc_sge,_180
movw r11,#01h
_180:
movw r12,[r15]
addw r12,r11
movw [r15],r12
ret
__cocofun_27 endp
; End of function
; End of section

; Function __cocofun_25
__cocofun_25 proc far
; Function body __cocofun_25
jmp cc_ne,_204
movb rl4,#01h
_204:
ret
__cocofun_25 endp
; End of function
; End of section

; Function __cocofun_24
__cocofun_24 proc far
; Function body __cocofun_24
movw r2,_sKoenig
movw r3,#01h
call _attackiert_feld
cmpw r2,#01h
ret
__cocofun_24 endp
; End of function
; End of section

; Function __cocofun_17
__cocofun_17 proc far
; Function body __cocofun_17
call __cocofun_27
movw r11,#00h
ret
__cocofun_17 endp
; End of function
; End of section

; Function __cocofun_16
__cocofun_16 proc far
; Function body __cocofun_16
movw r2,_wKoenig
movw r3,#0ffffh
call _attackiert_feld
cmpw r2,#01h
ret
__cocofun_16 endp
; End of function
; End of section

; Function __cocofun_11
__cocofun_11 proc far
; Function body __cocofun_11
jmp cc_ne,_186
movb rh4,#01h
_186:
movb rl4,#00h
ret
__cocofun_11 endp
; End of function
; End of section

; Function __cocofun_6
__cocofun_6 proc far
; Function body __cocofun_6
div r11
movw r2,MDH
movw MDL,r9
div r11
subw r2,MDH
call _abs
addw r12,r2
shl r12,#01h
ret
__cocofun_6 endp
; End of function
; End of section

; Function __cocofun_5
__cocofun_5 proc far
; Function body __cocofun_5
div r11
movw r2,MDL
movw MDL,r9
div r11
subw r2,MDL
call _abs
movw r12,r2
movw r11,#0ah
ret
__cocofun_5 endp
; End of function
; End of section

; Function __cocofun_4
__cocofun_4 proc far
; Function body __cocofun_4
movb rh4,#00h
cmpw r10,#03h
jmp cc_slt,_209
movb rh4,#01h
_209:
movb rl4,#00h
cmpw r10,#05h
jmp cc_sgt,_210
movb rl4,#01h
_210:
andb rh4,rl4
movbz r11,rh4
shl r11,#02h
ret
__cocofun_4 endp
; End of function
; End of section

; Function __cocofun_3
__cocofun_3 proc far
; Function body __cocofun_3
jmp cc_sge,_174
movw r11,#01h
_174:
movw r12,[r15+#0ah]
addw r12,r11
movw [r15+#0ah],r12
movw r11,#00h
ret
__cocofun_3 endp
; End of function
; End of section

global _notiere_zug
; Function _notiere_zug
_notiere_zug proc far
movw r13,r2
movw r14,r3
shl r2,#01h
movw r11,[r2+#dpp2:_Brett]
movw r12,#01h
cmpw r12,_Farbe
jmp cc_ne,_267
cmpw r11,#03h
jmp cc_eq,_268
cmpw r11,#02h
jmp cc_ne,_269
jmp _270
_267:
cmpw r11,#0fffdh
jmp cc_eq,_271
cmpw r11,#0fffeh
jmp cc_ne,_272
_271:
_268:
_270:
movw r2,_Tiefe
shl r2,#01h
addw r2,#dpp2:_Mobilitaet
movw r11,r14
shl r11,#01h
movw r11,[r11+#dpp1:_ZentrumTab]
addw r11,[r2]
movw [r2],r11
_272:
_269:
movw r3,_Tiefe
movw r2,r3
shl r2,#02h
addw r2,#dpp2:_HVar
cmpw r13,[r2]
jmp cc_ne,_273
movw r11,[r2+#02h]
cmpw r11,r14
jmp cc_ne,_274
call __cocofun_1
movw r11,#01f4h
jmp _275
_274:
_273:
shl r3,#03h
addw r3,#dpp2:_KillerTab
cmpw r13,[r3]
jmp cc_ne,_276
movw r11,[r3+#02h]
cmpw r11,r14
jmp cc_ne,_277
call __cocofun_1
movw r11,#0fah
jmp _278
_277:
_276:
movw r11,[r3+#04h]
cmpw r11,r13
jmp cc_ne,_279
movw r11,[r3+#06h]
cmpw r11,r14
jmp cc_ne,_280
call __cocofun_1
movw r11,#96h
jmp _281
_280:
_279:
call __cocofun_1
movw r11,#00h
_275:
_278:
_281:
movw [r12+#0ch],r11
movw [r12],r13
movw [r12+#02h],r14
movw r11,#00h
movw [r12+#04h],r11
movw [r12+#06h],r11
movw [r12+#08h],r11
movw [r12+#0ah],r11
movw r11,_Index
cmpw r11,#03e8h
jmp cc_sge,_282
subw _Index,ONES
ret
_282:
movw r11,#03h
movw _Message,r11
ret
_notiere_zug endp
; End of function
; End of section

; Function __cocofun_1
__cocofun_1 proc far
; Function body __cocofun_1
call __cocofun_26
addw r12,#dpp2:_ZugStapel
ret
__cocofun_1 endp
; End of function
; End of section

global _notiere_schlagzug
; Function _notiere_schlagzug
_notiere_schlagzug proc far
movw r14,r2
movw r4,r3
shl r3,#01h
movw r2,[r3+#dpp2:_Brett]
cmpw r2,#06h
jmp cc_eq,_284
cmpw r2,#0fffah
jmp cc_eq,_285
call _abs
movw r11,r2
shl r11,#01h
movw r12,[r11+#dpp1:_FigMaterial]
movw r11,_Index
movw r5,r11
shl r5,#03h
subw r5,r11
shl r5,#01h
addw r5,#dpp2:_ZugStapel
movw [r5],r14
movw [r5+#02h],r4
movw [r5+#04h],r2
addw r5,#0ch
movw r11,r14
shl r11,#01h
movw r2,[r11+#dpp2:_Brett]
call _abs
shl r2,#01h
movw r11,[r2+#dpp1:_FigMaterial]
movw r13,r11
ashr r13,#02h
shr r13,#0dh
addw r13,r11
ashr r13,#03h
subw r12,r13
movw [r5],r12
movw r11,_Tiefe
cmpw r11,#00h
jmp cc_sle,_286
shl r11,#01h
movw r11,[r11+#_NachFeld+0fffeh]
cmpw r4,r11
jmp cc_ne,_287
movw r11,[r5]
addw r11,#012ch
movw [r5],r11
_287:
_286:
movw r2,_Tiefe
shl r2,#02h
addw r2,#dpp2:_HVar
cmpw r14,[r2]
jmp cc_ne,_288
movw r11,[r2+#02h]
cmpw r11,r4
jmp cc_ne,_289
movw r11,[r5]
addw r11,#01f4h
jmp _290
_289:
_288:
movw r2,_Tiefe
shl r2,#03h
addw r2,#dpp2:_KillerTab
cmpw r14,[r2]
jmp cc_ne,_291
movw r11,[r2+#02h]
cmpw r11,r4
jmp cc_ne,_292
movw r11,[r5]
addw r11,#0fah
jmp _293
_292:
_291:
movw r11,_Tiefe
shl r11,#03h
movw r11,[r11+#dpp2:_KillerTab+04h]
cmpw r11,r14
jmp cc_ne,_294
movw r11,[r2+#06h]
cmpw r11,r4
jmp cc_ne,_295
movw r11,[r5]
addw r11,#96h
_290:
_293:
movw [r5],r11
_295:
_294:
call __cocofun_1
movw r13,#00h
movw [r12+#06h],r13
movw [r12+#08h],r13
movw [r12+#0ah],r13
cmpw r11,#03e8h
jmp cc_sge,_296
addw r11,#01h
movw _Index,r11
ret
_296:
movw r11,#03h
movw _Message,r11
_284:
_285:
ret
_notiere_schlagzug endp
; End of function
; End of section

global _notiere_epzug
; Function _notiere_epzug
_notiere_epzug proc far
movw r11,r3
shl r11,#01h
movw r11,[r11+#dpp2:_Brett]
cmpw r11,#06h
jmp cc_eq,_298
cmpw r11,#0fffah
jmp cc_eq,_299
call __cocofun_1
movw [r12],r2
movw [r12+#02h],r3
movw r11,#01h
movw [r12+#04h],r11
movw r11,#00h
movw [r12+#06h],r11
movw [r12+#08h],r11
movw [r12+#0ah],r4
movw r11,#64h
movw [r12+#0ch],r11
movw r11,_Index
cmpw r11,#03e8h
jmp cc_sge,_300
subw _Index,ONES
ret
_300:
movw r11,#03h
movw _Message,r11
_298:
_299:
ret
_notiere_epzug endp
; End of function
; End of section

global _notiere_umwandlung
; Function _notiere_umwandlung
_notiere_umwandlung proc far
movw [-r15],r8
movw [-r15],r9
movw [-r15],r10
movw r8,r2
movw r9,r3
shl r3,#01h
movw r11,[r3+#dpp2:_Brett]
jmp cc_ne,_302
movw r4,#05h
_303:
movw r2,r8
movw r3,r9
call _notiere_zug
call __cocofun_26
movw [r12+#dpp2:_ZugStapel+0fff8h],r4
cmpd1 r4,#03h
jmp cc_uge,_303
jmp _304
_302:
movw r10,#05h
_305:
movw r2,r8
movw r3,r9
call _notiere_schlagzug
call __cocofun_26
movw [r12+#dpp2:_ZugStapel+0fff8h],r10
cmpd1 r10,#03h
jmp cc_uge,_305
_304:
movw r10,[r15+]
movw r9,[r15+]
movw r8,[r15+]
ret
_notiere_umwandlung endp
; End of function
; End of section

; Function __cocofun_26
__cocofun_26 proc far
; Function body __cocofun_26
movw r11,_Index
movw r12,r11
shl r12,#03h
subw r12,r11
shl r12,#01h
ret
__cocofun_26 endp
; End of function
; End of section

global _attackiert_feld
; Function _attackiert_feld
_attackiert_feld proc far
movw r13,r2
cmpw r3,#01h
jmp cc_ne,_306
movw r11,r13
shl r11,#01h
addw r11,#dpp2:_Brett
movw r12,[r11+#0ffeeh]
cmpw r12,#01h
jmp cc_eq,_307
movw r11,[r11+#0ffeah]
cmpw r11,#01h
jmp cc_eq,_308
_306:
cmpw r3,#0ffffh
jmp cc_ne,_309
movw r11,r13
shl r11,#01h
addw r11,#dpp2:_Brett
movw r12,[r11+#12h]
cmpw r12,#0ffffh
jmp cc_eq,_310
movw r11,[r11+#16h]
cmpw r11,#0ffffh
jmp cc_eq,_311
_309:
movw r2,#dpp1:_Offset+10h
movw r11,#08h
_312:
movw r12,r13
addw r12,[r2]
shl r12,#01h
movw r12,[r12+#dpp2:_Brett]
jmp cc_eq,_313
cmpw r12,#64h
jmp cc_eq,_314
cmpw r3,#01h
jmp cc_ne,_315
cmpw r12,#04h
jmp cc_ne,_316
jmp _317
_315:
cmpw r12,#0fffch
jmp cc_eq,_318
_316:
_313:
_314:
addw r2,#02h
cmpi1 r11,#0fh
jmp cc_ult,_312
movw r5,#00h
jmp _319
_320:
movw r11,r13
movw r12,r5
shl r12,#01h
movw r12,[r12+#dpp1:_Offset]
movw r14,#00h
_321:
addw r14,#01h
addw r11,r12
movw r4,r11
shl r4,#01h
movw r4,[r4+#dpp2:_Brett]
jmp cc_eq,_321
movw r12,r11
shl r12,#01h
movw r12,[r12+#dpp2:_Brett]
cmpw r12,#64h
jmp cc_eq,_322
shl r11,#01h
movw r2,[r11+#dpp2:_Brett]
cmpw r3,#01h
jmp cc_ne,_323
cmpw r2,#00h
jmp cc_sle,_324
cmpw r2,#06h
jmp cc_ne,_325
cmpw r14,#01h
jmp cc_sgt,_326
jmp _327
_325:
call __cocofun_18
jmp cc_sgt,_328
movw r11,[r11+#dpp1:_FigOffset+02h]
cmpw r11,r5
jmp cc_slt,_329
jmp _330
_323:
cmpw r2,#00h
jmp cc_sge,_331
cmpw r2,#0fffah
jmp cc_ne,_332
cmpw r14,#01h
jmp cc_sgt,_333
jmp _334
_332:
call _abs
call __cocofun_18
jmp cc_sgt,_335
movw r11,[r11+#dpp1:_FigOffset+02h]
cmpw r11,r5
jmp cc_slt,_336
_334:
_330:
_327:
_318:
_317:
_310:
_311:
_307:
_308:
movw r2,#01h
ret
_336:
_335:
_333:
_331:
_324:
_326:
_328:
_329:
_322:
addw r5,#01h
_319:
cmpw r5,#08h
jmp cc_slt,_320
movw r2,#00h
ret
_attackiert_feld endp
; End of function
; End of section

; Function __cocofun_18
__cocofun_18 proc far
; Function body __cocofun_18
movw r11,r2
shl r11,#02h
subw r11,r2
shl r11,#01h
movw r12,[r11+#dpp1:_FigOffset]
cmpw r12,r5
ret
__cocofun_18 endp
; End of function
; End of section

global _generiere_zuege
; Function _generiere_zuege
_generiere_zuege proc far
call __save_3
subw r15,#04h
movw r1,r2
call __cocofun_9
movw r12,[r11+#dpp2:_StapelGrenze]
movw _Index,r12
movw r12,#00h
movw [r11+#dpp2:_Mobilitaet],r12
movw r8,#15h
movw r11,#dpp2:_Brett+14h
movw [r15+#02h],r11
movw r11,#dpp2:_Brett+18h
movw [r15],r11
movw r9,#dpp2:_Brett+2ah
_339:
movw r2,[r9+]
jmp cc_eq,_340
cmpw r2,#64h
jmp cc_eq,_341
movw r12,_Farbe
cmpw r12,#01h
jmp cc_ne,_342
cmpw r2,#00h
jmp cc_slt,_343
_342:
cmpw r12,#0ffffh
jmp cc_ne,_344
cmpw r2,#00h
jmp cc_sgt,_345
_344:
call _abs
cmpw r2,#01h
jmp cc_ne,_346
cmpw r12,#01h
jmp cc_ne,_347
movw r10,r8
shl r10,#01h
movw r11,[r10+#dpp2:_Brett+14h]
jmp cc_ne,_348
cmpw r8,#51h
jmp cc_slt,_349
movw r3,#0ah
addw r3,r8
call __cocofun_19
jmp _350
_349:
cmpw r1,#00h
jmp cc_sle,_351
movw r4,#0ah
addw r4,r8
movw r2,r8
movw r3,r4
call _notiere_zug
cmpw r8,#26h
jmp cc_sgt,_352
movw r11,[r10+#dpp2:_Brett+28h]
jmp cc_ne,_353
movw r3,r8
addw r3,#14h
call __cocofun_13
movw [r12+#dpp2:_ZugStapel+0fffch],r4
_353:
_352:
_351:
_350:
_348:
movw r11,[r10+#dpp2:_Brett+16h]
cmpw r11,#00h
jmp cc_sge,_354
movw r3,#0bh
addw r3,r8
cmpw r8,#51h
jmp cc_slt,_355
call __cocofun_19
jmp _356
_355:
movw r2,r8
call _notiere_schlagzug
_356:
_354:
movw r11,[r10+#dpp2:_Brett+12h]
cmpw r11,#00h
jmp cc_sge,_357
movw r3,#09h
addw r3,r8
cmpw r8,#51h
jmp cc_slt,_358
call __cocofun_19
jmp _359
_358:
movw r2,r8
call _notiere_schlagzug
jmp _360
_347:
cmpw ONES,_Farbe
jmp cc_ne,_361
movw r4,r8
shl r4,#01h
movw r11,[r4+#dpp2:_Brett+0ffech]
jmp cc_ne,_362
cmpw r8,#26h
jmp cc_sgt,_363
movw r3,r8
subw r3,#0ah
call __cocofun_19
jmp _364
_363:
cmpw r1,#00h
jmp cc_sle,_365
movw r5,r8
subw r5,#0ah
movw r2,r8
movw r3,r5
call _notiere_zug
cmpw r8,#51h
jmp cc_slt,_366
movw r11,[r4+#dpp2:_Brett+0ffd8h]
jmp cc_ne,_367
movw r3,r8
subw r3,#14h
call __cocofun_13
movw [r12+#dpp2:_ZugStapel+0fffch],r5
_367:
_366:
_365:
_364:
_362:
movw r11,[r15+#02h]
movw r11,[r11]
cmpw r11,#00h
jmp cc_sle,_368
cmpw r11,#64h
jmp cc_eq,_369
movw r3,r8
subw r3,#0bh
cmpw r8,#26h
jmp cc_sgt,_370
call __cocofun_19
jmp _371
_370:
movw r2,r8
call _notiere_schlagzug
_371:
_369:
_368:
movw r11,[r15]
movw r11,[r11]
cmpw r11,#00h
jmp cc_sle,_372
cmpw r11,#64h
jmp cc_eq,_373
movw r3,r8
subw r3,#09h
cmpw r8,#26h
jmp cc_sgt,_374
call __cocofun_19
jmp _375
_374:
movw r2,r8
call _notiere_schlagzug
jmp _376
_346:
movw r0,r2
shl r0,#02h
subw r0,r2
shl r0,#01h
movw r10,[r0+#dpp1:_FigOffset+04h]
movw r6,[r0+#dpp1:_FigOffset] ; Wert Figoffset.Anfang
movw r7,r6
shl r7,#01h
addw r7,#dpp1:_Offset         ; Ptr Offset
addw r0,#dpp1:_FigOffset+02h  ; Ptr FigOffset.ende
jmp _377
_378:
movw r5,[r7+] ; _Offset in r5, r7+2
movw r4,r8
_379: ; weitergleiten:
addw r4,r5 ; Von + Offset = Nach
movw r11,r4
shl r11,#01h
movw r11,[r11+#dpp2:_Brett]
jmp cc_ne,_380
cmpw r1,#00h
jmp cc_sle,_381
movw r2,r8
movw r3,r4
call _notiere_zug
_381:
cmpw r10,#00h  ; langschritt==0 ?
jmp cc_eq,_382
jmp _379      ; goto weitergleiten
_380:
movw r11,r4
shl r11,#01h
movw r11,[r11+#dpp2:_Brett]
cmpw r11,#64h
jmp cc_eq,_383
movw r12,_Farbe
cmpw r12,#01h
jmp cc_ne,_384
cmpw r11,#00h
jmp cc_slt,_385
_384:
cmpw r12,#0ffffh
jmp cc_ne,_386
cmpw r11,#00h
jmp cc_sle,_387
_385:
movw r2,r8
movw r3,r4
call _notiere_schlagzug
_386:
_387:
_383:
_382:
addw r6,#01h
_377:
movw r2,r0    
cmpw r6,[r2]
jmp cc_sle,_378
;TEST DEBUG --------------------------------
jmp _DebugExit_002
; -----------------------------------------
_357:
_359:
_360:
_361:
_372:
_373:
_375:
_376:
_343:
_345:
_340:
_341:
movw r11,[r15+#02h]
addw r11,#02h
movw [r15+#02h],r11
movw r11,[r15]
addw r11,#02h
movw [r15],r11
cmpi1 r8,#62h
jmp cc_ult,_339
call __cocofun_9
movw r13,[r11+#dpp2:_Ep_Feld]
jmp cc_eq,_388
movw r14,r13
shl r14,#01h
addw r14,#dpp2:_Brett
movw r11,#01h
cmpw r11,_Farbe
jmp cc_ne,_389
movw r11,[r14+#0ffeeh]
cmpw r11,#01h
jmp cc_ne,_390
movw r2,r13
subw r2,#09h
movw r4,r13
subw r4,#0ah
movw r3,r13
call _notiere_epzug
_390:
movw r11,[r14+#0ffeah]
cmpw r11,#01h
jmp cc_ne,_391
movw r2,r13
subw r2,#0bh
movw r4,r13
subw r4,#0ah
jmp _392
_389:
movw r11,[r14+#12h]
cmpw r11,#0ffffh
jmp cc_ne,_393
movw r2,#09h
addw r2,r13
movw r4,#0ah
addw r4,r13
movw r3,r13
call _notiere_epzug
_393:
movw r11,[r14+#16h]
cmpw r11,#0ffffh
jmp cc_ne,_394
movw r2,#0bh
addw r2,r13
movw r4,#0ah
addw r4,r13
_392:
movw r3,r13
call _notiere_epzug
_394:
_391:
_388:
movw r11,#01h
cmpw r11,_Farbe
jmp cc_ne,_395
movw r2,#19h
cmpw r2,_wKoenig
jmp cc_ne,_396
cmpw ZEROS,_Bewegt+32h
jmp cc_ne,_397
movw r11,#02h
cmpw r11,_Brett+38h
jmp cc_ne,_398
cmpw ZEROS,_Bewegt+38h
jmp cc_ne,_399
cmpw ZEROS,_Brett+34h
jmp cc_ne,_400
cmpw ZEROS,_Brett+36h
jmp cc_ne,_401
call __cocofun_2
jmp cc_ne,_402
movw r2,#1ah
call __cocofun_2
jmp cc_ne,_403
movw r2,#1bh
call __cocofun_2
jmp cc_ne,_404
movw r2,#19h
movw r3,#1bh
call __cocofun_10
_404:
_403:
_402:
_401:
_400:
_399:
_398:
movw r11,#02h
cmpw r11,_Brett+2ah
jmp cc_ne,_405
cmpw ZEROS,_Bewegt+2ah
jmp cc_ne,_406
cmpw ZEROS,_Brett+30h
jmp cc_ne,_407
cmpw ZEROS,_Brett+2eh
jmp cc_ne,_408
cmpw ZEROS,_Brett+2ch
jmp cc_ne,_409
movw r2,#19h
call __cocofun_2
jmp cc_ne,_410
movw r2,#18h
call __cocofun_2
jmp cc_ne,_411
movw r2,#17h
call __cocofun_2
jmp cc_ne,_412
movw r2,#19h
movw r3,#17h
jmp _413
_395:
movw r2,#5fh
cmpw r2,_sKoenig
jmp cc_ne,_414
cmpw ZEROS,_Bewegt+0beh
jmp cc_ne,_415
movw r11,#0fffeh
cmpw r11,_Brett+0c4h
jmp cc_ne,_416
cmpw ZEROS,_Bewegt+0c4h
jmp cc_ne,_417
cmpw ZEROS,_Brett+0c0h
jmp cc_ne,_418
cmpw ZEROS,_Brett+0c2h
jmp cc_ne,_419
call __cocofun_7
jmp cc_ne,_420
movw r2,#60h
call __cocofun_7
jmp cc_ne,_421
movw r2,#61h
call __cocofun_7
jmp cc_ne,_422
movw r2,#5fh
movw r3,#61h
call __cocofun_10
_422:
_421:
_420:
_419:
_418:
_417:
_416:
movw r11,#0fffeh
cmpw r11,_Brett+0b6h
jmp cc_ne,_423
cmpw ZEROS,_Bewegt+0b6h
jmp cc_ne,_424
cmpw ZEROS,_Brett+0bch
jmp cc_ne,_425
cmpw ZEROS,_Brett+0bah
jmp cc_ne,_426
cmpw ZEROS,_Brett+0b8h
jmp cc_ne,_427
movw r2,#5fh
call __cocofun_7
jmp cc_ne,_428
movw r2,#5eh
call __cocofun_7
jmp cc_ne,_429
movw r2,#5dh
call __cocofun_7
jmp cc_ne,_430
movw r2,#5fh
movw r3,#5dh
_413:
call _notiere_zug
call __cocofun_26
movw r11,#02h
movw [r12+#dpp2:_ZugStapel+0fffah],r11
_430:
_429:
_428:
_427:
_426:
_425:
_424:
_423:
_415:
_414:
_396:
_397:
_405:
_406:
_407:
_408:
_409:
_410:
_411:
_412:
; TEST DEBUG ------------------------------------
_DebugExit_002:
;------------------------------------------------
call __cocofun_9
movw r12,_Index
movw [r11+#dpp2:_StapelGrenze+02h],r12
addw r15,#04h
jmp __restore_4
ret
_generiere_zuege endp
; End of function
; End of section

; Function __cocofun_19
__cocofun_19 proc far
; Function body __cocofun_19
movw r2,r8
jmp _notiere_umwandlung
ret
__cocofun_19 endp
; End of function
; End of section

; Function __cocofun_13
__cocofun_13 proc far
; Function body __cocofun_13
movw r2,r8
call _notiere_zug
jmp __cocofun_26
ret
__cocofun_13 endp
; End of function
; End of section

; Function __cocofun_10
__cocofun_10 proc far
; Function body __cocofun_10
call _notiere_zug
call __cocofun_26
movw r11,#01h
movw [r12+#dpp2:_ZugStapel+0fffah],r11
ret
__cocofun_10 endp
; End of function
; End of section

; Function __cocofun_7
__cocofun_7 proc far
; Function body __cocofun_7
movw r3,#01h
call _attackiert_feld
cmpw r2,#00h
ret
__cocofun_7 endp
; End of function
; End of section

; Function __cocofun_2
__cocofun_2 proc far
; Function body __cocofun_2
movw r3,#0ffffh
call _attackiert_feld
cmpw r2,#00h
ret
__cocofun_2 endp
; End of function
; End of section

global _init_bewertung
; Function _init_bewertung
_init_bewertung proc far
movw r11,#15h
movw r12,#dpp2:_BKontrolle+54h
_431:
movw r13,#00h
movw [r12],r13
movw [r12+#02h],r13
addw r12,#04h
cmpi1 r11,#62h
jmp cc_ult,_431
movw r11,#dpp2:_Bauern
movw r12,#dpp2:_Tuerme
_432:
movw r14,#00h
movw [r11],r14
movw [r11+#02h],r14
addw r11,#04h
movw [r12],r14
movw [r12+#02h],r14
addw r12,#04h
cmpi1 r13,#09h
jmp cc_ult,_432
movw r14,#15h
movw r4,#dpp2:_Brett+2ah
movw r5,#dpp2:_BKontrolle+78h
movw r2,#dpp2:_BKontrolle+80h
_433:
movw r11,[r4]
jmp cc_eq,_434
cmpw r11,#64h
jmp cc_eq,_435
cmpw r11,#01h
jmp cc_ne,_436
movw r12,[r5]
addw r12,#01h
movw [r5],r12
movw r12,[r2]
addw r12,#01h
movw [r2],r12
call __cocofun_20
addw r12,#dpp2:_Bauern
movw r13,[r12]
addw r13,#01h
movw [r12],r13
_436:
cmpw r11,#0ffffh
jmp cc_ne,_437
movw r11,r14
shl r11,#02h
;---------------------------------------
; TEST
movw r12,#dpp2:_BKontrolle-22h
; movw r12,#_BKontrolle+0ffdeh
;---------------------------------------
addw r12,r11
movw r13,[r12]
addw r13,#01h
movw [r12],r13
;---------------------------------------
; TEST
movw r12,#dpp2:_BKontrolle-2ah
; movw r12,#_BKontrolle+0ffd6h
;---------------------------------------
addw r12,r11
movw r11,[r12]
addw r11,#01h
movw [r12],r11
call __cocofun_21
addw r11,#dpp2:_Bauern+02h
movw r12,[r11]
addw r12,#01h
movw [r11],r12
_437:
movw r11,[r4]
cmpw r11,#0fffeh
jmp cc_ne,_438
call __cocofun_20
addw r12,#dpp2:_Tuerme+02h
movw r13,[r12]
addw r13,#01h
movw [r12],r13
_438:
cmpw r11,#02h
jmp cc_ne,_439
call __cocofun_21
addw r11,#dpp2:_Tuerme
movw r12,[r11]
addw r12,#01h
movw [r11],r12
_439:
_434:
_435:
addw r4,#02h
addw r5,#04h
addw r2,#04h
cmpi1 r14,#62h
jmp cc_ult,_433
ret
_init_bewertung endp
; End of function
; End of section


; Function __cocofun_21
__cocofun_21 proc far
; Function body __cocofun_21
movw r11,#0ah
movw MDL,r14
div r11
movw r11,MDH
shl r11,#02h
ret
__cocofun_21 endp
; End of function
; End of section

; Function __cocofun_20
__cocofun_20 proc far
; Function body __cocofun_20
movw r12,#0ah
movw MDL,r14
div r12
movw r12,MDH
shl r12,#02h
ret
__cocofun_20 endp
; End of function
; End of section

global _computer_zug
; Function _computer_zug
_computer_zug proc far
call __save_3
subw r15,#14h
movw r11,#00h
movw [r15+#0eh],r11
movw _Message,ZEROS
call _init_spielbaum
movw r2,#8300h
movw r3,#7d00h
movw r4,_Farbe
call _bewerte_stellung
cmpw r2,#7d00h
jmp cc_ne,_440
movw r11,#04h
jmp _441
_440:
movw r11,_InSchach
movw [r15+#12h],r11
movw _KnotenAnzahl,ZEROS
movw _KnotenAnzahl+02h,ZEROS
movw r2,#01h
call _generiere_zuege
movw r11,#01h
jmp _442
_443:
movw r11,[r15+#10h]
cmpw r11,#01h
jmp cc_ne,_444
movw r11,#8300h
movw [r15+#0eh],r11
movw r9,#7d00h
jmp _445
_444:
movw r9,[r15+#0eh]
addw r9,#64h
movw r11,[r15+#0eh]
subw r11,#64h
movw [r15+#0eh],r11
_445:
movw r11,[r15+#10h]
addw r11,#03h
movw _MaxErweiterung,r11
movw r10,#00h
movw r6,#dpp2:_ZugStapel
movw r1,r6
movw r7,[r15+#10h]
subw r7,#01h
jmp _446
_447:
call __cocofun_8
movw r2,r10
call _zug_ausfuehren
movw r2,r9
negw r2
movw r3,[r15+#0eh]
call __cocofun_14
cmpw r10,#00h
jmp cc_ne,_448
movw r11,[r15+#0eh]
cmpw r8,r11
jmp cc_sge,_449
movw r9,#8300h
jmp _450
_449:
cmpw r8,r9
jmp cc_slt,_451
movw r9,r8
movw r8,#7d00h
_450:
movw r2,#00h
call _zug_ausfuehren
negw r8
movw r3,r9
negw r3
movw r2,r8
movw r4,r7
call _alpha_beta
negw r2
movw r8,r2
movw r2,#00h
call _zug_zuruecknehmen
_451:
movw [r15+#0eh],r8
movw r9,r8
addw r9,#01h
movw r2,#00h
call _kopiere_hvar
jmp _452
_448:
movw r11,[r15+#0eh]
cmpw r8,r11
jmp cc_sle,_453
movw r0,r11
movw [r15+#0eh],r8
movw r9,#7d00h
movw r2,r10
call _zug_ausfuehren
movw r2,#8300h
movw r3,r8
call __cocofun_14
cmpw r8,r0
jmp cc_sle,_454
movw [r15+#0eh],r8
movw r9,r8
addw r9,#01h
movw r2,r10
call _kopiere_hvar
movw r2,r15
movw r3,r6
movw r4,#07h
call __cpnnw
movw r11,r10
movw r12,r10
shl r12,#03h
subw r12,r10
shl r12,#01h
;---------------------------------------
; TEST
addw r12,#dpp2:_ZugStapel-0eh
; addw r12,#_ZugStapel+0fff2h
;---------------------------------------
movw r13,r1
jmp _455
_456:
movw r2,r13
movw r3,r12
movw r4,#07h
call __cpnnw
subw r13,#0eh
subw r12,#0eh
subw r11,#01h
_455:
cmpw r11,#00h
jmp cc_sgt,_456
movw r2,#dpp2:_ZugStapel
movw r3,r15
movw r4,#07h
call __cpnnw
_454:
_453:
_452:
addw r6,#0eh
addw r1,#0eh
addw r10,#01h
_446:
cmpw r10,_StapelGrenze+02h
jmp cc_slt,_447
movw r11,[r15+#10h]
addw r11,#01h
_442:
movw [r15+#10h],r11
cmpw r11,_SollTiefe
jmp cc_sle,_443
movw r11,[r15+#0eh]
cmpw r11,#8301h
jmp cc_sle,_457
movw r11,#dpp2:_Zug_Von
movw [r11],_ZugStapel
movw r11,#dpp2:_Zug_Nach
movw [r11],_ZugStapel+02h
movw r11,_ZugStapel
call __cocofun_12
movw r11,#dpp2:_Zug_Umwandlung
movw [r11],_ZugStapel+06h
movw r11,#dpp2:_Zug_Schlag
movw [r11],_ZugStapel+04h
movw r2,#00h
call _zug_ausfuehren
movw r11,[r15+#0eh]
cmpw r11,#7cf6h
jmp cc_slt,_458
movw r11,#05h
jmp _459
_458:
movw r11,[r15+#0eh]
cmpw r11,#830ah
jmp cc_sgt,_460
movw r11,#06h
jmp _461
_457:
movw r11,#00h
movw r12,[r15+#12h]
cmpw r12,#01h
jmp cc_eq,_462
movw r11,#01h
_462:
addw r11,#07h
_441:
_459:
_461:
movw _Message,r11
_460:
addw r15,#14h
jmp __restore_4
ret
_computer_zug endp
; End of function
; End of section

; Function __cocofun_14
__cocofun_14 proc far
; Function body __cocofun_14
negw r3
movw r4,r7
call _alpha_beta
negw r2
movw r8,r2
movw r2,r10
jmp _zug_zuruecknehmen
ret
__cocofun_14 endp
; End of function
; End of section

; Function __cocofun_12
__cocofun_12 proc far
; Function body __cocofun_12
shl r11,#01h
movw r2,[r11+#dpp2:_Brett]
call _abs
movb rh4,[r2+#dpp1:_FigSymbol]
movbs r11,rh4
movw _Zug_Figur,r11
ret
__cocofun_12 endp
; End of function
; End of section

; Function __cocofun_8
__cocofun_8 proc far
; Function body __cocofun_8
movw r11,_Tiefe
movw r12,r11
shl r12,#02h
addw r12,r11
shl r12,#04h
shl r11,#02h
addw r11,r12
movw r12,#00h
movw [r11+#dpp2:_HVar],r12
ret
__cocofun_8 endp
; End of function
; End of section

global _zug_zurueck
; Function _zug_zurueck
_zug_zurueck proc far
movw r11,#01h
cmpw r11,_Tiefe
jmp cc_ne,_463
movw r2,_LetzterZug
call _zug_zuruecknehmen
_463:
ret
_zug_zurueck endp
; End of function
; End of section

global _zugnr_eingabe
; Function _zugnr_eingabe
_zugnr_eingabe proc far
movw [-r15],r6
movw [-r15],r8
movw [-r15],r9
movw [-r15],r10
movw r8,r2
movw r9,r3
movw r10,r4
movw _Message,ZEROS
movw r2,#01h
call _generiere_zuege
; TEST DEBUG ----------------------------------
; jmp _DebugExit_001
;----------------------------------------------
call __cocofun_9
movw r6,[r11+#dpp2:_StapelGrenze]
jmp _464
_465:
movw r11,r6
shl r11,#03h
subw r11,r6
shl r11,#01h
movw r12,[r11+#dpp2:_ZugStapel]
cmpw r12,r8
jmp cc_ne,_466
movw r12,[r11+#dpp2:_ZugStapel+02h]
cmpw r12,r9
jmp cc_ne,_467
movw r11,[r11+#dpp2:_ZugStapel+06h]
jmp cc_eq,_468
cmpw r10,#53h
jmp cc_ne,_469
addw r6,#01h
jmp _470
_469:
cmpw r10,#4ch
jmp cc_ne,_471
addw r6,#02h
jmp _472
_471:
cmpw r10,#54h
jmp cc_ne,_473
addw r6,#03h
_473:
_472:
_470:
_468:
call _init_spielbaum
movw r11,r6
shl r11,#03h
subw r11,r6
shl r11,#01h
addw r11,#dpp2:_ZugStapel+04h
movw _Zug_Schlag,[r11]
movw r11,r8
call __cocofun_12
movw _Zug_Von,r8
movw _Zug_Nach,r9
movw _Zug_Umwandlung,r10
movw r8,_LetzterZug
movw r2,r6
call _zug_ausfuehren
cmpw ONES,_Farbe
jmp cc_ne,_474
call __cocofun_16
jmp cc_ne,_475
movw r11,#01h
_476:
movw _Message,r11
movw r2,r6
call _zug_zuruecknehmen
movw _LetzterZug,r8
_477:
movw r2,#00h
jmp _478
_474:
call __cocofun_24
jmp cc_ne,_479
movw r11,#02h
jmp _476
_479:
_475:
movw r2,#01h
jmp _480
_467:
_466:
addw r6,#01h
_464:
call __cocofun_9
movw r11,[r11+#dpp2:_StapelGrenze+02h]
cmpw r6,r11
jmp cc_slt,_465
jmp _477
_480:
_478:
;TEST DEBUG -----------------------------------
_DebugExit_001:
;----------------------------------------------

movw r10,[r15+]
movw r9,[r15+]
movw r8,[r15+]
movw r6,[r15+]
ret
_zugnr_eingabe endp
; End of function
; End of section

; Function __cocofun_9
__cocofun_9 proc far
; Function body __cocofun_9
movw r11,_Tiefe
shl r11,#01h
ret
__cocofun_9 endp
; End of function
; End of section

; Function __restore_4
__restore_4 proc far
movw r10,[r15+]
movw r9,[r15+]
movw r8,[r15+]
movw r7,[r15+]
movw r6,[r15+]
movw r1,[r15+]
movw r0,[r15+]
ret
__restore_4 endp
; End of function
; End of section

; Function __restore_2
__restore_2 proc far
movw r10,[r15+]
movw r9,[r15+]
movw r8,[r15+]
movw r7,[r15+]
movw r6,[r15+]
movw r14,[r15+]
  movw r15,r14
ret
__restore_2 endp
; End of function
; End of section

; Function __save_3
__save_3 proc far
movw [-r15],r0
movw [-r15],r1
movw [-r15],r6
movw [-r15],r7
movw [-r15],r8
movw [-r15],r9
movw [-r15],r10
ret
__save_3 endp
; End of function
; End of section

; Function __save_1
__save_1 proc far
movw r14,r15
    movw r15,#dpp2:_LocalStackPointer
movw [-r15],r14
movw [-r15],r6
movw [-r15],r7
movw [-r15],r8
movw [-r15],r9
movw [-r15],r10
ret
__save_1 endp
; End of function
; End of section

;---------------------------------------------------------------------
; Function __cpnnw
; Kopiert eine Anzahl Bytes von Quelle nach Ziel FNEUL
; r2= Ziel, r3=Quelle, r4=anzahl Bytes
global __cpnnw
__cpnnw proc far
movw [r2+],[r3] ; Setze Ziel mit Quelle und erhöhe Zielzähler 2
addw r3,#02 ; Erhöhe Quellzähler 2
cmpd1 r4,#01 ; Vergleiche mit Vorgabe Anzahl
jmp cc_ugt,__cpnnw ; Noch eine Wiederholung
ret
__cpnnw endp
; End of function
; End of section
;---------------------------------------------------------------------


;***********************************************************
userseg ends


;***********************************************************
constseg SECTION DATA word at 34000h
;***********************************************************
global _GrundStellung
_GrundStellung label
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 02h
dw 04h
dw 03h
dw 05h
dw 06h
dw 03h
dw 04h
dw 02h
dw 64h
dw 64h
dw 01h
dw 01h
dw 01h
dw 01h
dw 01h
dw 01h
dw 01h
dw 01h
dw 64h
dw 64h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 64h
dw 64h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 64h
dw 64h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 64h
dw 64h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 64h
dw 64h
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 0ffffh
dw 64h
dw 64h
dw 0fffeh
dw 0fffch
dw 0fffdh
dw 0fffbh
dw 0fffah
dw 0fffdh
dw 0fffch
dw 0fffeh
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
dw 64h
; End of section

global _Offset
_Offset label
dw 0fff7h
dw 0fff5h
dw 09h
dw 0bh
dw 0ffffh
dw 0ah
dw 01h
dw 0fff6h
dw 13h
dw 15h
dw 0ch
dw 0fff8h
dw 0ffedh
dw 0ffebh
dw 0fff4h
dw 08h
; End of section

global _FigOffset
_FigOffset label
db 00h    ; Leeres Feld
db 00h
db 00h
db 00h
db 00h
db 00h

dw 0ffffh ; Bauern
dw 0ffffh
db 00h
db 00h

; TEST -----------------------
dw 04h    ; Turm
dw 07h
dw 01h   ; weitergleiten

; ORG
; dw 04h    ; Turm
; dw 07h
; dw 01h   ; weitergleiten

db 00h    ; Läufer
db 00h
dw 03h
dw 01h

dw 08h   ; Springer
dw 0fh
db 00h
db 00h

db 00h   ; Dame
db 00h
dw 07h
dw 01h

db 00h    ; Koenig
db 00h
dw 07h
db 00h
db 00h
; End of section

global _ZentrumTab
_ZentrumTab label
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 04h
db 00h
db 00h
dw 08h
dw 0ch
dw 0ch
dw 08h
db 00h
db 00h
dw 04h
db 00h
db 00h
db 00h
db 00h
dw 04h
dw 08h
dw 0ch
dw 10h
dw 10h
dw 0ch
dw 08h
dw 04h
db 00h
db 00h
db 00h
db 00h
dw 08h
dw 0ch
dw 10h
dw 14h
dw 14h
dw 10h
dw 0ch
dw 08h
db 00h
db 00h
db 00h
db 00h
dw 0ch
dw 10h
dw 14h
dw 18h
dw 18h
dw 14h
dw 10h
dw 0ch
db 00h
db 00h
db 00h
db 00h
dw 0ch
dw 10h
dw 14h
dw 18h
dw 18h
dw 14h
dw 10h
dw 0ch
db 00h
db 00h
db 00h
db 00h
dw 08h
dw 0ch
dw 10h
dw 14h
dw 14h
dw 10h
dw 0ch
dw 08h
db 00h
db 00h
db 00h
db 00h
dw 04h
dw 08h
dw 0ch
dw 10h
dw 10h
dw 0ch
dw 08h
dw 04h
db 00h
db 00h
db 00h
db 00h
dw 04h
db 00h
db 00h
dw 08h
dw 0ch
dw 0ch
dw 08h
db 00h
db 00h
dw 04h
; End of section

global _wBFeldWert
_wBFeldWert label
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 04h
dw 04h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 06h
dw 06h
dw 06h
db 00h
db 00h
db 00h
db 00h
dw 06h
dw 06h
dw 08h
dw 08h
dw 08h
dw 04h
dw 06h
dw 06h
db 00h
db 00h
db 00h
db 00h
dw 08h
dw 08h
dw 10h
dw 16h
dw 16h
dw 04h
dw 04h
dw 04h
db 00h
db 00h
db 00h
db 00h
dw 0ah
dw 0ah
dw 14h
dw 1ah
dw 1ah
dw 0ah
dw 0ah
dw 0ah
db 00h
db 00h
db 00h
db 00h
dw 0ch
dw 0ch
dw 16h
dw 1ch
dw 1ch
dw 0eh
dw 0eh
dw 0eh
db 00h
db 00h
db 00h
db 00h
dw 12h
dw 12h
dw 1ch
dw 20h
dw 20h
dw 14h
dw 14h
dw 14h
; End of section

global _sBFeldWert
_sBFeldWert label
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 12h
dw 12h
dw 1ch
dw 20h
dw 20h
dw 14h
dw 14h
dw 14h
db 00h
db 00h
db 00h
db 00h
dw 0ch
dw 0ch
dw 16h
dw 1ch
dw 1ch
dw 0eh
dw 0eh
dw 0eh
db 00h
db 00h
db 00h
db 00h
dw 0ah
dw 0ah
dw 14h
dw 1ah
dw 1ah
dw 0ah
dw 0ah
dw 0ah
db 00h
db 00h
db 00h
db 00h
dw 08h
dw 08h
dw 10h
dw 16h
dw 16h
dw 04h
dw 04h
dw 04h
db 00h
db 00h
db 00h
db 00h
dw 06h
dw 06h
dw 08h
dw 08h
dw 08h
dw 04h
dw 06h
dw 06h
db 00h
db 00h
db 00h
db 00h
dw 04h
dw 04h
db 00h
db 00h
db 00h
db 00h
db 00h
db 00h
dw 06h
dw 06h
dw 06h
; End of section

global _FigMaterial
_FigMaterial label
db 00h
db 00h
dw 64h
dw 01f4h
dw 015eh
dw 0145h
dw 0384h
db 00h
db 00h
; End of section

global _FigSymbol
_FigSymbol label
db 2eh
db 42h
db 54h
db 4ch
db 53h
db 44h
db 4bh
db  00h ; Dummy for even adresses FNEUL
; End of section

;***********************************************************
constseg ends

;***********************************************************
dataseg SECTION DATA word at 84000h
;***********************************************************

;global Variable definition section
global _kommando
_kommando label
ds 2
; End of section

global _Message
_Message label
ds 2
; End of section

global _Zug_Schlag
_Zug_Schlag label
ds 2
; End of section

global _Zug_Figur
_Zug_Figur label
ds 2
; End of section

global _Zug_Von
_Zug_Von label
ds 2
; End of section

global _Zug_Nach
_Zug_Nach label
ds 2
; End of section

global _Zug_Umwandlung
_Zug_Umwandlung label
ds 2
; End of section

global _Brett
_Brett label
ds 240
; End of section

global _Ep_Feld
_Ep_Feld label
ds 40
; End of section

global _ZugStapel
_ZugStapel label
ds 11214
; End of section

global _Bewegt
_Bewegt label
ds 198
; End of section

global _Rochade
_Rochade label
ds 6
; End of section

global _Index
_Index label
ds 2
; End of section

global _StapelGrenze
_StapelGrenze label
ds 40
; End of section

global _HVar
_HVar label
ds 1600
; End of section

global _KillerTab
_KillerTab label
ds 160
; End of section

global _BKontrolle
_BKontrolle label
ds 480
; End of section

global _Bauern
_Bauern label
ds 40
; End of section

global _Tuerme
_Tuerme label
ds 40
; End of section

global _Mobilitaet
_Mobilitaet label
ds 40
; End of section

global _NachFeld
_NachFeld label
ds 40
; End of section

global _wKoenig
_wKoenig label
ds 2
; End of section

global _sKoenig
_sKoenig label
ds 2
; End of section

global _MatBilanz
_MatBilanz label
ds 40
; End of section

global _MatSumme
_MatSumme label
ds 40
; End of section

global _Farbe
_Farbe label
ds 2
; End of section

global _SpielerSpieler
_SpielerSpieler label
ds 2
; End of section

global _SollTiefe
_SollTiefe label
ds 2
; End of section

global _MaxErweiterung
_MaxErweiterung label
ds 2
; End of section

global _Tiefe
_Tiefe label
ds 2
; End of section

global _KnotenAnzahl
_KnotenAnzahl label
ds 4
; End of section

global _LetzterZug
_LetzterZug label
ds 2
; End of section

global _InSchach
_InSchach label
ds 2
; End of section

global _ZugNr
_ZugNr label
ds 2
; End of section

global _LocalStack
_LocalStack label
ds  510
global _LocalStackPointer
_LocalStackPointer label
ds  2

global _Stack
_Stack label
ds  510
global _StackPointer
_StackPointer label
ds  2

; End of section
;***********************************************************
dataseg ends
         end



> Hallo Frank,
>
> Ich kann Dir Dein Program leider nicht mit Tasking C übersetzen, da ich selbst
> mit Tasking nur in ASM arbeite.
>
> Jedoch hat sich bei den meisten Programmen, die ich in den Fingern hatte, gezeigt,
> daÃ? durch simple Optimierungen oft 50% und mehr an Geschwindigkeit herausgeholt werden kann.
> Die CC2 hat viele Funktionen, die in C umschrieben werden. Dadurch lä�t sich
> oft am meisten sparen.
> Wenn Du willst, kannst Du mir deine implementation in C2 schicken. (bitte als ZIP oder RAR).
> Ich kann dann kurz rübersehen und Dir sagen, wie stark sich das ganze optimieren lä�t.
> Ich denke, wenn die Züge am Ende unter 5 Minuten dauern, wäre Dir auch schon geholfen.
> Man kann notfalls auch einzelne sehr rechenintensive Routinen in ASM umsetzen, aber
> das Programm selbst unter C2 laufen lassen.
> Diese Methode würde ich sogar bevorzugen, da so leichter �nderungen möglich wären.
>
> MfG André H.
>
>
> > Hallo zusammen,
> >
> > ist vieleicht etwas viel verlangt, aber trotzdem wichtig:
> >
> >   Meine CC2 steuert einen Eigenbau Schachroboter. Das macht die schon seit Jahren,
> >   nun auch mit Farbdisplay und magneto sensitivem Schachbrett. Das Projekt nähert sich nun dem
> >   Ende. Nach Fertigstellung werde ich hierfür einen eigenen Internetauftritt realisieren.
> >
> > Das Problem:
> >  Unter anderem habe ich den MINIMAX Schachalgorithmus auf die CC2 umgesetzt. Das klappt
> >  prima und schlägt fast alles. Es kann jedoch, unter C2 als Programmiersprache, schon bis zu
> >  9 Minuten dauern bis die CC2 den richtigen Zug ermittelt hat.
> >
> >  Schneller gehts, wenn das Programm (liegt auch in C vor) mittels C-Compiler, Assembler und Linker in
> >  Intel Hex Format vorliegen würde. Die Demo Tasking EDE schafft nur 199 Zeilen,
> >  das Programm hat ca. 2600.
> >
> > Hat jemand von euch Erfahungen im Umsetzen von groÃ?en C-Anwendungen auf die CC2?
> >
> > Bitte verkneift euch die Antwort, "Es gibt doch andere Hardware..."
> >
> > Ich freue mich auf eure Messages.
> >
> >  GruÃ?
> >  
> > Frank
> >


    Antwort schreiben


Antworten: