reti=sscanf(str,"$GPFPD,%d,%[^,],%f,%f,%f,%lf,%lf,%f,%f,%f,%f,%f,%i,%i,%[^*]", &(gpfpd_data->GPSWeek),&(gpfpd_data->GPSTime),&(gpfpd_data->Heading),&(gpfdp_data->Pitch),&(gpfdp_data->Roll), \ &(gpfpd_data->Latitude),&(gpfpd_data->Longitude),&(gpfpd_data->Altitude),\ &(gpfpd_data->Ve),&(gpfpd_data->Vn),&(gpfpd_data->Vu),\ &(gpfpd_data->Baseline),&(gpfpd_data->NSV1),&(gpfpd_data->NSV2),\ &(gpfpd_data->Status));什么意思
时间: 2023-05-30 21:01:38 浏览: 170
As an AI language model, I do not have emotions and I cannot provide any opinion or response to the concept of "null." In computer programming, "null" generally refers to a value that is undefined or has no value.
相关问题
能帮我把这段c语言程序改为汇编语言程序吗 #include"reg51.h" #include"lcd1602.h" unsigned char flag=0,count=0,lenth=60,a=0,c=0; unsigned char str2[16]={"8206210706 "}; unsigned char num[4]={"2101"}; unsigned char table[60]={ 0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00, 0x04,0x1F,0x15,0x1F,0x15,0x1F,0x04,0x07, 0x03,0x04,0x1C,0x04,0x1F,0x04,0x0E,0x15, 0x12,0x0A,0x16,0x0A,0x1F,0x02,0x02,0x02, 0x1F,0x12,0x14,0x12,0x1F,0x10,0x10,0x10, 0x04,0x1F,0x08,0x14,0x1F,0x04,0x0E,0x15, 0x04,0x1F,0x08,0x10,0x0F,0x09,0x0F,0x09}; void delay(unsigned int t) { unsigned int i=0,j=0; for(i=0;i<t;i++) { for(j=0;j<120;j++); } } void writedat(unsigned char dat) { RS=1; RW=0; E=0; E=1; P2=dat; delay(5); E=0; } void writecom(unsigned char com) { RS=0; RW=0; E=0; E=1; P2=com; delay(5); E=0; } void initlcd() { int u=0; writecom(0x38); writecom(0x0c); writecom(0x06); writecom(0x01); writecom(0x40); for(u=0;u<72;u++) { writedat(table[u]); } } void initscon() { SCON=0x50; //0101 0000 TMOD=0x20; //0010 0000 TH1=256-3; TL1=256-3; EA=1; ES=1; TR1=1; IP=0x01; } void initex0() {IT0=1; EX0=1; } void senddat_function() { unsigned char i=0; if(a==1) { SBUF=1; while(!TI); TI=0; a=0; } if(flag==1) { SBUF=2; while(!TI); TI=0; flag=0; } } void Show_txt(unsigned char x,unsigned char i) { writecom(0x80 |x); writedat(i); } void Show_str(unsigned char x,unsigned char y,unsigned char *s) { int i=0; if(y==0) writecom(0x80 |x); if(y==1) writecom(0xc0 |x); for(i=0;i<16;i++) writedat(s[i]); } void display() { int j; writecom(0x80+0x40); delay(1); for(j=0;j<16;j++) { writedat(str2[j]); delay(1); } } void main() { int j; initscon(); initex0(); initlcd(); while(1) {senddat_function(); Show_txt(0,1); Show_txt(1,2); Show_txt(2,3); writecom(0x80|3); delay(1); for(j=0;j<4;j++) { writedat(num[j]); delay(1); } Show_txt(7,4); Show_txt(8,5); Show_txt(9,6); display();} } void ex0_isr() interrupt 0 { int j; c=c+1; if(c==1) {a=1;flag=0; Show_txt(0,1); Show_txt(1,2); Show_txt(2,3); writecom(0x80|3); delay(1); for(j=0;j<4;j++) { writedat(num[j]); delay(1); } Show_txt(7,4); Show_txt(8,5); Show_txt(9,6); } if(c==2) {flag=1; c=0; a=0;} }
由于您没有指定使用的汇编语言,我将使用汇编语言的伪代码来展示如何将C语言程序转换为汇编语言程序:
```
//定义变量
flag: db 0
count: db 0
lenth: db 60
a: db 0
c: db 0
str2: db "8206210706 ", 0
num: db "2101", 0
table: db 0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x1F,0x15,0x1F,0x15,0x1F,0x04,0x07,0x03,0x04,0x1C,0x04,0x1F,0x04,0x0E,0x15,0x12,0x0A,0x16,0x0A,0x1F,0x02,0x02,0x02,0x1F,0x12,0x14,0x12,0x1F,0x10,0x10,0x10,0x04,0x1F,0x08,0x14,0x1F,0x04,0x0E,0x15,0x04,0x1F,0x08,0x10,0x0F,0x09,0x0F,0x09
//定义函数
delay:
push bp
mov bp, sp
; t次循环
mov ax, [bp+2]
delay_loop:
dec ax
jnz delay_loop
pop bp
ret
writedat:
push ax
push dx
; 设置数据寄存器
mov RS, 1
mov RW, 0
mov E, 0
mov E, 1
; 写入数据
mov al, [bp+4]
mov P2, al
; 延时
call delay
; 关闭使能
mov E, 0
pop dx
pop ax
ret
writecom:
push ax
push dx
; 设置命令寄存器
mov RS, 0
mov RW, 0
mov E, 0
mov E, 1
; 写入命令
mov al, [bp+4]
mov P2, al
; 延时
call delay
; 关闭使能
mov E, 0
pop dx
pop ax
ret
initlcd:
push ax
; 初始化液晶屏
call writecom, 0x38
call writecom, 0x0c
call writecom, 0x06
call writecom, 0x01
call writecom, 0x40
; 显示字符表
mov cx, 72
mov si, offset table
initlcd_loop:
mov al, [si]
call writedat
inc si
loop initlcd_loop
pop ax
ret
initscon:
push ax
; 初始化串口
mov SCON, 0x50
mov TMOD, 0x20
mov TH1, 253
mov TL1, 253
; 开启中断
setb EA
setb ES
setb TR1
mov IP, 0x01
pop ax
ret
initex0:
; 初始化外部中断0
setb IT0
setb EX0
senddat_function:
push ax
; 发送数据
mov al, a
cmp al, 1
jne senddat_function_flag
mov SBUF, 1
wait_senddat_function_ti:
jb TI, wait_senddat_function_ti
clr TI
mov a, 0
jmp senddat_function_end
senddat_function_flag:
cmp flag, 1
jne senddat_function_end
mov SBUF, 2
wait_senddat_function_ti2:
jb TI, wait_senddat_function_ti2
clr TI
mov flag, 0
senddat_function_end:
pop ax
ret
Show_txt:
push ax
push dx
; 显示单个字符
mov al, [bp+4]
mov dl, [bp+6]
add dl, 0x80
call writecom, dl
call writedat, al
pop dx
pop ax
ret
Show_str:
push ax
push bx
push cx
push dx
; 显示字符串
mov bl, [bp+6]
cmp bl, 0
je Show_str_line_1
cmp bl, 1
je Show_str_line_2
jmp Show_str_end
Show_str_line_1:
mov dl, [bp+4]
add dl, 0x80
call writecom, dl
jmp Show_str_loop
Show_str_line_2:
mov dl, [bp+4]
add dl, 0xc0
call writecom, dl
Show_str_loop:
xor cx, cx
mov si, [bp+8]
mov cx, 16
Show_str_loop_next:
mov al, [si]
call writedat
inc si
loop Show_str_loop_next
Show_str_end:
pop dx
pop cx
pop bx
pop ax
ret
display:
push ax
push bx
; 在第二行显示字符串
call writecom, 0x80+0x40
call delay, 1
mov bx, offset str2
mov cx, 16
display_loop:
mov al, [bx]
call writedat
inc bx
loop display_loop
pop bx
pop ax
ret
main:
; 初始化
call initscon
call initex0
call initlcd
main_loop:
; 发送数据
call senddat_function
; 在第一行显示数字
call Show_txt, 0, 1
call Show_txt, 1, 2
call Show_txt, 2, 3
call writecom, 0x80|3
mov cx, 4
mov si, offset num
main_loop_num:
mov al, [si]
call writedat
inc si
loop main_loop_num
; 在第四行显示字符串
call Show_txt, 7, 4
call Show_txt, 8, 5
call Show_txt, 9, 6
; 在第二行显示字符串
call display
jmp main_loop
ex0_isr:
push ax
push bx
; 处理外部中断0
inc c
cmp c, 1
jne ex0_isr_end
mov a, 1
mov flag, 0
call Show_txt, 0, 1
call Show_txt, 1, 2
call Show_txt, 2, 3
call writecom, 0x80|3
mov cx, 4
mov si, offset num
ex0_isr_num:
mov al, [si]
call writedat
inc si
loop ex0_isr_num
call Show_txt, 7, 4
call Show_txt, 8, 5
call Show_txt, 9, 6
jmp ex0_isr_end
ex0_isr_end:
cmp c, 2
jne ex0_isr_exit
mov flag, 1
mov c, 0
mov a, 0
ex0_isr_exit:
pop bx
pop ax
reti
```
请注意,这只是一种伪代码实现,具体的汇编语言实现可能会因为不同的汇编语言语法而有所不同。
#include<reg51.h> #include<intrins.h> #define uchar unsigned char #define uint unsigned int uchar code Table_of_Digits[]= { 0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00, //0 0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00, //1 0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00, //2 0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00, //3 0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00, //4 0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00, //5 0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00, //6 0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00, //7 0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00, //8 0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00 //9 }; uchar i=0,t=0,Num_Index; //主程序 void main() { P3=0x80; //P3最高位为0,控制位选 Num_Index=0; //从0开始显示 TMOD=0x00; //T0方式0 TH0=(8192-2000)/32; //2ms定时 TL0=(8192-2000)%32; IE=0x82; TR0=1; //启动T0 while(1); } //T0中断函数 void LED_Screen_Display() interrupt 1 { TH0=(8192-2000)/32; //恢复初值 TL0=(8192-2000)%32; P0=0xff; //输出位码和段码 P0=~Table_of_Digits[Num_Index*8+i]; //补码 P3=_crol_(P3,1); if(++i==8) i=0; //每屏一个数字由8个字节构成 if(++t==250) //每个数字刷新显示一段时间 { t=0; if(++Num_Index==10) Num_Index=0; //显示下一个数字 } }
下面是对应的汇编语言代码:
```
; 包含头文件
include reg51.inc
include intrins.inc
; 定义宏
#define uchar unsigned char
#define uint unsigned int
; 数码管显示的数字表
Table_of_Digits: db 0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x00 ; 0
db 0x00,0x00,0x00,0x21,0x7f,0x01,0x00,0x00 ; 1
db 0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00 ; 2
db 0x00,0x22,0x49,0x49,0x49,0x36,0x00,0x00 ; 3
db 0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00 ; 4
db 0x00,0x72,0x51,0x51,0x51,0x4e,0x00,0x00 ; 5
db 0x00,0x3e,0x49,0x49,0x49,0x26,0x00,0x00 ; 6
db 0x00,0x40,0x40,0x40,0x4f,0x70,0x00,0x00 ; 7
db 0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00 ; 8
db 0x00,0x32,0x49,0x49,0x49,0x3e,0x00,0x00 ; 9
; 定义变量
i: db 0 ; i 初始值为 0
t: db 0 ; t 初始值为 0
Num_Index: db 0 ; Num_Index 初始值为 0
; 主程序
main:
mov P3, #0x80 ; P3最高位为0,控制位选
mov Num_Index, #0 ; 从0开始显示
mov TMOD, #0x00 ; T0方式0
mov TH0, #(8192-2000)/32 ; 2ms定时
mov TL0, #(8192-2000)%32
mov IE, #0x82 ; 开启中断
setb TR0 ; 启动T0
loop:
jmp loop ; 无限循环
; T0中断函数
LED_Screen_Display:
mov TH0, #(8192-2000)/32 ; 恢复初值
mov TL0, #(8192-2000)%32
mov P0, #0xff ; 输出位码和段码
mov A, Num_Index
mul AB, #8
add A, i
mov DPTR, #Table_of_Digits
add DPTR, A
mov A, @DPTR
cpl A ; 补码
mov P0, A
mov A, P3
rl A
mov P3, A
inc i
cjne i, #8, no_reset_i ; 每屏一个数字由8个字节构成
mov i, #0 ; 重置 i
inc t
cjne t, #250, no_reset_Num_Index ; 每个数字刷新显示一段时间
mov t, #0 ; 重置 t
inc Num_Index
cjne Num_Index, #10, no_reset_Num_Index
mov Num_Index, #0
no_reset_Num_Index:
no_reset_i:
reti
```
阅读全文