Help with translating C code into assembler code


Posted on 16th Feb 2014 07:03 pm by admin

Hi im doing a project that moves a robot around a maze avoiding walls and need some help with converting C code into assembly code.




#include
int left_feeler;
int right_feeler
int left_speed;
in right_speed;

void main ()
{
While (1)
{
printf(" left feeler=");
scanf( "%d/n", &left_feeler);
printf(" right feeler=");
scanf( "%d", &right_feeler);
if (( left_feeler ==0) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==0))
{
left_speed = 10 ;
right_speed = 0 ;
}
if (( left_feeler ==0) && ( right_feeler ==1))
{
left_speed = 0 ;
right_speed = 10 ;
}
if (( left_feeler ==1) && ( right_feeler ==1))
{
left_speed = 10 ;
right_speed = 0 ;
}
printf("right speed = %d n", right_speed) ;
printf("left speed = %d n", left_speed) ;

No comments posted yet

Your Answer:

Login to answer
131 Like 32 Dislike
Previous forums Next forums
Other forums

Procedural to OOP
ohn Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pri

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

Cannot Connect to Database
I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

Using Microsoft Exchange Server with PHP
Hi,

I wanted to know if its possible to fetch email attachments from the exchange server usin

Solution Manager BPR
Does the SolMan-BPR-ARIS-Integration (http://www.ids-scheer.com/en/ARIS/ARIS_Platform/ARIS_Business_

mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscr

search function
HI guys,

if anyone could point us in the right direction of how to do this, or provide some t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash