Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinite loop on my code #59

Open
cupcakesprinles opened this issue Jan 3, 2024 · 0 comments
Open

infinite loop on my code #59

cupcakesprinles opened this issue Jan 3, 2024 · 0 comments

Comments

@cupcakesprinles
Copy link

I've been working on a school project for my computer architecture class where we have to write an assembly code in 8085 that computes the power of a number B by a number C. To be honest, we don't reaaally know what we are doing since it's our first time having any contact with Assmebly... in a few days we will have to hand in our projects, but we ran it on this site and it says we have an INFINITE LOOP! If somebody could tell me how to fix the issue with the code we would REALLY appreciate it!! Thank you very much and have a nice day :)

note: the register 00E0 is where we store the value of C, and the register 00E1 is where we store the value of B

;

jmp start

;data

;code

start: nop

LDA 00E0
MOV C, A
MVI A, 00
CMP C
JZ 0028
LDA 00E1
MOV B, A
MVI A, 00
CMP B
JZ 002D
MVI HL, 01

MOV E, B
MVI A, 00

ADD D
JC 002D
DCR E
JNZ 0019
MOV D, A
DCR C
JNZ 0016
MOV A, D

HLT

MVI A, 01
JMP 0027

MVI A, 00
JMP 0027

HLT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant