博客
关于我
汇编语言程序,求出这两个数组中数据的个数
阅读量:367 次
发布时间:2019-03-04

本文共 1956 字,大约阅读时间需要 6 分钟。

???????????????

????

??????????????10??????M????????????P?????N?????????????????


???

; ?????data segment    M dw 1,-3,32,4,31,42,-53,53,-12,34    P dw 10 dup (?)   ; ?????????10???    N dw 10 dup (?)   ; ?????????10???    countp db 30h      ; ??????    countn db 30h      ; ??????data ends; ?????code segment    assume cs:code, ds:datastart:    mov ax, data    mov ds, ax    mov cx, 10        ; ????    xor bx, bx        ; ???????bx    xor si, si        ; ???????si    xor di, di        ; ???????dis:    mov ax, M[bx]     ; ??????M???    cmp ax, 0        ; ???????0    jge s1           ; ??????????????    ; ??????????????s1:    mov P[di], ax     ; ?????????P    add di, 2        ; ??di??2???????    add countp, 1    ; ?????1    jmp nextnext:    add bx, 2        ; ????bx??2???????    loop ss:    mov ax, M[bx]     ; ??????M???    cmp ax, 0        ; ???????0    jge s1           ; ??????????????    ; ??????????????s1:    mov N[di], ax     ; ?????????N    add di, 2        ; ??di??2???????    add countn, 1    ; ?????1    jmp nextnext:    add bx, 2        ; ????bx??2???????    loop s; ????    mov ah, 2        ; ?????????    mov dl, countp   ; ??????    int 21h         ; ???????    mov ah, 2        ; ?????????    mov dl, 20h     ; ????    int 21h         ; ????    mov ah, 2        ; ?????????    mov dl, countn   ; ??????    int 21h         ; ???????    mov ax, 4c00h    ; ????    int 21h         ; ????code endsend start

????

  • ???

    • M ?????????1, -3, 32, 4, 31, 42, -53, 53, -12, 34
    • P ? N ????????????
    • countp ? countn ?????????????
  • ???

    • ????????????????
    • ?? mov ax, data ? mov ds, ax ??????????
    • ???? cx ????10???????10????
    • bx ?????????????
  • ??????

    • s ? s1 ???????????
    • ????jge s1????? P ?????????? N ????
    • ?? di ????????????????????
    • countp ? countn ?????????????
  • ????

    • ?? int 21h ????????????????????????????
  • ????

    • ?? mov ax, 4c00h ?????int 21h ???????

  • ????

    • ???????? M ?????????? P ? N ????
    • ??????????????????
    • ?????????????????????

    ??????????????????????????????

    转载地址:http://ctyg.baihongyu.com/

    你可能感兴趣的文章
    poj 3628 Bookshelf 2
    查看>>
    Qt笔记——官方文档全局定义(一)Types数据类型
    查看>>
    POJ 3670 DP LIS?
    查看>>
    POJ 3683 Priest John's Busiest Day (算竞进阶习题)
    查看>>
    POJ 3988 Selecting courses
    查看>>
    POJ 4020 NEERC John's inversion 贪心+归并求逆序对
    查看>>
    poj 4044 Score Sequence(暴力)
    查看>>
    POJ 基础数据结构
    查看>>
    POJ 题目3020 Antenna Placement(二分图)
    查看>>
    Poj(1797) Dijkstra对松弛条件的变形
    查看>>
    SpringBoot为什么不需要xml配置文件?
    查看>>
    POJ--2391--Ombrophobic Bovines【分割点+Floyd+Dinic优化+二分法答案】最大网络流量
    查看>>
    Qt笔记——SQLite初探QSqlDatabase QSqlQuery
    查看>>
    POJ-1163-The Triangle
    查看>>
    POJ-Fence Repair 哈夫曼树
    查看>>
    poj1061 - 同余方程,二元一次不定方程
    查看>>
    Qt笔记——SQLite再探
    查看>>
    poj1068Parencodings
    查看>>
    poj1182(带权并查集)
    查看>>
    POJ1182(带权并查集)
    查看>>