Fig2:FSAS at OFF State
Computer knowledge
Monday, March 30, 2015
Fire/Smoke Alarm System (FSAS)
Hello Guys Today I am going to demonstrate you, a Fire/Smoke Alarm System (FSAS) full report and code which is build in Atmega-16 Micro-controller and Designed in ISIS....
Fig1:FSAS at OFF State
Fig2:FSAS at OFF State
Fig2:FSAS at OFF State
Tuesday, November 11, 2014
Watch Youtube Videos Without Any Buffering Struck On Mobile And Slow Internet Connection--
Have a video to watch on youtube and it keeps buffering, stopping every few seconds . Feels like just close the tab because it is so frustrating , but I keep trying , because you just have to watch it. This problem often occurs when using a slow connection, but there is an easy solution that works for me.For Dial-Up connections user its time to watch their interested videos without any tried.-http://tcinfosys.blogspot.com/2014/11/watch-youtube-videos-without-any.html
Have a video to watch on youtube and it keeps buffering, stopping every few seconds . Feels like just close the tab because it is so frustrating , but I keep trying , because you just have to watch it. This problem often occurs when using a slow connection, but there is an easy solution that works for me.For Dial-Up connections user its time to watch their interested videos without any tried.-http://tcinfosys.blogspot.com/2014/11/watch-youtube-videos-without-any.html
MICROPROCESSOR::::8085 Assembly Language Programs & Explanations
8085 Assembly Language Programs & Explanations
1. Statement: Store the data byte 32H into memory location 4000H.
Program 1:
MVI A, 32H : Store 32H in the accumulator
STA 4000H : Copy accumulator contents at address 4000H
HLT : Terminate program execution
Program 2:
LXI H : Load HL with 4000H
MVI M : Store 32H in memory location pointed by HL register pair
(4000H)
HLT : Terminate program execution
2. Statement: Exchange the contents of memory locations 2000H and 4000H
Program 1:
LDA 2000H : Get the contents of memory location 2000H into
accumulator
MOV B, A : Save the contents into B register
LDA 4000H : Get the contents of memory location 4000Hinto
accumulator
STA 2000H : Store the contents of accumulator at address 2000H
MOV A, B : Get the saved contents back into A register
STA 4000H : Store the contents of accumulator at address 4000H
Program 2:
LXI H 2000H : Initialize HL register pair as a pointer to
memory location 2000H.
LXI D 4000H : Initialize DE register pair as a pointer to
memory location 4000H.
MOV B, M : Get the contents of memory location 2000H into B
register.
LDAX D : Get the contents of memory location 4000H into A
register.
MOV M, A : Store the contents of A register into memory
location 2000H.
MOV A, B : Copy the contents of B register into accumulator.
STAX D : Store the contents of A register into memory location
4000H.
HLT : Terminate program execution.
3.Sample problem
(4000H) = 14H
(4001H) = 89H
Result = 14H + 89H = 9DH
Source program
LXI H 4000H : HL points 4000H
MOV A, M : Get first operand
INX H : HL points 4001H
ADD M : Add second operand
INX H : HL points 4002H
MOV M, A : Store result at 4002H
HLT : Terminate program execution
4.Statement:a Subtract the contents of memory location 4001H from the memory
location 2000H and place the result in memory location 4002H.
Program - 4: Subtract two 8-bit numbers
Sample problem:
(4000H) = 51H
(4001H) = 19H
Result = 51H - 19H = 38H
Source program:
LXI H, 4000H : HL points 4000H
MOV A, M : Get first operand
INX H : HL points 4001H
SUB M : Subtract second operand
INX H : HL points 4002H
MOV M, A : Store result at 4002H.
HLT : Terminate program execution
5.Statement: Add the 16-bit number in memory locations 4000H and 4001H to
the 16-bit number in memory locations 4002H and 4003H. The most significant
eight bits of the two numbers to be added are in memory locations 4001H and
4003H. Store the result in memory locations 4004H and 4005H with the most
significant byte in memory location 4005H.
Program - 5.a: Add two 16-bit numbers - Source Program 1
Sample problem:
(4000H) = 15H
(4001H) = 1CH
(4002H) = B7H
(4003H) = 5AH
Result = 1C15 + 5AB7H = 76CCH
(4004H) = CCH
(4005H) = 76H
Source Program 1:
LHLD 4000H : Get first I6-bit number in HL
XCHG : Save first I6-bit number in DE
LHLD 4002H : Get second I6-bit number in HL
MOV A, E : Get lower byte of the first number
ADD L : Add lower byte of the second number
MOV L, A : Store result in L register
MOV A, D : Get higher byte of the first number
ADC H : Add higher byte of the second number with CARRY
MOV H, A : Store result in H register
SHLD 4004H : Store I6-bit result in memory locations 4004H and
4005H.
HLT : Terminate program execution
6.Statement: Add the contents of memory locations 40001H and 4001H and place
the result in the memory locations 4002Hand 4003H.
Sample problem:
(4000H) = 7FH
(400lH) = 89H
Result = 7FH + 89H = lO8H
(4002H) = 08H
(4003H) = 0lH
Source program:
LXI H, 4000H :HL Points 4000H
MOV A, M :Get first operand
INX H :HL Points 4001H
ADD M :Add second operand
INX H :HL Points 4002H
MOV M, A :Store the lower byte of result at 4002H
MVIA, 00 :Initialize higher byte result with 00H
ADC A :Add carry in the high byte result
INX H :HL Points 4003H
MOV M, A :Store the higher byte of result at 4003H
HLT :Terminate program execution
7.Statement: Subtract the 16-bit number in memory locations 4002H and 4003H
from the 16-bit number in memory locations 4000H and 4001H. The most
significant eight bits of the two numbers are in memory locations 4001H and 4003H.
Store the result in memory locations 4004H and 4005H with the most significant
byte in memory location 4005H.
Sample problem
(4000H) = 19H
(400IH) = 6AH
(4004H) = I5H (4003H) = 5CH
Result = 6A19H - 5C15H = OE04H
(4004H) = 04H
(4005H) = OEH
Source program:
LHLD 4000H : Get first 16-bit number in HL
XCHG : Save first 16-bit number in DE
LHLD 4002H : Get second 16-bit number in HL
MOV A, E : Get lower byte of the first number
SUB L : Subtract lower byte of the second number
MOV L, A : Store the result in L register
MOV A, D : Get higher byte of the first number
SBB H : Subtract higher byte of second number with borrow
MOV H, A : Store l6-bit result in memory locations 4004H and
4005H.
SHLD 4004H : Store l6-bit result in memory locations 4004H and
4005H.
HLT : Terminate program execution
8.Statement: Find the l's complement of the number stored at memory location
4400H and store the complemented number at memory location 4300H.
Sample problem:
(4400H) = 55H
Result = (4300B) = AAB
Source program:
LDA 4400B : Get the number
CMA : Complement number
STA 4300H : Store the result
HLT : Terminate program execution
9.Statement: Find the 2's complement of the number stored at memory location 4200H and store the complemented number at memory location 4300H.
Sample problem:
(4200H) = 55H
Result = (4300H) = AAH + 1 = ABH
Source program:
LDA 4200H : Get the number
CMA : Complement the number
ADI, 01 H : Add one in the number
STA 4300H : Store the result
HLT : Terminate program execution
10.Statement: Pack the two unpacked BCD numbers stored in memory locations
4200H and 4201H and store result in memory location 4300H. Assume the least
significant digit is stored at 4200H.
Sample problem:
(4200H) = 04
(4201H) = 09
Result = (4300H) = 94
Source program
LDA 4201H : Get the Most significant BCD digit
RLC
RLC
RLC
RLC : Adjust the position of the second digit (09 is changed to
90)
ANI FOH : Make least significant BCD digit zero
MOV C, A : store the partial result
LDA 4200H : Get the lower BCD digit
ADD C : Add lower BCD digit
STA 4300H : Store the result
HLT : Terminate program execution
11.Statement: Two digit BCD number is stored in memory location 4200H.
Unpack the BCD number and store the two digits in memory locations 4300H and
4301H such that memory location 4300H will have lower BCD digit.
Sample problem
(4200H) = 58
Result = (4300H) = 08 and
(4301H) = 05
Source program
LDA 4200H : Get the packed BCD number
ANI FOH : Mask lower nibble
RRC
RRC
RRC
RRC : Adjust higher BCD digit as a lower digit
STA 4301H : Store the partial result
LDA 4200H : .Get the original BCD number
ANI OFH : Mask higher nibble
STA 4201H : Store the result
HLT : Terminate program execution
12.Statement:Read the program given below and state the contents of all
registers after the execution of each instruction in sequence.
Main program:
4000H LXI SP, 27FFH
4003H LXI H, 2000H
4006H LXI B, 1020H
4009H CALL SUB
400CH HLT
Subroutine program:
4100H SUB: PUSH B
4101H PUSH H
4102H LXI B, 4080H
4105H LXI H, 4090H
4108H SHLD 2200H
4109H DAD B
410CH POP H
410DH POP B
410EH RET
13.Statement:Write a program to shift an eight bit data four bits right. Assume
that data is in register C.
Source program:
MOV A, C
RAR
RAR
RAR
RAR
MOV C, A
HLT
14.Statement: Program to shift a 16-bit data 1 bit left. Assume data is in the HL
register pair
Source program:
DAD H : Adds HL data with HL data
15.Statement: Write a set of instructions to alter the contents of flag register in
8085.
PUSH PSW : Save flags on stack
POP H : Retrieve flags in 'L'
MOV A, L : Flags in accumulator
CMA : Complement accumulator
MOV L, A : Accumulator in 'L'
PUSH H : Save on stack
POP PSW : Back to flag register
HLT :Terminate program execution
MICROPROCESSOR::::Important program of 8086 microprocessor
Important programs of 8086 (Exam
point of view)
1. Write an ALP to find factorial of number for 8086.
MOV AX, 05H
MOV CX, AX
Back: DEC CX
MUL CX
LOOP back
; results stored in AX
; to store the result at D000H
MOV [D000], AX
HLT
2. The 8 data bytes are stored from memory location E000H
to E007H. Write 8086 ALP to
transfer the block of data to new location B001H to
B008H.
MOV BL, 08H
MOV CX, E000H
MOV EX, B001H
Loop: MOV DL, [CX]
MOV [EX], DL
DEC BL
JNZ loop
HLT
3. Write a program to display string Electrical and Electronics Engineering for 8086.
Title display the string
Dosseg
.model small
.stack 100h
.data
String1 db Electrical and
Electronics Engineering, $
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV AH, 09H
MOV DX, offset String1
INT 21H
MOV AH, 4CH
INT 21H
Main endp
End Main
4. Write a program to reverse the given string for 8086.
Title reverse the given string
Dosseg
.model small
.stack 100h
.data
String1 db assembly language
program, $
Length dw $-String1-1
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV SI, offset String1
MOV CX, Length
ADD SI, CX
Back: MOV DL, [SI]
MOV AH, 02H
INT 21H
DEC SI
LOOP Back
MOV AH, 4CH
INT 21H
Main endp
End Main
5. Write a program to multiply 2 numbers (16-bit data)
for 8086.
Title multiply two numbers
Dosseg
.model small
.stack 100h
.data
Multiplier dw 1234H
Multiplicant dw 3456H
Product dw ?
.code
MULT proc
MOV AX, @data
MOV DS, AX
MOV AX, Multiplicant
MUL Multiplier
MOV Product, AX
MOV Product+2, DX
MOV AH, 4CH
INT 21H
MULT endp
End MULT
6. Sum of series of 10 numbers and store result in memory
location total.
Title Sum of series
Dosseg
.model small
.stack 100h
.data
List db 12,34,56,78,98,01,13,78,18,36
Total dw ?
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV AX, 0000H
MOV CX, 0AH ; counter
MOV BL, 00H ; to count carry
MOV SI, offset List
Back: ADD AL, [SI]
JC Label
Back1: INC SI
LOOP Back
MOV Total, AX
MOV Total+2, BL
MOV AH, 4CH
INT 21H
Label: INC BL
JMP Back1
Main endp
End Main
7. Write a program to find Largest No. in a block of
data. Length of block is 0A. Store the
maximum in location result.
Title maximum in given series
Dosseg
.model small
.stack 100h
.data
List db 80, 81, 78, 65, 23, 45, 89, 90, 10, 99
Result db ?
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV SI, offset List
MOV AL, 00H
MOV CX, 0AH
Back: CMP AL, [SI]
JNC Ahead
MOV AL, [SI]
Ahead: INC SI
LOOP Back
MOV Result, AL
MOV AH, 4CH
INT 21H
Main endp
End Main
8. Find number of times letter e exist in the string exercise, Store the count at memory
ans.
Title string operation
Dosseg
.model small
.stack 100h
.data
String db exercise, $
Ans db ?
Length db $-String
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV AL,00H
MOV SI, offset String
MOV CX, Length
Back: MOV BH, [SI]
CMP BH, e
JNZ Label
INC AL
Label: INC SI
LOOP Back
MOV Ans, AL
MOV AH, 4CH
INT 21H
Main endp
End Main
9. Write an ALP to generate square wave with period of
200µs and address of output
device is 55H for 8086 microprocessor.
START: MOV AX, 01H
OUT 30H, AX
; to generate loop for 200 µs using system frequency 5MHz
MOV BX, Count ;7T
Label: DEC BX ;4T
JNZ Label ;10T/7T
MOV AX, 00H
OUT 30H, AX
MOV BX, Count
Label1: DEC BX
JNZ Label1
JMP START
Note: Find the value of Count using technique used in
8085 so that delay will be of 200 µs.
10. Write an assembly language program to count number of
vowels in a given string.
Title to count number of vowels in given line of a text
Dosseg
.model small
.stack 100h
.code
Main proc
MOV AX, @data
MOV DS, AX
MOV SI, offset String ;initialize p
MOV CX, Len ;length in CX register
MOV BL, 00 ;vowel count=0
Back: MOV AL, [SI]
CMP AL, a
JB VOW
CMP AL, z ;Convert the
character to upper case
JA VOW
SUB AL, 20H
VOW: CMP AL, A
JNZ a3
INC BL
JMP a2
a3: CMP AL, E
JNZ a4
INC BL
JMP a2
a4: CMP AL, I
JNZ a5
INC BL
JMP a2
a5: CMP AL, O
JNZ a6
INC BL
JMP a2
a6: CMP AL, U
JNZ a2
INC BL
a2: INC SI
LOOP Back
MOV Vowel, BL
MOV AX, 4C00H
INT 21H
Main endp
.data
String db The quick brown
fox jumped over lazy sleeping dog, $
Len dw $-string
Vowel db ?
End Main
11. Write an 8086 ALP which will input the user name from
the keyboard. If the user is
Pokhara it will output The username is valid else it will output Invalid
user name.
Note: This program is not verified in MASM so, please
verify this program. This program can be
done in the same approach as question 10, which is
done above by comparing each character
input.
title input name and comparision
dosseg
.model small
.stack 100h
.data
input db 7 dup(?)
comparestring db 'Pokhara','$'
outputstring1 db 'The username is valid','$'
outputstring2 db 'The username is invalid','$'
.code
main proc
mov ax, @data
mov ds, ax
; read string
mov dx, offset input
mov ah,0ah
int 21h
;string comparision
mov si, offset input
mov di, offset comparestring
mov cx,07h ;length of string in cx
CLD ; DF-> direction flag clear i.e. autoincrement mode
repe cmpsw ;compare words of two string if equal then ZF
will be set
JZ label1
mov dx, offset outputstring2
jmp label2
label1: mov dx, offset outputstring1
label2: mov ah, 0ah
int 21h
mov ah,4ch
int 21h
main endp
end main
Subscribe to:
Posts (Atom)