How do you write the if else statement below in assembly languange?
C Code:
If ( input < WaterLevel)
{
MC = 1;
}
else if ( input == WaterLevel)
{
MC = 0;
}
Pseudocode
If input < Water Level
Send 1 to microcontroller
Turn Motor On
Else if input == Water Level
Send 0 to microcontroller
Turn Motor Off
Incomplete Assembly: (MC- Microcontroller)
CMP Input, WaterLevel
MOV word[MC], 1
MOV word[MC], 2
else
branch, which is fundamentally wrong. As a student you should rather try to figure out why, or ask for reason, than asking for respect - that will do little good to you, even if I would comply. If you are asking me to have empathy with your view, try also mine. I'm much more worried about such code slipping into real product, than I'm worried about being nice. Being rude does hurt people less than a water flood.