I think this are not bug, since SDCC is a free and open source software, it should trade in-between feature and cost, so what's important is knowing what is can and what it can not, and for those it can, also know how it does them.
Thanks, when I modified "0xFF", neither of the 2 errors is shown. And, I found 55 bool keyPad[4][4] = { 56 {0, 0, 0, 0}, 57 {0, 0, 0, 0}, 58 {0, 0, 0, 0}, 59 {0, 0, 0, 0} 60 }; was OK, and 45 /* 46 bool keyPad[4][4] = { 47 0, 0, 0, 0, 48 0, 0, 0, 0, 49 0, 0, 0, 0, 50 0, 0, 0, 0 51 }; 52 */ would trigger "error 69: struct/union/array '': initialization needs curly braces". I attached this feature description here, maybe it is useful for someone else.
Thanks, when I modified "0xFF", neither of the 2 errors is shown. And, I found 55 bool keyPad[4][4] = { 56 {0, 0, 0, 0}, 57 {0, 0, 0, 0}, 58 {0, 0, 0, 0}, 59 {0, 0, 0, 0} 60 }; was OK, and 45 /* 46 bool keyPad[4][4] = { 47 0, 0, 0, 0, 48 0, 0, 0, 0, 49 0, 0, 0, 0, 50 0, 0, 0, 0 51 }; 52 */ would trigger "error 69: struct/union/array '': initialization needs curly braces".
Hier:
If the array is a global variable, you could omit the explicit zero-initialization as a workaround, because global variables are implicitly zeroed. This works.
When I declared as this: 45 bool keyPad[4][4] = { 46 {0, 0, 0, 0}, 47 {0, 0, 0, 0}, 48 {0, 0, 0, 0}, 49 {0, 0, 0, 0} 50 }; 51 52 bool ledArray[8][8] = { 53 {0, 0, 0, 0, 0, 0, 0, 0}, 54 {0, 0, 0, 0, 0, 0, 0, 0}, 55 {0, 0, 0, 0, 0, 0, 0, 0}, 56 {0, 0, 0, 0, 0, 0, 0, 0}, 57 {0, 0, 0, 0, 0, 0, 0, 0}, 58 {0, 0, 0, 0, 0, 0, 0, 0}, 59 {0, 0, 0, 0, 0, 0, 0, 0}, 60 {0, 0, 0, 0, 0, 0, 0, 0} 61 }; 62 It was prompted: ?ASlink-Warning-Undefined Global 'FF' referenced by module 'keypad_ledarray' and, when I declared...
When I declared as this: 45 bool keyPad[4][4] = { 46 {0, 0, 0, 0}, 47 {0, 0, 0, 0}, 48 {0, 0, 0, 0}, 49 {0, 0, 0, 0} 50 }; 51 52 bool ledArray[8][8] = { 53 {0, 0, 0, 0, 0, 0, 0, 0}, 54 {0, 0, 0, 0, 0, 0, 0, 0}, 55 {0, 0, 0, 0, 0, 0, 0, 0}, 56 {0, 0, 0, 0, 0, 0, 0, 0}, 57 {0, 0, 0, 0, 0, 0, 0, 0}, 58 {0, 0, 0, 0, 0, 0, 0, 0}, 59 {0, 0, 0, 0, 0, 0, 0, 0}, 60 {0, 0, 0, 0, 0, 0, 0, 0} 61 }; 62 It was prompted: ?ASlink-Warning-Undefined Global 'FF' referenced by module 'keypad_ledarray' and, when I declared...
demo for stack - push/pop ;The storing of a CPU register in the stack is called a PUSH. ;The loading of the contents of the stack back into a CPU register is called a POP. org 00h Main: ;set SP at the default location - 07h - 0000 0111B Default: mov R2, #12h mov R3, #22h mov R4, #32h mov R5, #42h mov R6, #52h mov R7, #62h push 2 push 3 push 4 push 5 push 6 push 7 Second: mov SP, #28h ;set RAM location 28h as the first stack location push 2 push 3 push 4 push 5 push 6 push 7 Third: setb PSW.3 setb...
mov TMOD, #50h mov TH0, #15 ;255-15=240, 240*250=60000 mov TL0, 00h setb TR0 ;start Timer0 jnb TF0, $ ;program would waiting here till TF0 not be set When I simulating this code, either "mov TL0, 00h" or "mov TL0, 1Fh", "inb TF0, $" will increase TL0 from 00-1F then carry on, what does the "5-bit prescaler" mean, if "mov TL0, 1Fh", shouldn't the simulator increase TH0 only?
the icon of "Step program" and "Jump to line" looks the same, it would be better if they have different appreances. The "Simulator" upside-down would be in the same order with Intel datasheet. what does the "000_51asm(0)" flag mean? it can't be shut-down. (Attachment) the prompt windows couldn't be closed by click "OK"
Problem solved by following changes: 1. add ";" at the end of array definition. 2. there should not be "{}" at the end of function declaration. 3. "P2.2" should be "P2_2". 4. "sdcc -c -mmcs51 --std-sdcc89 display.c" should be "sdcc -c -mmcs51 display.c".
Problem solved by following changes: 1. add ";" at the end of array definition. 2. there should not be "{}" at the end of function declaration. 3. "P2.2" should be "P2_2". 4. sdcc -c -mmcs51 --std-sdcc89 display.c" should be "sdcc -c -mmcs51 display.c".
I wrote "display.h" this way: #ifndef __DISPLAY_H_ #define __DISPLAY_H_ const unsigned int display_segment[10] ={ 0x3f, 0x06, 0x5d, 0x4f, 0x65, 0xd5, 0x7d, 0x07, 0x7f, 0x4f } const unsigned int display_digit[0]={ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 } void segmentDisplay(unsigned int segment){}; void digitDisplay(unsigned int digit){}; void numberDisplay(unsigned int* segment, unsigned int digit){}; __sfr __at(0x80) P0; __sfr __at(0xA0) P2; __sbit __at(0xA0+2) P2.2 __sbit __at(0xA0+3) P2.3 __sbit__at(0xA0+4)...
I wrote "display.h" this way: ifndef __DISPLAY_H_ define __DISPLAY_H_ const unsigned int display_segment[10] ={ 0x3f, 0x06, 0x5d, 0x4f, 0x65, 0xd5, 0x7d, 0x07, 0x7f, 0x4f } const unsigned int display_digit[0]={ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 } void segmentDisplay(unsigned int segment){}; void digitDisplay(unsigned int digit){}; void numberDisplay(unsigned int* segment, unsigned int digit){}; __sfr __at(0x80) P0; __sfr __at(0xA0) P2; __sbit __at(0xA0+2) P2.2 __sbit __at(0xA0+3) P2.3 __sbit__at(0xA0+4)...
Yes, cast "(unsigned char)" would be solution.
I tried mcs-51 project on Ubuntu through VMware, when compiled, it prompted lack of intrins.h, I added one, there was still some error, how to fix this? my intrins.h: #ifndef __INTRINS_H__ #define __INTRINS_H__ extern void _nop_ (void); //extern bit _testbit_ (bit); extern unsigned char _cror_ (unsigned char, unsigned char); extern unsigned int _iror_ (unsigned int, unsigned char); extern unsigned long _lror_ (unsigned long, unsigned char); extern unsigned char _crol_ (unsigned char, unsigned char);...
I tried mcs-51 project on Ubuntu through VMware, when compiled, it prompted lack of intrins.h, I added one, there was still some error, how to fix this? my intrins.h: #ifndef __INTRINS_H__ #define __INTRINS_H__ extern void _nop_ (void); //extern bit _testbit_ (bit); extern unsigned char _cror_ (unsigned char, unsigned char); extern unsigned int _iror_ (unsigned int, unsigned char); extern unsigned long _lror_ (unsigned long, unsigned char); extern unsigned char _crol_ (unsigned char, unsigned char);...
Yes, I did as it was told in README, and there was no error prompted in "./configure.sh".
I have just tested on Ubuntu, the situation was the same - there was error when "make".
The errors after run "make install":
I made it in VMware on Windows 10, when I run "make" and "make install" as it was told here - https://stm8-binutils-gdb.sourceforge.io/, there were both 2 errors: