Vous êtes sur la page 1sur 2

Microprocessor _MIC-Assembly Language Program Sheet:

Class:CO4I ;Author : Roll no. 90 Name: Sarthak Hemant Kadam


;Instruction : Write Every program in notebook with description of
Division: B each instruction starting with ";" add lines if required?
;Program: Write ALP using procedure to solve equation such as
Z=(A+B)*(C+D)
Memory OPCODE from
Address debug screen
CODE SEGMENT ;start of code segment
Contents of DATA Segment BEFORE Execution; Set up segment assumptions for
CS:0000 ASSUME CS:CODE,DS:DATA
DS:0000 DS:0001 DS:0002 DS:0003 DS:0004 code and data
DS:0005 segments
DS:0006 DS:0007
DS:0000
CD 20 FF 9F 00 ; EA
Load the address
FF of FF
the DATA
CS:0000 B8B048 MOV AX,DATA
DS:0008
DS:0008 DS:0009DS:000A DS:000B DS:000C segment
into
DS:000D the AX register
DS:000E DS:000F
AD DE E0 01 C5 ; 15 AA
Move the contents 01 into the
of AX
CS:0003 8ED8DS:0010 MOV DS,AX
DS:0011 DS:0012 DS:0013 DS:0014 DS:0015
DS:0010 DS registerDS:0016 DS:0017
C5 15 89 02 20 10 92 01
CS:0005 E80000 CALL EQU_RES ; Call the procedure EQU_RES
DS:0018 DS:0019 DS:001A DS:001B DS:001C DS:001D DS:001E DS:001F
DS:0018E81000
CS:0007 StatusPROC
EQU_RES of following
NEAR after execution; Define the procedure EQU_RES
01 03 01 00 02 FF FF FF
Register
DS:0020 ; Move FLAGS
the value of AStatus
into the AL
CS:0008
DS:0020A00000 MOV AL,A
FFAH AL register OF 0
AX 02060100
CS:000B ADD AL,B ; Add the value of B to AL
00 2D DF 0
; Move the value of C into the BL
CS:000F 8A1E0200BH MOV BL,C BL IF 1
BX May add more lines if required register
CS:0013 021E0300 ES BL,D of DATA Segment AFTER Execution; Add theTF
ADD Contents 09 value of D to BL0
CH CLwhen BLUE line is on MOV AH,4CH
Enter this SF 0
CX F6F3 DS:0000 ; Multiply AL by BL, result stored in
CS:0017 01 MUL BL DS:0002
DS:0001 92 DS:0003 DS:0004 DS:0005 ZF DS:0006 0
DS:0007
DS:0000 AX
02DH 03 04
DL 05 04 2D 00 00
DX A30400 ; Move the X result of the
CS:0019 DS:0008
E6 MOV Z,AX
DS:0009 DS:000A
SC DS:000B DS:000C DS:000D DS:000E DS:000F
AC-F into the variable
0
DS:0008 multiplication Z
CS 0048 00 00 00 00 00 00 X 00
AD ; Pop the value from the stack into
CS:001C
DS 5B
DS:0010 POP BX DS:0012 DS:0013
DS:0011 DS:0014 DS:0015
PF
DS:0016 DS:0017
1
DS:0010 48 9D BX
00 00 00 00 00 00 00 00
ES 48 9D ; Pop the value Xfrom the stack into
CS:001D 5B DS:0018 POP BX DS:001A DS:001B DS:001C
DS:0019 DS:001D DS:001E DS:001F
SS
DS:0018 48 AC BX CF 00 0
00 00 00 00 00 00 00
CS:001E
BP BE01000 00
DS:0020 RET
DS:0021 00
DS:0022 DS:0023 DS:0024 ; Return
DS:0025 from the
DS:0026 procedure
DS:0027
DS:0020
SP 00 00
CS:001F E82000 00 EQU_RES ENDP
00 00 00 00 ; End of the procedure EQU_RES
00 00 00
SI E5
DS:0028 DC
DS:0028
DI 00 9B BD
CS:0020 MOV AX,4C00H ; terminate program execution
IP 00 May
20 add more lines if required
;relevant software input
CS:0021 INT 21H

CODE ENDS ;End of the code segment


DATA SEGMENT ;start of the data segment
; Define a byte variable A with
DS:0000 A DB 02H
initial value 2
; Define a byte variable B with
DS:0001 B DB 03H
initial value 3
; Define a byte variable C with
DS:0002 C DB 04H
initial value 4
; Define a byte variable D with
DS:0003 D DB 05H
initial value 5
; Define a word variable Z with
DS:0004 Z DW ?
initial value uninitialized
DATA ENDS ;End of the data segment
END ;End of program
Microprocessor _MIC-Assembly Language Program Sheet:

Vous aimerez peut-être aussi