Вы находитесь на странице: 1из 6

Microprocessor System (Lab 3 Report) Step Command: This command is used for single step execution of a program.

In other words, this step (ST) command permits program instructions in memory to be executed individually. With each instruction executed, control is returned to the monitor from the program being executed. Format ST [ <start address> ] , [ [ <start address> ,* . Example 3.1: The following program adds the 8-bit numbers at AL (lower byte of AX register) and BL (lower byte of BX register), subtract 24H from the result and multiply it with 04H. The final result is then stored at 0100:0000H 1- Press <RESET > button which means reset the device to the ordinal state to start from the beginning. Bye starting with pressing the button <reset> we remove everything on the processor screen and allows us to terminate any recent activities and to return the processor to the initialized state. 2- Using the Examine Register (ER) command. We will change the value of Data segment (DS) register to 0100H: iiiiiiivPress ER Press DS Enter 0100 Press EXEC

3- Similarly to the step 2 we change the value of AX and BX registers as shown below using the steps in (2)

Register AX BX CX

Data 0035H 0068H 0000H

4- Using the Examine Byte (EB) command, enter the following program codes in the memory locations specified: Address 2000H 2001H 2002H 2003H 2004H 2005H 2006H 2007H 2008H 2009H 200AH 200BH Codes 02H C3H 2CH 24H B1H 04H F6H E1H A3H 00H 00H CCH Instruction Instruction 1: ADD AL,BL Instruction 2: SUB AL,24H Instruction 3: MOV CL,04H Instruction 4: MUL CL Instruction 5: MOV [0000H], AX INT 3 Description Add BL to AL, store result in AL Subtract the data specified from AL, store result in AL Store 04H in CL Multiply CL to AL, store result in AX Store the data from AX into DS:0000H Program stops

According to program codes above we will follow the instructions to fill the table3.1 Row No. 1 2 3 4 5 6 Address 2000H 2002H 2004H 2006H 2008H AX 0035 009D 0079 0079 01E4 01E4 BX 0068 0068 0068 0068 0068 0068 CX 0000 0000 0000 0004 0004 0004 DS:0000H 8E2E F4E7 D457 0606 FF00 01E4

EXPLAINATION OF PROCEDURE ABOVE: For the ROW 1 we have the values of AX : 0035H , BX : 0068H , CX : 0000H and for the ROW 2 in AX it will be filled according to instruction 1 which is add (AL to BL and put the result in ALL = 0035H + 0068H = 009D ) and put the rest of values for BX,CX as the previous values. For ROW 3 according to instruction 2 it subtracts the data 24H from AL (009DH - 0024H = 0079) and put it to AL and put the rest of values for BX, CX as the previous values. And then for ROW 4 according to instruction 3 we will take the value 04H and we store it in CL and put the rest of values for AX, BX as the previous values without changing. And after that for ROW 5 according to instruction 4 we will multiply the value in CL: 0004H with the value of AL: 0079H which is 01E4H and put it in AL. And put the rest of values for BX, CX as the previous values without changing. Finally for ROW 6 5 according to instruction 5 it will store data from AX: 01E4H to DS: 0000H. GO COMMAND Function: The GO command is used to transfer control of the 8086/8088 from the keyboard monitor program to user's program. Format GO [ <address> ] [ , <breakpoint address> ] .

Example3.2 Execute the program in Example 3.1 1: Press <reset > 2 set <DS> to 0100H by following the steps in (2) of example 3 4 Enter the initial values of AX and BX registers by following the steps in 2 and 3 of example 3.1 5 Examine the contents of AX ,BX,CX registers and memory locations DS:0000H by following the steps 5 of example 3.1 and fill in the values for row 1 of table 3.2 6 Enter the program codes by following the steps in 4 of example 3.1 7 press GO 8 Enter 2000 9 Press NEXT 10 Enter 2004 11 Press <EXEC> 12 Examine the contents of AX ,BX,CX registers and memory locations DS:0000H by following the steps 5 of example 3.1 and fill in the values for row 2 of table 3.2 13 Next press GO and Enter 2004 and press <EXEC> 14 Examine the contents of AX ,BX,CX registers and memory locations DS:0000H by following the steps 5 of example 3.1 and fill in the values for row 3 of table 3.2

Row Number 1 2 3

AX 0053 0079 00BD

BX 0068 0068 0068

CX 0000 0000 0000

DS:0000H F4E7 D457 0606

In table 3.2 the values of Ax are same for the three row 1 and 2 comparing with table 3.1 in rows 1 and 3 but row number 3 in table 3.2 is different in row 6 in table 3.1 . Exercise: 1 Clear the contents of AX and BX registers Register Data AX 0000H BX 0000H 2 Enter the following program codes using examine bite command Address 2000H 2001H 2002H 2003H 2004H 2005H 2006H 2007H 2008H 2009H 200AH Codes B0H 74H FEH C0H B3H 01H F6H DBH 02H C3H CCH Instruction Instruction 1: MOV AL,74H Instruction 2: INC AL Instruction 3: MOV BL,01H Instruction 4: NEG BL Instruction 5: ADD Al,BL INT 3 Description Store 74H in Al Increment data in AL by 1 Store 01H in BL Negate (2s complement )in BL Add BL to AL, store result in AL Program stops

3 By examine the contents of BX, AX registers (step 5) we fill the values into table 3.3

Row 1 2 3 4 5 Address 2000H 2002H 2004H 2006H 2008H AX 0074 0075 0075 0075 1186 BX 00FF 00FF 0001 1111 1111

EXPLAINATION OF PROCEDURE ABOVE: 1 For row 1 we store 0074 in AL register 2 We increment data in AL by 1 in the row 2 3 We store 0001H in BX register 4 We find the second complement for data in BL to be converted from 0001 into 1110 in first complement and then we find the second complement from that to become 1111 and we put it in BL register 5 Finally we add the value of BL to AL (1111+0075=1186)and we put the result in AL register .

Вам также может понравиться