C程式翻譯成一個8086匯編語言程式。 使用stack將變數從主程式傳遞給子程式,并使用AL將結果從程序回傳給主程式。
#include
char max (char *s)
{ char c;
int i;
if ( s=='\n' ) return '\n';
c=*s;
while ( *(s+1)!='\n') {
if (c<(s+1) ) c=*(s+1);
s++;
}
return c;
}
void main()
{
char buffer[100], m;
int i=0;
printf("Please enter a character string: ");
do {
buffer[i] = getchar();
} while (buffer[i++] != '\n');
m=max(buffer);
printf("\nthe maxium charater is : %c", m);
}
uj5u.com熱心網友回復:
這些不都是默認就這樣么,cl /FA 可以直接把 c轉換為 asm 吧轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/28352.html
標籤:匯編語言
下一篇:新生請教Python切片問題
