㈠ c語言基礎問題,匯編語言,請看下題應該選擇什麼
廠商值的是硬體和軟體的出品商,比如Windows是微軟的,還比如主板上的BIOS是指硬體上的。所以確實是提前編譯好的。這里你只需要去用就行
這個題目比較刁鑽。這個引號內的匯編很迷惑人。程序運行難道不是編譯嗎?這個時候如果我不看題的話。也會選D的
㈡ 單片機。分別使用c語言和匯編語言編寫一個程序
#include<reg52.h>
unsignedcharaa_at_0x30;
voidmain()
{
IE=0x81;
IT0=1;
aa=0;
while(1);
}
X0_INT()interrupt0
{
aa++;
aa%=100;
}
//====================
ORG0000H
LJMPSTART
INC30H
MOVA,#100
CJNEA,30H,EXIT
MOV30H,#0
EXIT:
RETI
START:
MOVIE,#81H
SETBIT0
MOV30H,#0
SJMP$
END
上面兩個程序,均經過試驗,可以滿足題目要求。
㈢ [懸賞]求解C語言匯編題目
1、程序流程圖分析與改寫
因為參考程序流程圖中存在兩個if分支交叉的情況,這種程序流程無法直接用循環結構實現,所以需要對程序流程圖進行改寫。
在改寫之前需要對整個流程圖進行分析。
moose@debian:~/p_project/2015xxxx_網路知道/c_cam$./a.out
r0=45.000000,phi=0.000000,s=0.000000,ds=0.375000,a=0.151973,amax=0.151973,x=45.705578,y=-8.000000,X=36.347839,Y=-9.637916,xc=0.000000,yc=0.000000
r0=45.000000,phi=1.000000,s=0.000171,ds=0.000514,a=0.151973,amax=0.151973,x=17.963154,y=34.137642,X=14.285400,Y=25.378410,xc=0.000000,yc=0.000000
...
r0=45.000000,phi=119.000000,s=0.020388,ds=-44.188843,a=0.849510,amax=0.849510,x=45.426483,y=-24.410582,X=36.129913,Y=-22.455133,xc=0.000000,yc=0.000000
r0=45.000000,phi=120.000000,s=0.020559,ds=-44.563328,a=0.849509,amax=0.849510,x=32.584461,y=20.035658,X=25.916046,Y=13.269401,xc=0.000000,yc=0.000000
r0=45.000000,phi=121.000000,s=45.000000,ds=0.000000,a=0.087970,amax=0.849510,x=-12.404583,y=90.987427,X=-11.110419,Y=81.575989,xc=0.000000,yc=0.000000
...
r0=45.000000,phi=180.000000,s=45.000000,ds=0.000000,a=0.087970,amax=0.849510,x=-47.874447,y=-67.881332,X=-42.879730,Y=-59.800316,xc=0.000000,yc=0.000000
r0=45.000000,phi=181.000000,s=44.999592,ds=30.035320,a=0.237949,amax=0.849510,x=39.310745,y=-87.747360,X=35.209457,Y=-79.178261,xc=0.000000,yc=0.000000
r0=45.000000,phi=182.000000,s=44.999187,ds=30.534101,a=0.237950,amax=0.849510,x=90.353180,y=-26.939114,X=80.926598,Y=-25.760328,xc=0.000000,yc=0.000000
...
r0=45.000000,phi=360.000000,s=0.000000,ds=0.000000,a=0.173278,amax=0.849510,x=-20.637590,y=46.097324,X=-16.412260,Y=37.588707,xc=0.000000,yc=0.000000
㈣ c語言基礎知識問題:1.每一條匯編語言都有一條機器指令與之對應。2.一條機器指令對應一條匯編語言語句
1是錯的。匯編語言的指令中,有一些屬於偽指令,比如段定義指令:
dseg segment
再比如
a db '1234'
b equ $-a ;計算a的位元組長度。這個也不屬於機器指令
㈤ c語言和匯編語言混合編程,鍵盤輸入4個十進制數,用匯編語言計算這四
codesegment
assumecs:code
org100h
start:
pushcs
popds
pushcs
popes
callinputnum
movcx,num
movax,0
leasi,array
@1:
addax,[si]
incsi
incsi
loop@1
movbx,num
divBL
xorah,ah
calldispnum
movah,4ch
int21h
;鍵盤輸入數值數組子程序(數組名為array,元素個數存放在num中)
inputnumprocnear
;輸入的數據以一個空格分隔,以回車符結束輸入
leadi,array;將數組第一個元素的有效地址置入DI
movwordptr[num],0
stin:
movax,0
pushax
again1:
movah,1
int21h
movbyteptr[char],al
cmpal,13
jeline0
cmpal,''
jeline0
subal,30h
movah,0
movsi,ax
popax
movcl,10
movch,0
mulcx
addax,si
pushax
jmpagain1
line0:
popax
movwordptr[di],ax
incwordptr[num]
cmpbyteptr[char],13
jestinend
incdi
incdi
jmpstin
stinend:
ret
arraydw100p(0)
numdw0
chardb?
inputnumendp
;顯示十進制整型數值子程序
dispnumprocnear
;將要顯示的數據放入AX中
movdx,0
movbx,10
divbx
movbyteptr[y+6],dl;保存個位
movdx,0
divbx
movbyteptr[y+5],dl;保存十位
movdx,0
divbx
movbyteptr[y+4],dl;保存百位
movdx,0
divbx
movbyteptr[y+3],dl;保存千位
movbyteptr[y+2],al;保存萬位
moval,byteptr[y+2]
addal,30h;萬位轉ASC2
movbyteptr[y+2],al
moval,byteptr[y+3]
addal,30h;千位轉ASC2
movbyteptr[y+3],al
moval,byteptr[y+4]
addal,30h;百位轉ASC2
movbyteptr[y+4],al
moval,byteptr[y+5]
addal,30h;十位轉ASC2
movbyteptr[y+5],al
moval,byteptr[y+6]
addal,30h;個位轉ASC2
movbyteptr[y+6],al
movdi,1
disp1:
incdi
cmpdi,6
jedispexit
cmpbyteptr[y+di],'0'
jnedispexit
movbyteptr[y+di],''
jmpdisp1
dispexit:
movah,9
leadx,y
int21h
ret
ydb10,13,0,0,0,0,0,'$'
dispnumendp
code ends
endstart
請在未來匯編環境中調試運行。
㈥ c語言編程題
#include <stdio.h>
#include <math.h>
int main()
{
double x,y;
scanf("%lf",&x);
if(x<=-2)
y=-pow(exp(1),2*x+1)+3;
else if(x<=3)
y=2*x-1;
else
y=2*log10(3*x+5)-11;
printf("%lf ",y);
return 0;
}
㈦ 初學編程,大家幫忙看下這道c語言題怎麼做萬分感謝
先給你第一題的,網路知道的這個編輯器真的不適合粘貼代碼
#include<stdio.h>
#include<string.h>
#define MAX_ARRAY_SIZE 1024
#define MAX_MAP_SIZE 10
/* 輸入數組,連續輸入,如:aedabcdaeas */
int inputArray(char *buff) {
int len = 0;
/* 使用fgets來防止緩沖區溢出 */
if (NULL == fgets(buff, MAX_ARRAY_SIZE, stdin)) {
return 0;
}
len = strlen(buff);
/* fgets 返回的數據可能是換行符結尾的,也可能不是,對換行符結尾的進行處理 */
if (buff[len - 1] == ' ') {
buff[len - 1] = '