菜鸟问个问题,望大侠给予指导,谢谢了
for( i = 0; i < 240 ; i++)
{
uint8_t m = bitcode[i];
//if ( bitcode[i] )
asm volatile
(
"mov eax, %[codevalue] \n\t"
"cpi eax, #0 \n\t" //Compare with Immediate
"jmp label1 \n\t"
"cpi eax, #1 \n\t"
"jmp label2 \n\t"
".label1:"
"sbi %[port], %[bit] \n\t" // Set the output bit 14nop Set Bit in I/O Register
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"cbi %[port], %[bit] \n\t" // Clear the output bit 3nop
"nop \n\t"
"nop \n\t"
"nop \n\t"
".label2:"
"sbi %[port], %[bit] \n\t" // Set the output bit 6nop
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"cbi %[port], %[bit] \n\t" // Clear the output bit 11nop
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
"nop \n\t"
::
[codevalue] "I" (m),
[port] "I" (_SFR_IO_ADDR(PIXEL_PORT)),
[bit] "I" (PIXEL_BIT)
); |