logo

Crowdly

  Voici un code IJVM. Quelle valeur (en décimal) est en sommet de pile à la fi...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

 

Voici un code IJVM. Quelle valeur (en décimal) est en sommet de pile à la fin  quand on atteint le  halt?

.main

BIPUSH 0x40

BIPUSH 2

INVOKEVIRTUAL f

halt:

.end-main

 

 

.method f( x )

iload x

ifeq l1

bipush 0x40

iload x

bipush -1

iadd

invokevirtual f

iload x

iadd

ireturn

l1: bipush 1

ireturn

.end-method

 

.main

BIPUSH 0x40

BIPUSH 2

INVOKEVIRTUAL f

OUT

halt

.end-main

.method f( x )

iload x

ifeq l1

bipush 0x40

iload x

bipush -1

iadd

invokevirtual f

iload x

iadd

ireturn

l1: bipush 1

ireturn

.end-method

 

 

0%
0%
0%
0%
0%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on celene.univ-orleans.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!