博客
关于我
汇编语言程序,求出这两个数组中数据的个数
阅读量: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/

    你可能感兴趣的文章
    QGIS在Windows上下载安装与建立空间数据库连接
    查看>>
    PowerDesigner165安装婆姐汉花教程
    查看>>
    PowerDesigner使用教程:设置注释、默认值属性
    查看>>
    PowerDesigner使用教程:不显示背景网格
    查看>>
    PowerDesigner使用教程:创建数据模型以及导出
    查看>>
    PowerDesigner使用教程:右侧工具栏显示/隐藏
    查看>>
    PowerDesigner使用教程:导出sql文件以及解决中文乱码问题
    查看>>
    PowerDesigner使用教程:时间字段设置
    查看>>
    PowerDesigner使用教程:给字段添加唯一约束
    查看>>
    QGIS中怎样设置图层样式并导出地图样式
    查看>>
    PowerDesigner使用笔记
    查看>>
    QGIS中怎样实现数据坐标系转换
    查看>>
    PowerDesigner学习--基本步骤
    查看>>
    PowerDesigner导出Report通用报表
    查看>>
    PowerDesigner教程系列(二)概念数据模型
    查看>>
    Powerdesigner显示表的comment和列的comment的方法
    查看>>
    PowerDesigner最基础的使用方法入门学习
    查看>>
    PowerDesigner版本控制器设置权限
    查看>>
    PowerDesigner生成数据模型并导出报告
    查看>>
    QGIS中导入dwg文件并使用GetWKT插件获取绘制元素WKT字符串以及QuickWKT插件实现WKT显示在图层
    查看>>