Micro processor Lab Manual / Generate Up and down going staircase waveform ALP

Program Name

Write a Assembly Language Program for Generate Up and down going staircase waveform .
Theory
Instruction Mnemonic Operand Comments
MVI A,80H Load accumulator with 80H to configure CWR.
CWR Configure CWR to display output with accumulator value.
MVI A,00H Initialize accumulator with 00 to display up-going staircase from bottom of CRO screen.
OUT PA Send the value of 00H through output port A.
OUT PB Send the value 00H through output port B.
CALL DELAY Call delay function to continue the wave
ADI 33H Add 33H to the current accumulator value to print next staircase.
CPI FF Compare the incremented value of accumulator with FF to check whether it has reached maximum value or not.
JNZ XX If accumulator value has not reached maximum jump back to send value to output port.
MVI A,FF Initialize accumulator with FF to display down-going staircase from top of the CRO screen
OUT PA Send the value FF through output port A
OUT PB Send the value FF through output port B
CALL DELAY Call Delay function to continue the wave
SUI 33H Subtract 33H to current accumulator value to print next staircase
CPI 00H Compare the incremented value of accumulator with 00H to check whether it has reached minimum value or not
JNZ YY If the accumulator value has not reached minimum jump back to send value to output port
JMP XX Jump back to display the output.
Program Code


Online compiler for 8085 Microprocess Compiler


Home     Back