hangs on fedora every time program is compiled

Asked by Souvik Maji

I wanted to compile the following program which computes the factorial of a number stored in 2000h and stores the result in 2001h:
;MAIN
LXI SP,2999H
LXI H,2000H
MOV B,M
CALL FACT
INR L
MOV M,B
RST 1
;FACTORIAL
FACT: MOV A,B
LOOP: DCR A
CPI 01
RZ
CALL MUL
JMP LOOP
RET
;MULTIPLICATION
MUL: MOV C,A
LOOP1: ADD B
DCR C
JNZ LOOP1
MOV B,A
RET
;END

I changed the content of memory address 2000h to 5. If i try only asssemble program, it is assembled correctly, but if execute assembled and loaded program gnusim8085 hangs. Every time with no exception. Is this a bug or I have written something terribly wrong?

Question information

Language:
English Edit question
Status:
Answered
For:
gnusim8085 Edit question
Assignee:
Onkar Shinde Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Onkar Shinde (onkarshinde) said :
#2

Have you tried debugging the program line by line to see if it is going in an infinite loop?

Revision history for this message
Onkar Shinde (onkarshinde) said :
#3

Need information from user.

Revision history for this message
Souvik Maji (souvikmaji94) said :
#4

Yes, The program was going into an infinite loop.

Revision history for this message
Onkar Shinde (onkarshinde) said :
#5

Then that is not the fault of simulator application. :-) You need to correct your program.

Can you help with this problem?

Provide an answer of your own, or ask Souvik Maji for more information if necessary.

To post a message you must log in.