|  | 
 
 
 楼主|
发表于 2018-8-21 21:43:12
|
显示全部楼层 
| 将人均工资补上之后~ 我感觉我把程序变复杂了!!!! 
 
 
 复制代码DATAS SEGMENT
    db '1975','1976','1977','1978','1979','1980','1981','1982','1983'
    db '1984','1985','1986','1987','1988','1989','1990','1991','1992'
    db '1993','1994','1995'
        ;以上是表现21年的21个四字节的字符串
        ;0~53H
    dd 16,22,382,1356,2390,8000,16000,24486,50065,97479,140417,197514
    dd 345980,590827,803530,1183000,1843000,2759000,3753000,4649000,5937000
        ;以上是表示21年公司总收入的21个dword型数据
        ;54~0A7H
    dw 3,7,9,13,28,38,130,220,476,778,1001,1442,2258,2793,4037,5635,8226
    dw 11542,14430,15257,17800
    ;以上是表现21年公司雇员人数的21个word型数据
    ;0A8H~0D1H
    db 0
DATAS ENDS
STACKS SEGMENT
    dw 8 dup (0)
STACKS ENDS
table segment
        db 21 dup ('year summ ne ?? ')
table ends
CODES SEGMENT
    ASSUME CS:CODES,DS:DATAS,SS:STACKS,ES:table
START:
    MOV AX,DATAS
    MOV DS,AX
    mov ax,table
    mov es,ax
    mov ax,STACKS
    mov ss,ax
    mov sp,16
    ;        es:[bx+0+si] 年份
    ;        es:[bx+5+si] 收入
    ;        es:[bx+10+si] 雇员数
    ;        es:[bx+D+si] 人均收入
    ;bx行地址,idata为属性地址,si为属性内部地址
    mov cx,21
    mov bx,0
    mov di,0
    mov dx,0
    mov si,0
    
  s:push si
          push cx
          mov cx,4
          mov si,0
 s0:
    mov al,ds:[di]
    mov es:[bx+si],al
    
    mov al,ds:54H[di]
    push bx
    add bx,5
    mov es:[bx+si],al
    inc di
    inc si
    pop bx
    loop s0
    
    
        mov cx,2
        push di
        mov si,0
 s1:mov di,dx
         mov al,ds:0A8H[di]
         push bx
         add bx,10
         mov es:[bx+si],al
         inc dx
         inc si
         pop bx
         loop s1
    pop di
    
        pop cx
        pop si
        push di
        push dx
        
        mov di,ds:[0D2H]
        mov dx,ds:[si+56H]
        mov ax,ds:[si+54H]
        div word ptr ds:[di+0A8H]
        mov es:[bx+0DH],al
        mov es:[bx+0EH],ah
        pop dx
        add si,4
        push cx
        mov cx,ds:[0D2H]
        add cx,2
        mov ds:[0D2H],cx
        pop cx
        pop di
        add bx,16
        loop s
        
        
    MOV AH,4CH
    INT 21H
CODES ENDS
    END START
 | 
 |