You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: