-1

I need to write a code for raising x to the power of y in Marie.js. That's what I have for now, however it spits out an error SyntaxError:L41 - Unknown label Loop.

Input 
Subt One
Store Count

Input 
Store x
Store y
Jns Exp


Load Wyn
Output 
End, Halt

Exp, Hex 0
Loop2, Load Count
    Skipcond 800
    JumpI Exp
    JnS Multi
    Load Wyn
    Store x
    Load Count
    Subt One
    Store Count
    Jump Loop2


Multi, Hex 0
    Load Zero
    Store Wyn
    Loop, Load x
    Skipcond 800
    JumpI Multi
    Load Wyn
    Add y
    Store Wyn
    Load x
    Subt One
    Store x
    Jump Loop


x, Dec 2
y, Dec 3
Zero, Dec 0
One, Dec 1 
Wyn, Dec 0 
Count, Dec 0

I understand the necessity for 2 loops, which execute y-1 times, however Im completely clueless what I'm doing wrong.

RoyBatty
  • 1
  • 2
  • Does this answer your question? [How do I raise a number x to the power y in MARIE?](https://stackoverflow.com/questions/58636468/how-do-i-raise-a-number-x-to-the-power-y-in-marie) – D. Pardal Jun 02 '20 at 14:13
  • Not exactly, actually I used the code inside that post but to no avail. – RoyBatty Jun 02 '20 at 14:15

1 Answers1

0

You have to define a label before you can Jump to it; you have not defined the label Loop. You have defined a label named Loop2.

Scott Hunter
  • 48,888
  • 12
  • 60
  • 101