微机原理课程设计(学生课程成绩统计)需要用汇编语言 10

微机原理课程设计(学生课程成绩统计)需要用汇编语言有没有大佬... 微机原理课程设计(学生课程成绩统计)需要用汇编语言有没有大佬 展开
 我来答
  • 你的回答被采纳后将获得:
  • 系统奖励15(财富值+成长值)+难题奖励20(财富值+成长值)+提问者悬赏10(财富值+成长值)
鞠婧祎老婆柠祎
2018-06-25 · TA获得超过726个赞
知道小有建树答主
回答量:2416
采纳率:67%
帮助的人:405万
展开全部
有的啊,看头像大佬
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
gcbjoy
2018-09-10 · TA获得超过1.1万个赞
知道大有可为答主
回答量:1.1万
采纳率:92%
帮助的人:2096万
展开全部
        CODE  SEGMENT
              ASSUME    CS:CODE
 
       SCORE  DB        100 DUP(?)
         NUM  EQU       $-SCORE
       COUNT  DB        7 DUP(0)
 
      START:  PUSH      CS
              POP       DS
              PUSH      CS
              POP       ES
              ; ==============随机生成 num 个数 
              LEA       DI,SCORE
              MOV       CX,NUM
              CLD
         @1:
              CALL      RAND
              STOSB
              MOV       AX,1
              CALL      DELAY_PROC
              LOOP      @1
              ;===============输出这 num 个数 
              CALL      LFCR
              LEA       SI,SCORE
              MOV       CX,NUM
              CLD
        @11:
              LODSB
              CBW
              CALL      DSPAXS
              LOOP      @11
              ;========================
              LEA       SI,SCORE
              LEA       DI,COUNT
              MOV       CX,NUM
              CLD
         @2:
              LODSB
              CMP       AL,-2
              JNE       @3
              INC       BYTE PTR [DI+5]
              JMP       @7
         @3:
              CMP       AL,-1
              JNE       @4
              INC       BYTE PTR [DI+6]
              JMP       @7
         @4:
              CMP       AL,50
              JGE       @5
              MOV       AL,50
         @5:
              CMP       AL,100
              JL        @6
              MOV       AL,99
         @6:
              SUB       AL,50
              MOV       AH,0
              MOV       BL,10
              DIV       BL
              MOV       BL,AL
              MOV       BH,0
              INC       BYTE PTR [DI+BX]
         @7:
              LOOP      @2

              CALL      LFCR
              CALL      LFCR
              LEA       SI,COUNT
              MOV       CX,7
         @8:
              LODSB
              CBW
              CALL      DSPAX
              LOOP      @8

      @EXIT:
              MOV       AH,4CH
              INT       21H
 
;===============================================================              
  DELAY_PROC  PROC      NEAR        ;延迟子程式,  延迟   ax/18秒
              PUSH      ES
              PUSH      DX
              MOV       DX,40H
              MOV       ES,DX
              MOV       DX,ES:[006CH]           ;取系统1/18秒计数
              ADD       DX,AX       ; 延时 x/18
    DELAY10:
              CMP       ES:[006CH],DX           ;时限到了?
              JBE       DELAY10     ;没
              POP       DX
              POP       ES
              RET
  DELAY_PROC  ENDP
;============================================================
        RAND  PROC      NEAR
              ; 利用时钟的低位反转除103的余数作为随机数 (结果在0 ~ 102) 
              ;                                    ( 减2后的结果在 -2 ~ 100)              
              ; 随机数在ax中带回 
              PUSH      BX
              PUSH      CX
              PUSH      DX
              PUSHF
              MOV       AH,0
              INT       1AH
              ; MOV       AX,CX     
              MOV       BX,DX
              MOV       CX,16
     @RAND1:
              ROR       BX,1
              RCL       AX,1
              LOOP      @RAND1
              MOV       DX,0
              MOV       BX,103
              DIV       BX
              MOV       AX,DX
              SUB       AL,2        ;********
              POPF
              POP       DX
              POP       CX
              POP       BX
              RET
        RAND  ENDP
;==================================
       LFCR:  PUSH      AX
              PUSH      DX
              MOV       AH,2
              MOV       DL,13
              INT       21H
              MOV       DL,10
              INT       21H
              POP       DX
              POP       AX
              RET
;=================================
; 输出有符号数,输出的数应放 ax中 
      DSPAXS  PROC      NEAR
              PUSH      AX
              OR        AX,AX
              JNS       @DSPAXS
              NEG       AX
              PUSH      AX
              PUSH      DX
              MOV       AH,2
              MOV       DL,'-'
              INT       21H
              POP       DX
              POP       AX
    @DSPAXS:
              CALL      DSPAX
              POP       AX
              RET
      DSPAXS  ENDP
;===============================
       DSPAX  PROC      NEAR
              PUSH      AX
              PUSH      BX
              PUSH      CX
              PUSH      DX
              PUSHF
              XOR       CX,CX
              MOV       BX,10
    @DSPAX1:
              XOR       DX,DX
              DIV       BX
              INC       CX
              OR        DX,30H
              PUSH      DX
              CMP       AX,0
              JNE       @DSPAX1
              MOV       AH,2
   @DISPAX2:
              POP       DX
              INT       21H
              LOOP      @DISPAX2
              MOV       DL,32
              INT       21H
              POPF
              POP       DX
              POP       CX
              POP       BX
              POP       AX
              RET
       DSPAX  ENDP
;================================ 
        CODE  ENDS
              END       START
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式