This document contains several assembly language programming questions and examples. Some questions ask to write programs that perform operations like copying data, searching memory, or manipulating values in registers and memory. Examples are provided that show code to calculate 2^5, divide a number by 16, and scroll the text display upward by moving each text line up one row.
Just Call Vip call girls Kasganj Escorts ☎️8617370543 Two shot with one girl ...
Home works summary.pptx
1.
2. IN OUT
D Q
C
CLK GATE
D Q
C
D Q
C
D Q
C
IN1 OUT1
D Q
C
CLK1 GATE1
D Q
C
D Q
C
D Q
C
How to transfer data from IN to OUT
then from OUT to OUT1 ?
3. CHARACTER 0
ATTRIBUTE 0
CHARACTER 1
ATTRIBUTE 1
CHARACTER 2
ATTRIBUTE2
VRAM
B800:0000
B800:0001
B800:0002
B800:0003
B800:0004
B800:0005
4. Write A program to Locate (Find the EA of)
the character ‘A’ in 1KB of Memory- Block
Starting at Address B800:0000 & Save it in DX.
Write another program to Locate (Find the EA of)
the Word ‘AbcD’ in 1KB of Memory- Block
Starting at Address DS:0100 & Save it in DX.
Write Another Program To Display A Character On
Each Line Of The Screen The 1st At The 1st
Column, The Second At The Second Column And
So On. Each Character Should Have Different
Attribute.
5. Write A program to display the contents of 1KB of
Memory Starting at Address ES:BX on PC-
screen.
Write another program to convert each lower-case
letter into an upper-case letter in the extra
segment using XLAT.
Write Another Program To cipher the message
stored at DS:DI (ended with $) and send it
character by character to the port 378h.
6. Find The Contents Of AL at Each Step of the Following:
MOV AL,55h
AND AL,1Fh
OR AL,C0h
XOR AL,0Fh
NOT AL
Describe the Function of the Following Sequence of
Instructions:
MOV AL, hex-digits
MOV BL,AL
MOV CL,4
ROR AL,CL
AND AL,0Fh
AND BL,0Fh
OR AL,BL
7. What are the results produced in the destination operands
by executing instructions (a) through (g) if the contents of
memory & registers prior to operation are as follows:
AX=5555h BX=0010h CX=0010h DX=AAAAh SI=0100h
DI=0200 DS:100h=0Fh DS:101h=F0h DS:110h=00h
DS:111h=FFh DS:200h=30h DS:201h=00h
DS:210h=AAh DS:211h=AAh DS:220h=55h
DS:221h=55h DS:300h=AAh DS:301h=55h
a) AND BYTE PTR [0300h],0Fh
b) AND DX,[SI]
c) OR [BX+DI],AX
d) OR BYTE PTR [BX][DI]+10h,0F0h
e) XOR AX,[SI+BX]
f) NOT BYTE PTR [0300h]
g) NOT WORD PTR [BX+DI]
Also specify addressing modes for each instruction and carry
flag.
8. What are the results produced in the destination operands
by executing instructions (a) through (f) if the contents of
memory & registers prior to operation are as follows:
AX=0000h BX=0010h CX=0105h DX=1111h SI=0100h
DI=0200h
DS:100h=0Fh DS:200h=22h DS:201h=44h CF=0
DS:210h=55h DS:211h=AAh DS:220h=AAh
DS:221h=55h DS:400h=AAh DS:401h=55h
a) ShL DX,CL
b) ShL BYTE PTR [0400h],CL
c) ShR BYTE PTR[DI],1
d) ShR BYTE PTR [DI+BX],CL
e) SAR WORD PTR [BX+DI],1
f) SAR WORD PTR [BX][DI]+10h,CL
Also specify addressing modes for each instruction and carry flag.
9. What are the results produced in the destination operands
by executing instructions (a) through (f) if the contents of
memory & registers prior to operation are as follows:
AX=0000h BX=0010h CX=0105h DX=1111h SI=0100h
DI=0200h
DS:100h=0Fh DS:200h=22h DS:201h=44h CF=1
DS:210h=55h DS:211h=AAh DS:220h=AAh
DS:221h=55h DS:400h=AAh DS:401h=55h
a) ROL DX,CL
b) RCL BYTE PTR [0400h],CL
c) ROR BYTE PTR [DI],1
d) ROR BYTE PTR [DI+BX],CL
e) RCR WORD PTR [BX+DI],1
f) RCR WORD PTR [BX][DI]+10h,CL
Also specify addressing modes for each instruction and carry
flag.
10. Draw The Hardware Block Diagram That represents
The Instruction SAR AL,1 With Timing Diagram.
Draw The Hardware Block Diagram That Represents
The Instruction SCR BH,1 WithTiming Diagram.
Write A Program To Calculate 2^5 And Store The
Result In BL.
Write A Program To Divide The Number Stored
In CX By 16 And Store TheResult In DX.
11. Write A Program To Calculate 2^5 And Store The
Result In BL.
MOV BL,1
MOV CL,5
SHL BL,CL ;BL= 20h =32d
Write A Program To Divide The Number Stored
In CX By 16 And Store TheResult In DX.
MOV CX,80h
MOV DX,CX ;DX= 80h =128d
MOV CL,4
SHR DX,CL ;DX= 8h =8d
12. D Q
D Q
D Q
D Q
D Q
CLK GATE
D Q
D Q
D Q
LSB
MSB
D Q
CY
Draw The Hardware
Block Diagram That
Represents The
Instruction SAR AL,1
With Timing Diagram.
AL
13.
14. D Q
D Q
D Q
D Q
D Q
CLK GATE
D Q
D Q
D Q
LSB
MSB
D Q
CY
Draw The Hardware
Block Diagram That
Represents The
Instruction SCR BH,1
With Timing Diagram.
BH
15.
16. code segment
assume cs:code
start: mov ax,code
mov ds,ax
mov ax,0b800h
mov ds,ax ;ds=VRAM Starting address
mov bx,0 ;bx used for column increment
mov di,0 ;di used for line increment
mov [bx],al ;character ASCII
mov [bx+1],al ;character attribute
nxt: inc al ;new character & attribute
inc bx
inc bx ;point to next line
add di,0a0h ;point to next column
mov [bx][di],al ;new character ASCII
mov [bx+di+1],al ;new character attribute
cmp bx,54h ;?= last line
jnz nxt ;if it is not continue
hlt
code ends
end start
17. ;This program is used to scroll up the display one line
code segment
assume cs:code
start: mov ax,code
mov ds,ax
mov ax,0b800h
mov ds,ax ;ds=VRAM Starting address
mov di,0 ;di is the pointer to upper line
mov si,0a0h ;si is the pointer to lower line
mov ah,43d ;ah: line counter
nxt: mov bx,0 ;bx used for byte pointer within line
mov cx,0a0h ;cx: byte counter per line
cont: mov al,[si+bx]
mov [di+bx],al ;move one byte one line up
inc bx
loop cont ;move next byte
add di,0a0h ;move one byte one line up
add si,0a0h ;point to next source line
dec ah ;is it the last line?
jnz nxt ;if it is not continue
hlt
code ends
end start
18. 1. Write a program to compare the unsigned number in AL
with numbers stored in 1KB of the memory started at
unsnin and store the numbers equal to AL at equal, above
at above and below at below.
2. Write a program to compare the signed number in AL with
numbers stored in 1KB of the memory started at sind and
store the numbers equal to AL at equals, above at abovs
and below at belows.
3. Write a program to classify the signed numbers stored in
4KB of the memory started at degree to positive numbers
and negative numbers and arrange them so as the positive
be one by one starting at the first memory location
(degree) .
19. MOV AX, code
MOV DS,AX
MOV ES,AX
MOV DI,OFFSET dest
LEA SI,srs
MOV CX,ssize
CLD
REP
MOVSB
HLT
Dest db 1000 dup (?)
SrS db 1000 dup (?)
Ssize dw 50
MOV AX, code
MOV DS,AX
MOV AX,EXTRA
MOV ES,AX
LEA DI,ES:[dest]
MOV SI,OFFSET DS:[srs]
MOV CX,DS:[ssize]
CLD
REP
MOVSW
HLT
Srs db 1000 dup (?)
Ssize dw 50
EXTRA SEGMENT
Dest db 1000 dup (?)
EXTRA ENDS
20. 1. Write a program to find number of bytes prior to the byte
equals to the contents of AL in 2KB of the memory started
at string1 and store that number in result.
2. Write a program that accomplishes:
for i=0 to 100
if XX(i) = YY(i) then
MC=MC+1
else
UM=UM+1
next i
3. Write a program to clear DOS screen
4. Write a program to divide the screen to 4 equal size zones
each zone have different color and rotate these colors
clockwise between sectors.
21. 5. Write a program to store the current screen then retrieve
it.
6. Write a program to copy the 5kB data file named test1 to
the file named test2 (both of them are stored in the same
segment).
7. Write a program to search a 3kB of memory for the word
‘MICROPROCESSOR’ and store no. of iteration in itr-no.
8. Write a program to scroll the screen 7 lines upward then
retrieve them line by line downward.
22. 1) Write a program to implement the following continuously:
A. Input from keyboard & display the ASCII code of the
pressed key on line No. 20 of the DOS screen in binary
form bit by bit, also display CF to the left followed by two
null characters.
B. If left-arrow key is pressed then SHL the displayed pattern
& if right-arrow then SHR the pattern.
C. ROR with upper-arrow, ROL with lower-arrow.
D. AND with the number entered after (*) key.
E. OR with number entered after (+) key.
F. Use Enter to terminate.
23. 2. Write an assembly program to invert the attribute of the character
that matches the one entered from keyboard for the whole 80
lines of DOS screen.
3. Write an assembly program that performs:
A. Addition of two numbers if (+) is entered between them from
keyboard and display number1 + number2 = the result on line
10 of the DOS screen.
B. Subtraction of two numbers if (-) is entered between them from
keyboard and display number1 - number2 = the result on line 15
of the DOS screen.
C. Multiplication of two numbers if (*) is entered between them from
keyboard and display number1 * number2 = the result on line 13
of the DOS screen.
D. division of two numbers if (/) is entered between them from
keyboard and display number1 / number2 = the result on line 16
and the remainder on line 17 on the same column of the result on
DOS screen.