汇编语言上机考试三星题6

DATAS SEGMENT

    BUF1 DW 0FFFFH,7FFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH,0FFFFH

    BUF10 DB '00000,00000,00000,00000,00000,00000,00000,00000,00000,00000',0DH,0AH,'$'

    ;此处输入数据段代码 

DATAS ENDS

STACKS SEGMENT

    ;此处输入堆栈段代码

STACKS ENDS

CODES SEGMENT

    ASSUME CS:CODES,DS:DATAS,SS:STACKS

START:

    MOV AX,DATAS

    MOV DS,AX

    MOV ES,AX

    MOV SI,0

NEXT:

CMP BUF1[SI],0

JG GOON

NEG BUF1[SI]

GOON:

ADD SI,2

CMP SI,20

JB NEXT

MOV SI,0

MOV AX,BUF1[SI]

MOV DX,0

MOV CX,10

MOV DI,4

AGAIN:

DIV CX

MOV BUF10[DI],DL

ADD BUF10[DI],30H

MOV DX,0

DEC DI

CMP DI,0

JGE AGAIN

ADD SI,2

LOOP1:

MOV AX,BUF1[SI]

MOV DX,0

MOV CX,10

ADD DI,11

LOOP2:

DIV CX

ADD DL,30H

MOV BUF10[DI],DL

MOV DX,0

DEC DI

CMP BUF10[DI],','

JNE LOOP2

ADD SI,2

CMP SI,20

JB LOOP1

END0:

LEA DX,BUF10

MOV AH,09H

INT 21H

    ;此处输入代码段代码

    MOV AH,4CH

    INT 21H

CODES ENDS

    END START

你可能感兴趣的:(汇编语言上机考试三星题6)