-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathOPERATIONS_CUSTOM.asm
59 lines (31 loc) · 1.39 KB
/
OPERATIONS_CUSTOM.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;FACTORIAL
DATA SEGMENT
DATA1 DB 23H
DATA2 DW 1234H
DATA3 DB 0H
DATA4 DW 0H
DATA5 DW 2345H,6789;ARRAY
DATA ENDS
;DIFFERENT DATA IN DATA SEGMENT
CODE SEGMENT
ASSUME CS : CODE , DS : DATA
MOV AX,DATA ; INITIALISE DS TO POINT TO START OF THE MEMORY
MOV DS,AX ; SET ASIDE FOR STORING OF DATA
MOV AL,25H ; L MEANS 8 BIT REG , STORING 25H TO AL REG
MOV AX,2345H ; X MEANS 16 BIT REG ,COPY 2345H INTO AX REG
MOV BX,AX ; COPY THE CONTENT OF AX INTO BX REGISTER
MOV CL,AL ; COPY THE CONTENT OF AL REGISTER TO CL
MOV AL,DATA1 ; COPIES THE BYTES CONTENT OF THE DATA SEGMENT MEMORY
MOV AX,DATA2 ; COPIES THE ALL CONTENTS OF DATA SEGMENT , LOCATION DATA2 INTO 16 BIT AX
MOV DATA3,AL ; AL--> DATA3
MOV DATA4,AX ; AX--> DATA4
MOV BX,OFFSET DATA5 ; THE 16BIT OFFSET ADDRESS OF THE DS MEMORY
MOV AX,[BX] ; INDIRECT ADDRESSING
MOV DI,02H ;
MOV AX,[BX+DI] ;,MEMORY LOCATION ADDRESS BY BX + DI INTO AX (BASE PLUS INDIRECT ADDRESSSING)
MOV AX,[BX+002H] ; COPIES THE WORD CONTENT OF DATA SEGMENT
MOV AL,[DI,2] ;REGISTER RELATIVE INDEXING
MOV AX,[BX + DI + 002H] ; MEMORY LOCATION ADDRESS BY BX+DI+002H INTO AX 16 BIT
CODE ENDS
ENDS START
ENDS