Question

Write an assembly language program that will implement the following:       If ( (AX >=BX) AND (CX...

Write an assembly language program that will implement the following:      

If ( (AX >=BX) AND (CX < DX) ) goto LoopA Else go to LoopB

(Here I want you to write the whole assembly program that could run in CMD. THANK YOU

Homework Answers

Answer #1

Given:

If ( (AX >=BX) AND (CX < DX) ) goto LoopA Else go to LoopB

Assembly Language Instruction's":

CMP :compare

JGE :Jump if Greater or Eq (o1 >= o2)

JL : Jump if Less (o1 < o2)

Loop: loop instruction

Assembly Language code:

   CMP AX, BX ; if AX >= BX, then jump to level 1 as L1

   JGE L1

L1:

CMP CX, DX ; if CX < DX , then jump to level 2 as L2

JL L2

   JMP end_if

   L2:

   Loop L3 ; loop A at level L3 as L3

   end_f:

Loop L4 ; else loop B at level 4 as L4

L3:

   <loop body LoopA> ; loop A

Loop L3

   L4:

<loop body LoopB> ;loop B

Loop L4

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write an assembly language program that will implement the following: If ( (AX >=BX) || (CX...
Write an assembly language program that will implement the following: If ( (AX >=BX) || (CX < DX) ) goto LoopA Else go to LoopB..
Write a program in Assembly language that calculates the maximum and minimum of 10 numbers stored...
Write a program in Assembly language that calculates the maximum and minimum of 10 numbers stored in memory and writes them to the memory locations. #using loop num: dw 56, 45, 36, 67, 76, 22, 89, 12, 29, 83 min: dw 0 max: dw 0 I wrote a codem but I got an error when I executed it [ORG 0x0100] jmp start num: dw 56, 45, 36, 67, 76, 22, 89, 12, 29, 83 min: dw 0 max: dw 0...
9) Choose the correct Assembly Language code that will do the following: If dog is equal...
9) Choose the correct Assembly Language code that will do the following: If dog is equal to cat THEN go to LOOP_A ELSE go to LOOP_B if(dog == cat) goto LOOP_A else goto LOOP_B Question 9 options: cmp cat,dog jnz LOOP_A jmp LOOP_B mov AX,cat cmp AX,dog jz LOOP_A jmp LOOP_B mov AX,dog cmp AX,cat js LOOP_A jmp LOOP_B mov AX,cat cmp AX,dog js LOOP_A jmp LOOP_B
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of...
Write and test code in MIPS assembly language program to implement algorithms "The Non-Restoring Algorithm "of an 8-bit integer the user shoud insert the number then by the algo well find the square root
Implement the following expression in assembly language:                                  &nb
Implement the following expression in assembly language:                                                 BX = –val2 + 7 - (- val3 + val1) * 2 Assume that val1, val2, and val3 are 8-bit integer variables Initialize val1 with 12, val2 with 9, and val3 with 2 You are only allowed to use 16-bit registers to hold intermediate results, whenever needed. Use ONLY mov, add, sub, movzx, movzx, or neg instructions whenever needed. Use the debugger to verify your answer. Please answer using this format for...
Implement the following pseudocode in a MIPS assembly program. if ($t1 < $t2) { $t6 =...
Implement the following pseudocode in a MIPS assembly program. if ($t1 < $t2) { $t6 = $t2 } else { $t6 = $t1 } $t6 = $t6 + 1
Implement the following C++ code in assembly language. Substitute calls to WriteString for the printf() function...
Implement the following C++ code in assembly language. Substitute calls to WriteString for the printf() function calls: double X; double Y; if(x<Y) printf("X is lower\n"); else printf("X is not lower\n");
Write the following code segment in MARIE's assembly language: if x <= y then Y =...
Write the following code segment in MARIE's assembly language: if x <= y then Y = Y+1; else if x! =x then Y= Y -1; else z=z+1
Write a program in assembly language for x86 Processors, that uses a loop to calculate the...
Write a program in assembly language for x86 Processors, that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n -1) + Fib(n - 2)
Write an ARM assembly language program that counts the number of 1’s for any value in...
Write an ARM assembly language program that counts the number of 1’s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1’s in R0, should be in...