⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 box.asm

📁 如何在VB下实现BP神经网络的拓扑优化算法
💻 ASM
📖 第 1 页 / 共 5 页
字号:
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp2
                @@:
                mov    eax,0
                ret
                lp2:
            .elseif    rdtop == 2
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp3
                @@:
                mov    eax,0
                ret
                lp3:
            .elseif    rdtop == 3
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp4
                @@:
                mov    eax,0
                ret
                lp4:
            .else
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp_4
                @@:
                mov    eax,0
                ret
                lp_4:
            .endif
        .elseif    random2 == 4
            .if    rdtop == 1
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp5
                @@:
                mov    eax,0
                ret
                lp5:
            .elseif    rdtop == 2
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp6
                @@:
                mov    eax,0
                ret
                lp6:
            .elseif    rdtop == 3
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp7
                @@:
                mov    eax,0
                ret
                lp7:
            .else
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp8
                @@:
                mov    eax,0
                ret
                lp8:
            .endif
        .elseif    random2 == 5
            .if    rdtop == 1
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp9
                @@:
                mov    eax,0
                ret
                lp9:
            .elseif    rdtop == 2                
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp10
                @@:
                mov    eax,0
                ret
                lp10:
            .elseif    rdtop == 3
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp11
                @@:
                mov    eax,0
                ret
                lp11:
            .else
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp12
                @@:
                mov    eax,0
                ret
                lp12:
            .endif
        .elseif    random2 == 6
            .if    rdtop == 1
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp13
                @@:
                mov    eax,0
                ret
                lp13:
            .elseif    rdtop == 2
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp14
                @@:
                mov    eax,0
                ret
                lp14:    
            .endif
        .else
            .if    rdtop == 1
                mov    bl,byte ptr[esi+1]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+3]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp17
                @@:
                mov    eax,0
                ret
                lp17:            
            .elseif    rdtop == 2
                mov    bl,byte ptr[esi]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                mov    bl,byte ptr[esi+2]
                cmp    byte ptr[edi+ebx],0
                jnz    @f
                    invoke    _setbuff,0,10
                    invoke    _setbuff,1,0
                    jmp    lp18
                @@:
                mov    eax,0
                ret
                lp18:    
            .endif
        .endif
        mov    eax,1
        ret

_down         endp

_printach    proc    hdc
        LOCAL    @stRect:RECT
        pushad
        lea    esi,achbuff
        add    esi,4
        mov    eax,achievement
        xor    dx,dx
        mov    bx,10
        @@:
        div    bx
        add    dl,30h
        mov    byte ptr[esi],dl
        dec    esi
        xor    dx,dx
        or    ax,ax
        jnz    @b
        inc    esi
        mov    @stRect.left,71
        mov    @stRect.top,44
        mov    @stRect.right,104
        mov    @stRect.bottom,54
        invoke    DrawText,hdc,esi,-1,addr @stRect,DT_SINGLELINE or DT_RIGHT or DT_VCENTER;输出成绩
        popad
        ret

_printach     endp

_game        proc
        LOCAL    hdc
        pushad
        invoke    GetDC,hWinMain
        mov    hdc,eax
        lea    esi,rdcoord
        add    byte ptr[esi],10
        add    byte ptr[esi+1],10
        add    byte ptr[esi+2],10
        add    byte ptr[esi+3],10        
        mov    ebx,10        
        invoke    _down
        .if    eax == 0
            mov    ecx,20
            lea    edi,rdbuff
            
            jiance:            ;此循环用来判断有无填满的行,有几行清几行并加分
            push    edi
            push    ecx
            mov    ecx,10
            
            dec    edi
            @@:
            inc    edi
            cmp    byte ptr[edi],1
            jne    ex        ;当其中有一个没有格子时不清行,跳出清行语句
            loop    @b
            
            inc    achievement;记录成绩
            mov    ecx,edi
            inc    ecx
            lea    ebx,rdbuff
            sub    ecx,ebx
            sub    ecx,10
            @@:
            mov    al,byte ptr[edi-10]    ;通过低位向高位移10格来清行
            mov    byte ptr[edi],al
            dec    edi
            loop    @b
            
            ex:
            pop    ecx
            pop    edi
            add    edi,10
            loop    jiance
            
            invoke    _printach,hdc        ;输出新成绩
            
            lea    esi,rdbuff
            cmp    word ptr[esi+24],0;放不下方块时清除所有方块
            jz    noclear
            mov    ecx,200
            @@:
            mov    byte ptr[esi],0
            inc    esi
            loop    @b
            
            noclear:
            @@:            
            push    random1
            pop    random2
            invoke    _ran
            mov    random1,eax
            invoke    _next,random1,hdc
            invoke    _init
        .endif
        
        invoke    _scanplot,hdc
        invoke    ReleaseDC,hWinMain,hdc
        popad
        ret

_game         endp

_testzero    proc    uses ebx esi edi firstaddr,degree,jump
        mov    esi,firstaddr
        lea    edi,rdbuff
        add    esi,edi
        mov    ecx,degree
        @@:
        cmp    byte ptr[esi],0
        jnz    @f
        add    esi,jump
        loop    @b
        mov    eax,0
        ret
        @@:
        mov    eax,1
        ret

_testzero     endp

_ratate        proc    uses ebx esi edi first,second,third,fourth
        
        lea    esi,rdcoord
        lea    edi,rdbuff
        xor    ebx,ebx

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -