Sie sind auf Seite 1von 17

EXP 7

Procedure 1 - 1
org 100h L: MOV AX,0 POP AX

.data MOV AL,[SI] MOV [BX],AX

DT1 DB 1,2,3,4,5,6,7,8,9,'A' PUSH AX INC BX

.code INC SI LOOP L2

MOV AX,@DATA LOOP L ret

MOV ES,AX MOV DX,2000H

MOV SI,OFFSET DT1 MOV DS,DX

MOV BX,200h MOV CX,10

MOV CX,10 L2:


Procedure 1 - 1
org 100h L: MOV AX,0 POP AX

.data MOV AL,[SI] MOV [BX],AX

DT1 DB 1,2,3,4,5,6,7,8,9,'A' PUSH AX INC BX

.code INC SI LOOP L2

MOV AX,@DATA LOOP L ret

MOV ES,AX MOV DX,2000H

MOV SI,OFFSET DT1 MOV DS,DX

MOV BX,200h MOV CX,10

MOV CX,10 L2:


Procedure 1 - 2
org 100h MOV [BX],AL

MOV AX,2000H SUB BX,1

MOV DS,AX LOOP L

MOV AX,0 ret

MOV BX,200H

MOV CX,481

MOV AL,0A0H

L:

ADD AL,1
Procedure 1 - 2
org 100h MOV [BX],AL

MOV AX,2000H SUB BX,1

MOV DS,AX LOOP L

MOV AX,0 ret

MOV BX,200H

MOV CX,481

MOV AL,0A0H

L:

ADD AL,1
Procedure 1 - 4
org 100h MOV DI,OFFSET DT2 MOV SI,OFFSET DT1

.data MOV CX,8 MOV AL,[SI]

DT1 DB 86,76,25,45,53,23,89,71,37 MOV AL,[SI] MOV CX,8

DT2 DB 0 L1: INC SI L2: INC SI

DT3 DB 0 CMP AL,[SI] CMP AL,[SI]

.code JLE MIN JG MAX

MOV AX,@DATA MOV AL,[SI] MOV AL,[SI]

MOV DS,AX MIN:LOOP L1 MAX:LOOP L2

MOV SI,OFFSET DT1 MOV DT2,AL MOV DT3,AL


Procedure 1 - 4
org 100h MOV DI,OFFSET DT2 MOV SI,OFFSET DT1

.data MOV CX,8 MOV AL,[SI]

DT1 DB 86,76,25,45,53,23,89,71,37 MOV AL,[SI] MOV CX,8

DT2 DB 0 L1: INC SI L2: INC SI

DT3 DB 0 CMP AL,[SI] CMP AL,[SI]

.code JLE MIN JG MAX

MOV AX,@DATA MOV AL,[SI] MOV AL,[SI]

MOV DS,AX MIN:LOOP L1 MAX:LOOP L2

MOV SI,OFFSET DT1 MOV DT2,AL MOV DT3,AL


Procedure 1 - 5
org 100h MOV AL,2H ;X1 =2 HLT

.data MOV AH,2H ;X2 =1 AW:MOV DT3,AH

DT1 DB 0 ;X1>X2 CMP AH,AL HLT

DT2 DB 0 ;X1=X2 JA AW RET

DT3 DB 0 ;X1<X2 JE EQ

.code JB BW

MOV AX,@DATA EQ:MOV DT2,AL

MOV DS,AX HLT

MOV SI,OFFSET DT1 BW:MOV DT1,AL


Procedure 1 - 5
org 100h MOV DI,OFFSET DT2 MOV SI,OFFSET DT1

.data MOV CX,8 MOV AL,[SI]

DT1 DB 86,76,25,45,53,23,89,71,37 MOV AL,[SI] MOV CX,8

DT2 DB 0 L1: INC SI L2: INC SI

DT3 DB 0 CMP AL,[SI] CMP AL,[SI]

.code JLE MIN JG MAX

MOV AX,@DATA MOV AL,[SI] MOV AL,[SI]

MOV DS,AX MIN:LOOP L1 MAX:LOOP L2

MOV SI,OFFSET DT1 MOV DT2,AL MOV DT3,AL


Procedure 1 - 6
org 100h MOV AL,0AH ;X1 =A HLT

.data MOV AH,0CH ;X2 =C AW:MOV DT3,AH

DT1 DB 0 ;X1>X2 CMP AH,AL HLT

DT2 DB 0 ;X1=X2 JA AW RET

DT3 DB 0 ;X1<X2 JE EQ

.code JB BW

MOV AX,@DATA EQ:MOV DT2,AL

MOV DS,AX HLT

MOV SI,OFFSET DT1 BW:MOV DT1,AL


Procedure 1 - 6
org 100h MOV DI,OFFSET DT2 MOV SI,OFFSET DT1

.data MOV CX,8 MOV AL,[SI]

DT1 DB 86,76,25,45,53,23,89,71,37 MOV AL,[SI] MOV CX,8

DT2 DB 0 L1: INC SI L2: INC SI

DT3 DB 0 CMP AL,[SI] CMP AL,[SI]

.code JLE MIN JG MAX

MOV AX,@DATA MOV AL,[SI] MOV AL,[SI]

MOV DS,AX MIN:LOOP L1 MAX:LOOP L2

MOV SI,OFFSET DT1 MOV DT2,AL MOV DT3,AL


Procedure 2 - 1

org 100h MOV SI,OFFSET DT3 INC DI

.data MOV CX,5 INC BX

DT1 DB 1,5,10,-12,0 L: LOOP L

DT2 DB 4,-5,-10,-12,0 MOV AX,0 A:MOV [SI],1

DT3 DB 5 DUP(0) MOV AL,[BX] INC SI

.code MOV AH,[DI] INC DI

MOV AX,@DATA ADD AL,AH INC BX

MOV DS,AX CMP AL,0 LOOP L

MOV BX,OFFSET DT1 JZ A RET

MOV DI,OFFSET DT2 INC SI


Procedure 2 - 1
org 100h MOV AL,0AH ;X1 =A HLT

.data MOV AH,0CH ;X2 =C AW:MOV DT3,AH

DT1 DB 0 ;X1>X2 CMP AH,AL HLT

DT2 DB 0 ;X1=X2 JA AW RET

DT3 DB 0 ;X1<X2 JE EQ

.code JB BW

MOV AX,@DATA EQ:MOV DT2,AL

MOV DS,AX HLT

MOV SI,OFFSET DT1 BW:MOV DT1,AL


Discussion 2 - 1
org 100h ADD AL,[SI] L2:

.data ADC AH,0h MOV AX,[SI]

DT1 DB 66,75,65,45,60,64,96 INC SI CMP AL,65

DT2 DB 0 LOOP L1 JGE CHECK ;TO CHECK 65 OR ABOVE

DT3 DB 0 MOV DL,7 ;AVG OF MARK DEC SI

.code DIV DL LOOP L2

MOV SI,OFFSET DT1 MOV [BX],AL CHECK:

MOV BX,OFFSET DT2 MOV AX,0 ADD DL,1

MOV AX,0 MOV DX,0 DEC SI

MOV CL,7 MOV CX,7 LOOP L2

L1: DEC SI MOV DT3,DL


Discussion 2 - 1

org 100h ADD AL,[SI] L2:

.data ADC AH,0h MOV AX,[SI]

DT1 DB 66,75,65,45,60,64,96 INC SI CMP AL,65

DT2 DB 0 LOOP L1 JGE CHECK ;TO CHECK 65 OR ABOVE

DT3 DB 0 MOV DL,7 ;AVG OF MARK DEC SI

.code DIV DL LOOP L2

MOV SI,OFFSET DT1 MOV [BX],AL CHECK:

MOV BX,OFFSET DT2 MOV AX,0 ADD DL,1

MOV AX,0 MOV DX,0 DEC SI

MOV CL,7 MOV CX,7 LOOP L2

L1: DEC SI MOV DT3,DL


Discussion 2 - 2
org 100h MOV CX,8 INC SI

.data L1: LOOP L1

DT1 DB -5,4,-7,-4,7,12,-8,10 MOV AL,[SI] PO: ;FOR POSITIVE NO.

DT2 DB 5 DUP(0) CMP AL,0 MOV [DI],AL

DT3 DB 5 DUP(0) JL NE INC DI

.code JGE PO INC SI

MOV AX,@DATA INC SI LOOP L1

MOV DS,AX LOOP L1 HLT

MOV SI,OFFSET DT1 NE: ;FOR NEGATIVE NO. ret

MOV BX,OFFSET DT2 MOV [BX],AL

MOV DI,OFFSET DT3 INC BX


Discussion 2 - 2

org 100h ADD AL,[SI] L2:

.data ADC AH,0h MOV AX,[SI]

DT1 DB 66,75,65,45,60,64,96 INC SI CMP AL,65

DT2 DB 0 LOOP L1 JGE CHECK ;TO CHECK 65 OR ABOVE

DT3 DB 0 MOV DL,7 ;AVG OF MARK DEC SI

.code DIV DL LOOP L2

MOV SI,OFFSET DT1 MOV [BX],AL CHECK:

MOV BX,OFFSET DT2 MOV AX,0 ADD DL,1

MOV AX,0 MOV DX,0 DEC SI

MOV CL,7 MOV CX,7 LOOP L2

L1: DEC SI MOV DT3,DL