Write an assembler program that will perform the simple if l

Write an assembler program that will perform the simple \'if\' logic

enter 2 ints

print out the largest number first, then the second

Solution

XRA ; clear the accumulator MVI B, 30H ; load a number to B Register MVI C, 40H ; load a number to C Register MOV A, B ; Move the content of B to A CMP C ; Compare value of C against A JC GRT ; Jump if bigger **JMP END** ; Halt program if not big GRT: MOV A, C ; save greater num in accumulator **END: HLT**
Write an assembler program that will perform the simple \'if\' logic enter 2 ints print out the largest number first, then the secondSolution XRA ; clear the ac

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site