Verified Commit 809426b9 authored by Camil Staps's avatar Camil Staps 🚀

Add create_array_REAL

parent 45ac9f24
......@@ -152,6 +152,7 @@ const char *instruction_type (BC_WORD i) {
case Ccreate_array_BOOL: return "";
case Ccreate_array_CHAR: return "";
case Ccreate_array_INT: return "";
case Ccreate_array_REAL: return "";
case Ccreate_array_r_: return "nnl";
case Ccreate_array_r_a: return "nl";
case Ccreate_array_r_b: return "nl";
......
......@@ -137,6 +137,7 @@ enum {
INSTRUCTION(create_array_BOOL)
INSTRUCTION(create_array_CHAR)
INSTRUCTION(create_array_INT)
INSTRUCTION(create_array_REAL)
INSTRUCTION(create_array_r)
INSTRUCTION(create_array_r_)
INSTRUCTION(create_array_r_a)
......
......@@ -1357,6 +1357,13 @@ void code_create_array_(char element_descriptor[],int a_size,int b_size) {
add_instruction(Ccreate_array_INT);
return;
}
case 'R':
if (element_descriptor[1]=='E' && element_descriptor[2]=='A' && element_descriptor[3]=='L' &&
element_descriptor[4]=='\0')
{
add_instruction(Ccreate_array_REAL);
return;
}
case '_':
if (element_descriptor[1]=='_' && element_descriptor[2]=='\0') {
add_instruction(Ccreate_array_);
......
......@@ -1915,6 +1915,21 @@ INSTRUCTION_BLOCK(create_array_INT):
pc+=1;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(create_array_REAL):
{
BC_WORD s;
s=bsp[0];
NEED_HEAP(s+3);
++bsp;
hp[0]=(BC_WORD)&__ARRAY__+2;
hp[1]=s;
hp[2]=(BC_WORD)&REAL+2;
*++asp=(BC_WORD)hp;
hp+=3+s;
pc+=1;
END_INSTRUCTION_BLOCK;
}
INSTRUCTION_BLOCK(create_array_r):
{
BC_WORD s,i,n_ab,n_b,n_a;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment