04-21-2021 03:50 AM
The compiler may still require the const access modifier, in that case the declarations should be like these:
rom const int i_arr[4][4] = {{0,1,1,1},{1,0,1,1},{1,1,0,1},{1,1,1,0}};
rom const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
rom const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
04-21-2021 03:55 AM
Still comes back with:
Multisim - 21 April 2021, 09:53:22
-------------------------Building: Project: Calculator--------------------------
Note: -E compiler option was not present. This option has been added to the compiler build command temporarily.
Note: -O compiler option was not present. This option has been added to the compiler build command temporarily.
Error: C:\Users\Dad Laptop\Documents\National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 22 undefined identifier "rom"
04-26-2021 06:00 AM
Can you post the error message(s) when I suggested using const and code declaration modifiers (refer to one of my previous replies)? If the error(s) involve i_arr only, you can try using const or/and code declaration modifiers in c_arr and error only:
const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
or
code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
or
code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
04-26-2021 09:37 AM
Hi
I've tried all the variations and it seems to still give the two linker errors.
See the results below:
const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
Compiler results: 0 - Errors, 0 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings
code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 28 auto variable "error" should not be qualified
Compiler results: 0 - Errors, 1 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings
code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
National Instruments\Circuit Design Suite 14.2\MCU Workspaces\Calculator\Calculator\Calculator8052.c : 28 auto variable "error" should not be qualified
Compiler results: 0 - Errors, 1 - Warnings
Linking...
Error: : 0 psect "rbss" exceeds address limit: 08Ch > 080h
Error: : 0 psect "rdata" exceeds address limit: 08Ch > 080h
Linker results: 2 - Errors, 0 - Warnings
05-03-2021 11:55 AM
The error messages are important, the modifications that we try are based on these messages. The code and/or const declaration modifiers may give us hope to successfully build this code. Try relocating the declarations of c_arr and error between #include <htc.h> and function declarations. Again, try the three variants I mentioned in my previous reply:
#include <htc.h>
code const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
/******Function declaration******/
or
#include <htc.h>
code char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
code char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
/******Function declaration******/
or
#include <htc.h>
const char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}};
const char error[10]={'M','A','T','H',' ','E','R','R','O','R'};
/******Function declaration******/
You don't have to delete the original declarations inside main(), simply comment them out:
void main()
{
•
•
•
/* char c_arr[4][4] = {{'7','4','1','o'},{'8','5','2','0'},{'9','6','3','='},{'+','-','*','/'}}, error[10]={'M','A','T','H',' ','E','R','R','O','R'}; */
•
•
•
}
Post any changes in error messages, if they are too long you can opt to attach them as file instead of inline text.