I don't know where to start, but anyway, i am new to assembly language and trying to write a basic bubble sort program. I know the algorithm to do it, but lack the syntax knowledge such as:
1. what is the command for for loops, if loops. If anyone can direct me to some reading material like assembly for dummies, it would be helpful too.
Here are the code in C and I am just trying to convert them over to assembly.
// allocate the memory size for the integer array
int A[] = new int[arraySize];
// Now, get the list of integers from the user for the specified array size.
for (i = 0; i < arraySize; i ++) {
printf("enter a number --->"
scanf("%d", &A);
}
// Now, sort the array
for (i = 0; i < (arraySize - 1); i ++) {
for (j = (i+1); j < arraySize ; j ++) {
if (A > A[j]) {
temp = A;
A = A[j];
A[j] = temp;
}
}
}
// Print out the sorted array
for (i = 0; i < arraySize; i ++) {
printf("%d\n", A);
}
1. what is the command for for loops, if loops. If anyone can direct me to some reading material like assembly for dummies, it would be helpful too.
Here are the code in C and I am just trying to convert them over to assembly.
// allocate the memory size for the integer array
int A[] = new int[arraySize];
// Now, get the list of integers from the user for the specified array size.
for (i = 0; i < arraySize; i ++) {
printf("enter a number --->"
scanf("%d", &A);
}
// Now, sort the array
for (i = 0; i < (arraySize - 1); i ++) {
for (j = (i+1); j < arraySize ; j ++) {
if (A > A[j]) {
temp = A;
A = A[j];
A[j] = temp;
}
}
}
// Print out the sorted array
for (i = 0; i < arraySize; i ++) {
printf("%d\n", A);
}