## #13 Compare-Problems MCS51

closed
None
5
2003-05-09
2002-10-31
Anonymous
No

Hallo i have some problems with compare-function:
i have by all Compares a wrong function.
Please can you tell me what is the problem.
Is it a installation error or ..
I have compiled this example without any
optimization, because the =
result is the same as with optim.

EXAMPLE:
if (counter =3D=3D 200)

{IEN0 =3D 0x01A; =20

if (counter !=3D 200)
{IEN1 =3D 0x003; } =20

if (counter &lt; 200)
{TCON =3D 0x000; } // TF1,*TR1,TF0,*TR0 ,
IE1,IT1,IE0,IT0 ;ohne =
Bedeutung

RESULT:
1301 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 577
02CA 90s13r73 1302 mov
dptr,#_Init_counter_1_1
02CD E0 1303 movx a,@dptr
02CE FA 1304 mov r2,a
02CF EA 1305 mov a,r2
02D0 33 1306 rlc a
02D1 95 E0 1307 subb a,acc
02D3 FB 1308 mov r3,a
02D4 BA C8 05 1309 cjne r2,#0xC8,00116
\$
02D7 BB 00 02 1310 cjne r3,#0x00,00116
\$
02DA 80 03 1311 sjmp 00117\$
02DC 1312 00116\$:
02DC 02s02rE2 1313 ljmp 00102\$
02DF 1314 00117\$:
1315 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 579
02DF 75 A8 1A 1316 mov _IEN0,#0x1A
02E2 1317 00102\$:
1318 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 580
02E2 90s13r73 1319 mov
dptr,#_Init_counter_1_1
02E5 E0 1320 movx a,@dptr
02E6 FA 1321 mov r2,a
02E7 EA 1322 mov a,r2
02E8 33 1323 rlc a
02E9 95 E0 1324 subb a,acc
02EB FB 1325 mov r3,a
02EC BA C8 06 1326 cjne r2,#0xC8,00118
\$
02EF BB 00 03 1327 cjne r3,#0x00,00118\$
02F2 02s02rF8 1328 ljmp 00104\$
02F5 1329 00118\$:
1330 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 581
02F5 75 B8 03 1331 mov _IEN1,#0x03
1333 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 583
02F8 90s13r73 1334 mov
dptr,#_Init_counter_1_1
02FB E0 1335 movx a,@dptr
02FC FA 1336 mov r2,a
02FD EA 1337 mov a,r2
02FE 33 1338 rlc a
02FF 95 E0 1339 subb a,acc
0301 FB 1340 mov r3,a
0302 C3 1341 clr c
0303 EA 1342 mov a,r2
0304 94 C8 1343 subb a,#0xC8
0306 EB 1344 mov a,r3
0307 64 80 1345 xrl a,#0x80
0309 94 80 1346 subb a,#0x80
030B 40 03 1347 jc 00122\$
030D 02s03r13 1348 ljmp 00106\$
0310 1349 00122\$:
1350 ; =
C:\sdcc\projects\CreaTeS\TSV1\TSV1_01.C 584
0310 75 88 00 1351 mov _TCON,#0x00
0313 1352 00106\$:

## Discussion

• Bernhard Held - 2003-05-09
• assigned_to: nobody --> bernhardheld
• status: open --> closed

• Bernhard Held - 2003-05-09

Logged In: YES
user_id=203539

Not reproduceable.