Sie sind auf Seite 1von 3

Aman Arora 06496502714

EXPERIMENT 7

AIM

To find the maximum no. in a given string (16 Bytes Long) and store it in location 0510.

PROGRAM

Memory Address Opcodes Mnemonics Comments

0400 BE,00,05 MOV SI,0500 Load SI Register with starting address


of string.
0403 B9,10,00 MOV CX,0010 Initialize Counter Register (with the
length of string i.e. no. of bytes).

0406 B4,00 MOV AH,00 Initialize the 8-bit Accumulator

0408 3A,24 CMP AH,[SI] Compare the 1st data byte of the string
with 00
040A 73,02 JAF 040E If both bytes match (above is equal)
then branch to (1).
040C 8A,24 MOV AH,[SI] Else, move the contents of (0500) into
8-bit Accumulator, i.e., a real no. in AH.

040E 46 INC SI Point at the next address of string.

040F 49 DEC CX Decrement the counter value.


0410 75,F6 JNZ 0408 If not zero, continue processing.

0411 88,24 MOV [SI],AH Maximum no. in 0510 address.

0413 F4 HLT Halt.


Aman Arora 06496502714

STEPS

1. On Display Enter Return Key.


2. Press Enter Key of Keyboard
3. On Display [>A.D.F.G.I.M.P.T.U]
4. Press A of keyboard
5. Enter first location of Program 0400 through keyboard then press Enter Key
6. Now Enter program Mnemonic one by one using Enter Key.
7. Press Reset Key.
8. On Display Enter Return Key.
9. Then Press Enter Key of keyboard.
10. Then Press G from keyboard
11. Then Press Enter
12. Again Press Reset Key
13. On Display Enter Return Key
14. Now Press D and Enter First Data Location e.g. 0500
15. Enter data one by one upto last location of data.
16. Then Press Reset Key.
17. On Display Enter Return Key
18. Now Press G and Enter
19. Then again press Reset Key.
20. Then Press D and Result location address 0510 and Press Enter Key.

EXAMPLE
Aman Arora 06496502714

Before Execution:

Memory Code Entered Memory Code Entered


Location Location
0500 01 0508 12
0501 02 0509 08
0502 03 050A 09
0503 04 050B 0A
0504 05 050C 0B
0505 06 050D 0E
0506 15 050E 0C
0507 07 050F 0D

After Execution:

Memory Location Result


0510 15

START

PRESS
PRESS INITIALIZE
DDISPLAY
A ON ANDTHEENTER
OF DATA
STOP MEMORY
VARIOUS VALUES
OPTIONS TOLOCATION
TO BE
COMPARE
COMPARED
INITIALIZE
THE NUMBERS0510
THE INTOMEMORY
DISPLAY
MNEMONICS OFLOCATIONS
THE RESULTONE
THE OPERATIONS BY
TO BE

Das könnte Ihnen auch gefallen