Parameter CardValue in function M3() is not passed to function DisplayValue(). Parameter CardValue is intended to be passed via dph and dpl. dph gets loaded from r6 and dpl gets loaded from r5, but r5 and r6 are never accessed or assigned in M3() or anywhere else throughout the program:
mov dpl,r5 ;r5 not assigned anywhere!!!
mov dph,r6 ;r6 not assigned anywhere!!!
It is really a strange bug because it happens in the given constellation only. It disappears if:
- parameter 'n' is removed from M3()
- function call z() is removed from M3()
- first actual parameter of z() is changed to 0 z(0, 0) in M3()
- parameter 'Value' of DisplayValue() is changed from 'unsigned int' to 'int'
I could not simplify the program further without loosing the bug.
For more information see attached file.
Command to compile:
SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.7.4 #4972 (Nov 23 2007) (MINGW32)
Microsoft Windows XP [Version 5.1.2600]
Log in to post a comment.