欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

微机实验代码

程序员文章站 2024-02-02 16:21:52
...

微机实验代码1:

data segment
  org  2000h
  num1  db   12h,95h,0f1h,0c2h,82h,2h,10h,34h
  count equ   $-num1
  org  3000h
  num2  db    23h,0dfh,023h,3fh,3ch,0b3h,57h,3h
  org  5000h
  res   db    count dup(0)
  data  ends

微机实验代码2:

MOV   AX,WORD PTR [FIRST]
ADD    AX,WORD PTR [SECOND]
MOV  WORD PTR [THIRD],AX
MOV   AX,WORD PTR [FIRST+2]
ADC    AX,WORD PTR [SECOND+2]
MOV  WORD PTR [THIRD+2],AX

微机实验总代码:

;sample 顺序结构 查0~9平方表
        DATA   SEGMENT
        INPUT  DB 'PLEASE INPUT X(0~9):$'
        TABLE  DB 0,1,4,9,16,25,36,49,64,81
        XX     DB ?
        YY     DB ?
        DATA   ENDS
        
        STACK  SEGMENT PARA STACK 'STACK'
               DB 100 DUP (?)
        STACK  ENDS
        
        CODE   SEGMENT
               ASSUME CS:CODE,DS:DATA
        START  PROC FAR
               PUSH DS
               MOV AX,0
               PUSH AX
               MOV AX,DATA
               MOV DS,AX
               MOV AH,9
               LEA DX,INPUT
               INT 21H
               MOV AH,1
               INT 21H
               AND AL,0FH
               MOV XX,AL
               MOV BX,OFFSET TABLE
               MOV AH,0
               MOV AL,XX
               ADD BX,AX
               MOV AL,[BX]
               MOV YY,AL
               RET
        START  ENDP
         CODE   ENDS
                 END START