Ques. : Write an Assembly Language Program(WALP) to move/store a value of 100 to register AX.
.model tiny
.stack 50
.code ;program running started from here.
move AX,100
move AH,4CH ;or move AH,76
int 21H ;or int 33
end
NB:
(i) This program is for starting to learn from base hence no output code is given and hence no output will be diplayed.
(ii) Here, semicolon(:) symbol is used to write commnets in the program.
Ques. : Write an Assembly Language Program to move/store a value of 76 to register DX, and ADD them with 25.
.model tiny
.stack 50
.code
move DX,75
add DX,25
move AH,4CH ;Exit to OS or to coming back on the prompt.
int 21H ;The end of execution and back on prompt finally.
end ;Making the end of the program.
Ques. : Write an Assembly Language Program to move/store two values 25 & 35 in register DX and SI respectively, and ADD them & store the result in SI register finally.
.model tiny
.stack 50
.code
move DX,25
move SI,35
add SI,DX
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store two values 21h & 33 in two different one-byte registers/Half Registers. Add them and place the result in a third separate one-byte register.
.model tiny
.stack 50
.code
move al,21h
move bl,33
add al,bl
move cl,al
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store hexa decimal values 4ch in one-byte registers/Half Registers BL. Move the value from BL register to a Full register AX.
.model tiny
.stack 50
.code
move bl,4ch
add al,bl
move ah,00
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store a value 75 in lower-byte register/Half Register. Make them a full Byte register with the same value.
.model tiny
.stack 50
.code
move al,75
move ah,00
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store a value 55 in a higher-byte register/Half Register. Make them a full Byte register with the same value.
.model tiny
.stack 50
.code
move ah,55
move al,ah
move ah,00
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store 1-byte data ‘a’ on memory allocation 01101h of data segment area.
.model tiny
.stack 50
.code
move SI,01101h
move [SI],'a'
move AH,4CH
int 21H
end
------------- OR --------------
.model tiny
.stack 50
.code
move SI,01101h
move dl,'a'
move [SI],dl
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to move/store 1-byte data ‘a’ and ‘b’ on two consecutive memory locations 01101h of the data segment area of main memory.
.model tiny
.stack 50
.code
move SI,01101h
move al,'a'
move [SI],al
move al,'b'
move [SI+1],al
move AH,4CH
int 21H
end
------------- OR --------------
.model tiny
.stack 50
.code
move SI,01101h
move ah,'a'
move al,'b'
move [SI],ax
move AH,4CH
int 21H
end
------------- OR --------------
.model tiny
.stack 50
.code
move SI,01101h
move al,'a'
move [SI],al
inc SI
move al,'b'
move [SI],al
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to read 1-byte data from memory locations 01101h of the data segment area of the main memory into the DL register.
.model tiny
.stack 50
.code
move SI,01101h
move dl,[SI]
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to read 1-byte data from memory locations 01101h of the data segment area of the main memory into the full register/two-byte register.
.model tiny
.stack 50
.code
move SI,01101h
move AX,[SI]
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to read/accept 1-byte data from the user through a keyboard at run time [User Input].
.model tiny
.stack 50
.code
move ah,01 ;User Input command to store 1-byte value in AL.
int 21h ;Calling the interrupt for input device
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to display 1-byte static data * onto the Monitor screen [User Output].
.model tiny
.stack 50
.code
move ah,02 ;Initializing 'ah' for displaying the 1-byte value available
in DL register.
move dl,'*'
int 21h
move AH,4CH
int 21H
end
Ques. : Write an Assembly Language Program to accept and display 1-byte dynamic data onto the screen [User Input-Output].
.model tiny
.stack 50
.code
move ah,01
21h
move dl,al
move ah,02
int 21h
move ah,4ch
int 21h
end
NB:
(i)
move ah,02
int 21h
[Print the contents on Console]
(ii)
move ah,09
int 21h
[Print the contents on DOS prompt]
Ques. : Write an Assembly Language Program to accept a Character through the keyboard and place them on memory location 0101h.
.model tiny
.stack 50
.code
move ah,01
21h
move SI,0101h
move [SI],al
move ah,4ch
int 21h
end
Ques. : Write an Assembly Language Program to display a Character from a memory location 0101h.
.model tiny
.stack 50
.code
move SI,0101h
move dl,[SI]
move ah,02 ;Print on Console
move 21h
move ah,4ch
int 21h
end
Ques. : Write an Assembly Language Program to display three consecutive characters from a memory location 0101h.
.model tiny
.stack 50
.code
move SI,0101h
display1:
move dl,[SI]
move ah,02
move 21h
inc SI
display2:
move dl,[SI]
move ah,02
move 21h
inc SI
display3:
move dl,[SI]
move ah,02
move 21h
finish:
move ah,4ch
int 21h
End
----------- OR ------------
.model tiny
.stack 50
.code
move SI,0101h
move cx,3
move ah,02
display next:
move dl,[SI]
int 21h
inc SI
dec cx
cmp cl,0
JNE display next
move ah,4ch
int 21h
End
Ques. : Write an Assembly Language Program to move 76 in AL and 4ch in AH register. Compare them and if they are found equal, display ‘=’ sign otherwise display ‘X’ sign.
.model tiny
.stack 50
.code
move al,76
move ah,4ch
cmp al,ah
JE Equal Value
JNE Not Equal
Not Equal:
move dl,'X'
move ah,02
int 21h
JMP Lasting
Equal Value:
move dl,'='
move ah,02
int 21h
JMP Lasting
Lasting:
move ah,4ch
int 21h
End
Ques. : Write an Assembly Language Program to display two String of length or size 10, available on the memory location 0110h and 1000h. Compare both the String and if they are equal print the ‘=’ sign otherwise ‘X’ sign.
.model tiny
.stack 50
.code
;Value Management
move SI,1000h
mov bx,0
mov cx,10
mov ah,02
Display1:
mov dl,[SI+bx]
int 21h
inc bx
dec cx
cmp cx,0
Jne Display1;
move SI,0110h
mov bx,0
mov cx,10
mov ah,02
Display2:
mov dl,[SI+bx]
int 21h
inc bx
dec cx
cmp cx,0
Jne Display2
;Value Print after Comparision
move SI,1000h
move DI,0110h
mov bx,0
mov cx,10
Compare_Char:
mov DL,[SI+bx]
cmp DL,[DI+bx]
Jne Not_Equal
inc bx
dec cx
cmp cx,0
Jne Compare_Char
Je Equal_String
Equal_String:
mov dl,'='
mov ah,02
int 21h
Jmp Lasting
Not_Equal:
mov dl,'X'
mov ah,02
int 21h
Jmp Lasting
Lasting:
mov ah,76
int 33
End
Ques. : Write an Assembly Language Program to display two String of length or size 10, available on the memory location 0110h and 1000h. Compare both the String and if they are equal print the ‘=’ sign otherwise ‘X’ sign using Loop.
.model tiny
.stack 50
.code
move SI,1000h
mov bx,0
mov cx,10
mov ah,02
Display1:
mov dl,[SI+bx]
int 21h
inc bx
Loop Display1
mov SI,0110h
mov bx,0
mov cx,10
mov ah,02
Display2:
mov dl,[SI+bx]
int 21h
inc bx
Loop Display2
mov SI, 1000h
mov DI,0110h
mov bx,0
mov cx,10
Compare:
mov dl,[SI+bx]
cmp [DI+bx],dl
inc bx
Je Equal
Jne Not Equal
Loop Compare
Equal:
mov dl,'='
mov ah,02
int 21h
Jmp Lasting
Not Equal:
mov dl,'X'
mov ah,02
int 21h
Jmp Lasting
Lasting:
mov ah,76
int 33
End
0 Comments