Question
Using NASM, using jz, cmp, flags, loops also use the register 32 bit Task: Design and write an assembly code that will determine if a
Using NASM, using jz, cmp, flags, loops also use the register 32 bit Task:
Design and write an assembly code that will determine if a given year is a Leap Year. Things to consider
How to change a string of numbers into its numerical counterpart o Helpful Hit:
Take a 4-digit string
Get the thousands digit
Multiply by 10
Add the hundreds digit
Multiply by 10 etc..
What defines a leap year A year is a leap year if it is divisible by 4 and not divisible by 100, unless it is also divisible by 400
. Would any loops (jmp to self), or if else statements (je or jne) that would be useful Loop: ~~~~ Code ~~~~ jmp Loop Compares: cmp ~x~, ~y~ je ~~something~~ jne ~~something else sample output : Type Year: 2000 This year is a leap year type Year: 2005 This year is not a leapy year
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started