answersLogoWhite

0

;Program to check whether the value in register is even or odd

.ORIG X3000

AND R2,R1,X0001

BRZ EVEN

LEA R0,DEF ;PRINTS ODD IF VALUE IN REGISTER R2 IS 1

PUTS

HALT

EVEN:

LEA R0,ABC ;PRINTS EVEN IF VALUE IN R2 IS 0

PUTS

HALT

ABC .STRINGZ "EVEN"

DEF .STRINGZ "ODD"

.END

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

An assembly language program that will take three decimal input and display minimum of them?

program that take three decimal number as input and find the largest among them in assembly language


How do you store a 128 bit number in memory in assembly language?

yes


How does the assembly language can be executed by CPU?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.We use several instructions like..Arithmetic:INR - Increment AccumulatorADD B - Add Content of Reg. B with AccumulatorSUB, etc.Logical:AND - Bitwise ANDJump Instriction:JZ label - Jump to label if ZERO flaggedJC Label - Jump on CarryEtc..Example:MVI B, 06 //Load Register B with the Hex value 06MOV A, B //Move the value in B to the Accumulator or register AMVI C, 07 //Load the Register C with the second number 07ADD C //Add the content of the Accumulator to the Register CSTA 8200 //Store the output at a memory location e.g. 8200HLT //Stop the program execution


How do you write an assembly language program to count the number of ones in a given byte?

1. Find algorithm.2. Implement it.Hint: if a non-zero N number has K 1-bits, then (N AND N-1) has K-1 1-bits.


What is the Structure of Program in Assembly language?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.We use several instructions like..Arithmetic:INR - Increment AccumulatorADD B - Add Content of Reg. B with AccumulatorSUB, etc.Logical:AND - Bitwise ANDJump Instriction:JZ label - Jump to label if ZERO flaggedJC Label - Jump on CarryEtc..

Related Questions

Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


An assembly language program that will take three decimal input and display minimum of them?

program that take three decimal number as input and find the largest among them in assembly language


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


Write a program using 8086 instructions to double a number?

There isn't a reason to write a complete program to do this; in any assembly language just shift the value 1 bit to the left to double it.


Write an assembly language program to multiply an 8-bit signed number by a 8-bit signed number?

MVI A, 30h MVI B 20h MUL A,B OUT port1 HLT


Write a program in 8086 assembly language that accepts two input characters pack two characters in one word and store them in consecutive locating in a memory buffer The first address of buffer is 400?

develop and test an assembly language to convert a two digit BCD number to binary


How do you store a 128 bit number in memory in assembly language?

yes


What do you mean by computer Assembly?

This can mean one of two different things depending on context. The obvious one is the physical assembly of a computer, but since you're asking here, I assume you're asking about assembly language. The CPU inside your computer can only understand a limited set of relatively simple instructions. These instructions are represented by numbers, and the CPU knows which number means which instruction. Assembly language is a human readable representation of the instructions that the CPU can understand. Instead of a large number, a short word or acronym called a mnemonic is used. When an assembly program is written, a program called an assembler can translate each mnemonic into the number that represents it. Each mnemonic corresponds to one instruction that the CPU will follow.


Write a program By using if else statement to read a number and check whether it is positive or negative?

write a c++program by using if statement to read a number and check whether it is positive or negative


How does the assembly language can be executed by CPU?

Assembly language programs are the Low level programs. We write Assembly Language program in basically 8085 and 8086 microprocessors.We can have several registers to do opreations with. Accumulator is one most important Register in a assembly program.We use several instructions like..Arithmetic:INR - Increment AccumulatorADD B - Add Content of Reg. B with AccumulatorSUB, etc.Logical:AND - Bitwise ANDJump Instriction:JZ label - Jump to label if ZERO flaggedJC Label - Jump on CarryEtc..Example:MVI B, 06 //Load Register B with the Hex value 06MOV A, B //Move the value in B to the Accumulator or register AMVI C, 07 //Load the Register C with the second number 07ADD C //Add the content of the Accumulator to the Register CSTA 8200 //Store the output at a memory location e.g. 8200HLT //Stop the program execution


How do you write an assembly language program to count the number of ones in a given byte?

1. Find algorithm.2. Implement it.Hint: if a non-zero N number has K 1-bits, then (N AND N-1) has K-1 1-bits.


Write an assembly language program to find 2's complement of a number FFH?

Code for An Assembly Language Program to find 2's Complement of given binary number in Assembly LanguageData Segment num db 00000010B Data Ends Code Segment Assume cs:code, ds:data Begin: mov ax, data mov ds, ax mov es, ax mov ah, 0000h mov al, num NOT al mov bl, al adc al, 00000001B mov bl, al Exit: mov ax, 4c00h int 21h Code Ends End Begin