Home > other >  Through a great god C language to assembly language stack
Through a great god C language to assembly language stack

Time:11-30

C program translated into a 8086 assembly language program, use the stack pass variables from the main program subroutine, and use the AL will result from the process back to the main program,

# include
Char Max (char * s)
{char c;
int i;

If (s)=='\ n' return '\ n';
C=* s;
While (* (s + 1)! )='\ n' {
If (c<(+ 1) s) c=* (s + 1);
s++;
}
Return the c;
}
Void main ()
{
Char buffer [100], m;
int i=0;
Printf (" do enter a character string: ");

Do {
Buffer [I]=getchar ();
} while (buffer [i++]!='\ n');

M=Max (buffer);
Printf (" \ nthe maxium charater is: % c ", m);
}

CodePudding user response:

So these are not the default, cl/FA can directly convert c to asm
  • Related