LABEL | CODE | COMMENT |
| MOV AH, 1H | keyboard input subprogram |
| INT 21H | character input |
|
| character is stored in AL |
| MOV C, AL | copy character from AL to C |
|
|
|
LABEL | CODE | COMMENT |
| ORG0000H |
|
| MOV DX, #07H | move the value 7 to the register AX |
| MOV AX, #09H | move the value 9 to accumulator AX |
| ADD AX, 00H | add CX value with R0 value and stores the result in AX |
|
|
|
| ORG5000H |
|
| MOV BX, #07H | move the value 7 to the register BX |
| MOV DX, #09H | move the value 9 to accumulator DX |
| MUL DX, 00H | Multiply DX value with R0 value and stores the result in DX |
|
|
|
| ORG8000H |
|
| MOV BX, #07H | move the value 7 to the register BX |
| MOV AX, #08H | move the value 8 to accumulator AX |
| SUBB AX, 09H | Result value is stored in the Accumulator AX |
|
|
|
| ORG2000H |
|
| MOV BX, #07H | move the value 7 to the register BX |
| MOV AX, #18H | move the value 18 to accumulator AX |
| DIV AX, 09H | Final value is stored in the Accumulator AX |
| HLT |
|
LABEL | CODE | COMMENT |
| MOV SI, 600 | assigns 600 to SI |
| MOV DI, 500 | assigns 500 to DI |
| MOV BL, [SI] | moves the content of [SI] to BL register i.e. value of divisor will be stored in BL |
| INC SI | increment the content of SI by 1 |
| MOV AX, [SI] | moves the content of [SI] and [SI + 1] to AX register i.e. value of dividend will be stored in AX |
| DIV BL | divide the content of AX by BL, after execution of this instruction the quotient get stored in AL and remainder in AH |
| MOV [DI], AX | moves the content of AX to [DI] |
| HLT | stops the execution of program |
LABEL | CODE | COMMENT |
| MOV CX, [5000] | loads 5000 Memory location content to CX Register |
| MOV AX, 0001 | loads AX register with 0001 |
| MOV DX, 0000 | loads DX register with 0000 |
| MUL CX | multiply AX with CX and store result in DX:AX pair |
| LOOP 040A | runs loop till CX not equal to Zero |
| MOV [6000], AX | store AX register content to memory location 6000 |
| MOV [6001], DX | store DX register content to memory location 6001 |
| HLT | stops the execution of program |
|
|
|
LABEL | CODE | COMMENT |
DATA | DB 50,44,80,98,42 | 12H, 2CH, 50H, 62H, 2AH |
| MOV CX, 5 | Set up loop counter |
| MOV BX, OFFSET DATA | BX points to the given data |
| SUB AL, AL | AL holds the highest number found till now |
AGAIN | CMP AL, [BX] | Compare the next number |
| JA NEXT | Jump if AL is still the highest |
| MOV AL, [BX] | Else hold the new number |
NEXT | INC BX | Points the next number |
| LOOP AGAIN | Continue to search |
| HLT | stops the execution of program |
|
|
|
LABEL | CODE | COMMENT |
| MOV AL, [3050] | loads contents of memory location 3050 in AL |
| MOV AH, [3051] | loads contents of memory location 3051 in AH |
| MOV CX, 0004 | assign 0004 to CX register pair |
| ROL AL, CX | rotate the content of AL register left by 4 bits i.e. value of CX register pair |
| ROL AH, CX | rotate the content of AH register left by 4 bits i.e. value of CX register pair |
| MOV [3050], AH | stores the content of AH in 3050 memory address |
| MOV [3051], AL | stores the content of AL in 3051 memory address |
| HLT | stops the execution of program |
- This interrupt occurs whenever there is division error. This condition normally occurs when the divisor is very small as compared to the dividend or the divisor is zero.
- Its ISR address is stored at location 0 x 4 = 00000H in the IVT.
- The microprocessor executes this interrupt after every instruction if the TF is set.
- Its ISR displays contents for all registers. Its ISR address is stored at location 1 x 4 = 00004H in the IVT.
- The microprocessor executes this ISR in response to an interrupt on the NMI (Non mask-able Interrupt) line.
- Its ISR address is stored at location 2 x 4 = 00008H in the IVT.
- This interrupt causes breakpoints in the program. It occurs by writing the instruction INT 03H or simply INT.
- It is useful in debugging large programs.
- Its ISR is used to display the contents of all registers on the screen. Its ISR address is stored at location 3 x 4 = 0000CH in the IVT.
- It occurs if the overflow flag is set and the microprocessor executes the INTO (Interrupt on Overflow) instruction.
- It detects overflow error in signed arithmetic operations.
- Its ISR address is stored at location 4 x 4 = 00010H in the IVT.