1
REFREF
Nunuhara Cabbage edited this page 2019-11-05 18:23:26 -08:00

REFREF

Instruction Arguments

None.

Stack Arguments

int32 pageno - The id of the page containing the reference variable
int32 varno - The index of the variable within the page

Description

Push the value of a reference variable onto the stack.

Example

PUSHLOCALPAGE ; stack: [pageno]
PUSH 0x0      ; stack: [pageno, 0]
REFREF        ; stack: [v], where v is the value referenced by localpage[0]

This is equivalent to the following,

PUSHLOCALPAGE ; stack: [ref_pageno]
PUSH 0x0      ; stack: [ref_pageno, 0]
REF           ; stack: [var_pageno]
PUSHLOCALPAGE ; stack: [var_pageno, ref_pageno]
PUSH 0x1      ; stack: [var_pageno, ref_pageno, 1]
REF           ; stack: [var_pageno, varno]
REF           ; stack: [v], where v is the value referenced by localpage[0]