02-21-2012 11:19 AM
When I simulate the 8051 code below in Multisim 11.0.1, the machine-cycle count, as registered in TL0, does not increment correctly. Specifically, on some passes of the LOOP iteration, the instruction MOV P1,#00h, causes a machine-cycle count increase of 2 (which is correct) but on other passes of the same instruction the machine-cycle count (TL0) only increments by 1 (incorrect). The timing signal associated with P1, on execution of the same offending instruction, simulates the correct timing (every time) that would be expected for a 2-cycle instruction. I have simulated the same code in other simulators and the machine-cycle count (as registered in TL0) increments correctly with no problems. Am I missing something or is this a bug in Multisim? Any help greatly appreciated, thanks.
$MOD51 ; This includes 8051 definitions for the Metalink assembler
; Please insert your code here.
MOV TMOD,#01h;16-bit count mode for timer 0 (TL0, TH0)
SETB TR0 ;enable the count
MOV P1,#00h
MOV R1,#0Ah
LOOP:
INC R0
MOV P1,#0FFh
MOV P1,#00h;this instruction, sometimes, increments the machine-cycle count incorrectly on some passes of LOOP!!
DJNZ R1,LOOP
JMP $
END
02-29-2012 09:12 AM
This issue has been identified as a bug and will be investigated for fixing in the next version of Multisim.
Kind Regards,