E-3 Error in ASM Code: Label not found "33"
E-3 Error in ASM Code: Label not found "33"
- E-3 Error in ASM Code: Label not found "33" -
Please, can anyone tell me what this error means?
Thank you,
Ionut Muntean
Please, can anyone tell me what this error means?
Thank you,
Ionut Muntean
Ionut Muntean
Hi,
After changing some lines in the below code (inserting the pointer operation), I've got the error. Anyway, I'm not sure that this is the code that generates the error, because the message does not tell where in the code the error is. The asm file is not generated.
Thank you,
Ionut Muntean
After changing some lines in the below code (inserting the pointer operation), I've got the error. Anyway, I'm not sure that this is the code that generates the error, because the message does not tell where in the code the error is. The asm file is not generated.
Code: Select all
function ReadTrack(var buffer: array [1..25 * BLK_LEN] of Byte): Boolean;
var Address: Longint;
i: Word;
p: ^Byte;
begin
Result := false;
if not DTSTest then Exit;
if not DTSToAddress(Address) then Exit;
i := 0;
p := @buffer;
while i <= 25 do
begin
Inc(i);
p := p + ((i - 1 ) * BLK_LEN) + 1;
{$IFDEF DEBUG}
Wrt( 'Citire: ', Address + i - 1);
{$ENDIF}
if mmcRead(Address, p) <> 0 then
begin
{$IFDEF DEBUG}
Wrt( 'Err:Citire ', Address + i - 1);
{$ENDIF}
Exit;
end;
end;
TrackDirty := false;
Result := true;
end;
Ionut Muntean
Hi,
After changing some lines in the below code (inserting the pointer operation), I've got the error. Anyway, I'm not sure that this is the code that generates the error, because the message does not tell where in the code the error is. The asm file is not generated.
Thank you,
Ionut Muntean
After changing some lines in the below code (inserting the pointer operation), I've got the error. Anyway, I'm not sure that this is the code that generates the error, because the message does not tell where in the code the error is. The asm file is not generated.
Code: Select all
function ReadTrack(var buffer: array [1..25 * BLK_LEN] of Byte): Boolean;
var Address: Longint;
i: Word;
p: ^Byte;
begin
Result := false;
if not DTSTest then Exit;
if not DTSToAddress(Address) then Exit;
i := 0;
p := @buffer;
while i <= 25 do
begin
Inc(i);
p := p + ((i - 1 ) * BLK_LEN) + 1;
{$IFDEF DEBUG}
Wrt( 'Citire: ', Address + i - 1);
{$ENDIF}
if mmcRead(Address, p) <> 0 then
begin
{$IFDEF DEBUG}
Wrt( 'Err:Citire ', Address + i - 1);
{$ENDIF}
Exit;
end;
end;
TrackDirty := false;
Result := true;
end;
Ionut Muntean
I am getting the same error with this code. I am still having no luck trying to find a way to do division without getting the wrong result or getting an error message.
Code: Select all
program Test_div;
var
data: Real;
Txt: string[6];
procedure showData;
begin
data := data / 3.0;
FloatToStr(data,Txt);
Glcd_Write_Text(Txt,1,1,1);
end;
begin
Glcd_Init(PORTD, 2, 3, 4, 5, 7, 6, PORTA);
Glcd_Set_Font(font5x7,5,8,32);
while true do
begin
data:= 1.234;
ShowData;
end;
end.
Targa,
If you look at this announcement it states that in version 4.0.0.0 these were implemented. To me implemented means added ?
http://www.mikroe.com/forum/viewtopic.php?t=7154
If you look at this announcement it states that in version 4.0.0.0 these were implemented. To me implemented means added ?
http://www.mikroe.com/forum/viewtopic.php?t=7154
- Implemented floating point
- Implemented real math and trigonometry
Here are the basics which will enable you to work further:
Code: Select all
program test;
var
data: Real;
Txt: string[30];
procedure LongIntToStr2(input: LongInt; var output: array[12] of char);
var len, neg : byte;
data : longint;
begin
output := ' ';
neg:=0;
if input < 0 then
begin
neg:=1;
output[0]:='-';
input:=0-input;
end;
len := neg;
data := input;
while data <> 0 do
begin
data := data div 10;
inc(len);
end;
while len > neg do
begin
data := input mod 10;
input := input div 10;
output[len-1]:= 48 + data;
Dec(Len);
end;
output[11]:=0;
end;
procedure FloatToStr2(input: real; var output: array[23] of char);
var
tmpli: longint;
tmpr : real;
i, j : word;
ch : byte;
pref,
suff : array[12] of char;
neg: byte;
begin
neg := false;
tmpli := input;
if (input < 0) then
if (tmpli = 0) then
begin
neg := true;
end;
LongintToStr2(tmpli, pref);
tmpr := tmpli;
tmpr := input - tmpr;
tmpli := tmpr*100000.; // take last five significant digits
if tmpli<0 then tmpli:=-tmpli;
LongintToStr2(tmpli, suff);
i := 0;
j := 0;
if neg then
begin
output[0]:='-';
i:=1;
end;
ch := pref[0];
while ch = 32 do
begin
inc(j);
ch := pref[j];
end;
while ch <> 0 do
begin
if ch = 32 then
break;
output[i] := ch;
inc(j);
inc(i);
ch := pref[j];
end;
output[i] := '.';
inc(i);
j := 0;
ch := suff[0];
while ch <> 0 do
begin
if ch = 32 then
ch := 48;
output[i] := ch;
inc(j);
inc(i);
ch := suff[j];
end;
output[i] := 0;
end;
procedure showData;
begin
data := data / 3.0;
FloatToStr2(data,Txt);
Glcd_Write_Text(Txt,1,1,1);
end;
begin
//Glcd_Init(PORTD, 2, 3, 4, 5, 7, 6, PORTA);
Glcd_Init(PORTE, 2, 3, 4, 5, 7, 6, PORTA); // bigavr board (atmega 128)
Glcd_Set_Font(font5x7,5,8,32);
while true do
begin
data:= 1.234;
ShowData;
end;
end.
Testing:
procedure LongIntToStr2(input: LongInt; var output: array[12] of char);
GLCD:
1.233990000 - wrong (real)
21474836477 - wrong (longint)
-2147483647 - right (longint)
-2147483647 - wrong (longint)
Changes in LongIntToStr2:
procedure LongIntToStr2(input: LongInt; var output: array[11] of char);
Then the test was successful (LongIntToStr2).
procedure FloatToStr2(input: real; var output: array[23] of char);
E-4 Error in ASM code: Address is out of range "33"
E-4 Error because of delay_ms(2000);
Test failed (FloatToStr2).
procedure LongIntToStr2(input: LongInt; var output: array[12] of char);
Code: Select all
//...
while true do
begin
data:= 1.234;
FloatToStr2(data,Txt);
Glcd_Write_Text(Txt,1,1,1);
data1:= 2147483647;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,2,1);
data1:= -2147483647;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,3,1);
data1:= -214748364;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,4,1);
end;
//...
1.233990000 - wrong (real)
21474836477 - wrong (longint)
-2147483647 - right (longint)
-2147483647 - wrong (longint)
Changes in LongIntToStr2:
procedure LongIntToStr2(input: LongInt; var output: array[11] of char);
Code: Select all
// 12345678901
output := ' ';
Then the test was successful (LongIntToStr2).
procedure FloatToStr2(input: real; var output: array[23] of char);
Code: Select all
//...
while true do
begin
data:= 1.2358;
FloatToStr2(data,Txt);
Glcd_Write_Text(Txt,1,1,1);
delay_ms(2000);
data:= 1.2356;
FloatToStr2(data,Txt);
Glcd_Write_Text(Txt,1,1,1);
delay_ms(2000);
data1:= 2147483647;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,2,1);
data1:= -2147483647;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,3,1);
data1:= -214748364;
LongIntToStr2(data1,Txt1);
Glcd_Write_Text(Txt1,1,4,1);
end;
//...
E-4 Error because of delay_ms(2000);
Test failed (FloatToStr2).