广工微机实验代码(部分)

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

实验1 编程练习1

STACK SEGMENT STACK

DW 64 DUP (?)

STACK ENDS

DATA SEGMENT

ORG 0500H

DATA1 DB 5 DUP (?)

ORG 050AH

DATA2 DB 5 DUP (?)

DATA ENDS

CODE SEGMENT

ASSUME CS : CODE, DS : DATA START : MOV AX, DATA

MOV DS, AX

LEA SI, DATA1

LEA DI, DATA2

MOV CX, 05H

A : MOV AL, [SI]

CMP AL, 30H

JB B

CMP AL, 39H

JA B

SUB AL, 30H

MOV [DI], AL

JMP C

B: MOV [DI], 0FFH

C: INC SI

INC DI

LOOP A

MOV AH, 4CH

INT 21H

CODE ENDS

END START

实验二编程练习2

STACK SEGMENT STACK

DW 64 DUP (?)

STACK ENDS

DATA SEGMENT

ORG 0500H

DATA1 DB 6 DUP (?)

ORG 0510H

DATA2 DB ?

DATA ENDS

CODE SEGMENT

ASSUME CS : CODE, DS : DATA

START : MOV AX, DATA

MOV DS, AX

MOV SI, OFFSET DATA1

MOV DI,OFFSET DATA2

MOV CX, 06H

MOV AX, 0H

CYCLE: ADD AL, [SI]

ADC AH, 0

INC SI

LOOP CYCLE

MOV BL, 06H

DIV BL

MOV BL, 0AH

DIV BL

MOV CL, 4

SHL AL, CL

ADD AL, AH

MOV [DI], AL

MOV AH, 4CH

INT 21H

CODE ENDS

END START

实验三编程练习1

DATAS SEGMENT

ORG 0500H

DATA1 DB 09H,12H,80H,78H,0C8H,00H,00H,0FEH,99H,34H ORG 0510H

DATA2 DB 3 DUP(?)

DATAS ENDS

STACKS SEGMENT

;此处输入堆栈段代码

STACKS ENDS

CODES SEGMENT

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

START:

MOV AX,DATAS

MOV DS,AX

XOR AX,AX

XOR BX,BX

MOV SI,OFFSET DATA1

XOR CX,CX

MOV CL,[SI]

HAHA:MOV BH,[SI]

CMP BH,00H

JZ LING

JS FUSHU

INC BL

JMP CCC

LING:INC AH

JMP CCC

FUSHU:INC AL

JMP CCC

CCC: INC SI

LOOP HAHA

MOV DI,OFFSET DATA2

MOV [DI],BL

INC DI

MOV [DI],AL

INC DI

MOV [DI],AH

MOV AH,4CH

INT 21H

CODES ENDS

实验四编程练习4

DATAS SEGMENT

DATA1 DB 'Input two numbers A&B:$'

DATA2 DB ' $'

DATAS ENDS

CODES SEGMENT

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

MOV AX,DATAS

MOV DS,AX

MOV DX,OFFSET DATA1

MOV AH,09H

INT 21H

MOV CL,0FFH

AA: MOV DX,OFFSET DATA2 MOV AH,09H

INT 21H

MOV AH,01H

INT 21H

CMP AL,0DH

JZ DONE

MOV BH,AL

SUB BH,30H

MOV AH,09H

INT 21H

MOV AH,01H

INT 21H

CMP AL,0DH

JZ DONE

MOV AH,09H

INT 21H

SUB AL,30H

ADD AL,BH

XOR AH,AH

MOV BL,0AH

DIV BL

ADD AL,30H

MOV DL,AL

MOV BH,AH

MOV AH,02H

INT 21H

ADD BH,30H

MOV DL,BH

MOV AH,02H

INT 21H

LOOP AA

DONE:MOV AH,4CH

INT 21H

CODES ENDS

END START

实验五编程练习1 STACK SEGMENT STACK

相关文档
最新文档