汇编用串检测scasb寻找数的位置

来源:互联网 发布:杀戮游戏网络电影 编辑:程序博客网 时间:2024/06/07 00:24
stack      segmentdb 1024 dup(?)stack      endsdata       segmentbuff   db 64h,45h,42h,78h,89hdata       endscode       segmentassume cs:code,ds:data,ss:stackstart:     mov ax,data           mov ds,ax           mov es,ax           mov di,offset buff           mov al,42h           mov cx,lengthof buff           cldagain:     scasb           je next           loop again           next:      mov dl,cl           mov al,dl           call ALdisp           mov ah,4ch           int 21h                   ALdisp proc        push ax        push cx        push dx        push ax        mov dl,al        mov cl,4        shr dl,cl        or dl,30h        cmp dl,39h        jbe aldisp1        add dl,7aldisp1:mov ah, 2        int 21h        pop dx        and dl,0fh        or dl,30h        cmp dl,39h        jbe aldisp2        add dl,7aldisp2: mov ah,2        int 21h        pop dx        pop cx        pop ax        retALdisp  endpcode       endsend        start

1 0
原创粉丝点击