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

    你可能感兴趣的文章
    PostGreSql工作笔记004---PostGreSql修改密码_windows和linux下修改
    查看>>
    Postgresql常用命令行操作_以及Navicat操作PostGis时的问题_自动截取长度_WKB structure does not match exp---PostgreSQL工作笔记005
    查看>>
    PostgreSQL忘记密码
    查看>>
    PostgreSQL数据库pg_dump命令行不输入密码的方法
    查看>>
    PostgreSQL新手入门
    查看>>
    postgresql树状结构查询示例
    查看>>
    PostgreSQL流复制参数max_wal_senders详解
    查看>>
    postgresql流复制配置
    查看>>
    PostgreSQL清空表并保留表结构、清空数据库还原数据库为新建时的状态的方法
    查看>>
    PostgreSQL的 initdb 源代码分析之九
    查看>>
    PostgreSQL的安装与使用指南
    查看>>
    postman之参数化详解
    查看>>
    Postman入门到入土
    查看>>
    Postman如何做接口测试:如何导入 swagger 接口文档
    查看>>
    Postman如何做接口测试:如何导入 swagger 接口文档
    查看>>
    Qlik助力新西兰最大私人医院提高病患护理水平
    查看>>
    Postman如何生成接口文档
    查看>>
    Postman学习之常用断言
    查看>>
    postman居然是用electron开发的,我们来认识下这个框架吧
    查看>>
    postman常用公共函数
    查看>>