8086 programs Flashcards

1
Q

16bit addition

A

MOV AX,1111H
MOV BX,2222H
ADD AX,BX
MOV [2000],AX
HLT
F4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

16 bit subtraction

A

MOV AX,2222H
MOV BX,1111H
SUB AX,BX
MOV [2002],AX
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

16 bit multiplication

A

MOV AX,3H
MOV BX,2H
MUL BX
MOV [2004],AX
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

16 bit division

A

MOV AX,0006H
MOV BX,0003H
DIV BX
MOV [2006],AX
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

addition with carry using condition
To add two 16 bit numbers stored in [1200H]-[1201H] and [1202H]-[1203H]

A

MOV AX,[1200]
MOV BX,[1202]
MOV CL,00
ADD AX,BX
JNC 104D
INC CL
MOV [2008],AX
MOV [200A],CL
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

average of three numbers

A

MOV BX,3H
MOV AX,2H
ADD AX,2H
ADD AX,2H
DIV BX
MOV [2200], AX
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

sum of array of numbers

A

MOV CX,05H
MOV AX, 0000H
MOV BX, 0000H
MOV SI,3200
REPEAT: MOV BL,[SI]
ADD AX, BX
INC SI
DEC CX
JNZ REPEAT
JNZ 1227
MOV DI, 2202H
MOV [DI],AX
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

sum of corresponding elements of two arrays

A

MOV SI,3206
MOV CL, [SI]
MOV CH, 00H
INC SI
MOV DI, 3217
MOV SI,3206
MOV CL, [SI]
MOV CH, 00H
INC SI
MOV DI, 3217
MOV AL,[SI]
ADD AL,[DI]
MOV [SI], AL
INC SI
INC DI
LOOP 1244
HLT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly