Comparison failure at line 2 in testing StackTest.asm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Comparison failure at line 2 in testing StackTest.asm

hemasaad
I passed all tests and stuck at this test "StackTest.asm" and get this error "Comparison failure at line 2".
this test based on (gt, lt, eq, neg, not). And I see that I implement them right. sudocode of eq.asm
-  sp--;  D=*sp;  sp--;  D = *sp-D;
- if D == 0  them *sp = -1
- else *sp =0
- sp++
can anyone see my equivalence asm code of (eq, gt, lt) they are almost the same.It will be a great help.
Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 2 in testing StackTest.asm

cadet1620
Administrator
I don't see a problem with your 'eq' pseudocode.

Easiest way for me to look at your problem is if you will email me your StackTest.asm.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Comparison failure at line 2 in testing StackTest.asm

hemasaad
Thank you cadet1620, after following the behavior of the execution of the TestStack.asm in the cpuemulator i discovered that all labels of  (gt, lt, eq).asm are has the same name and that results in incorrect resuts. so I started to index them and TestSatck.asm passed the test.