1
SR_ASSIGN
Nunuhara Cabbage edited this page 2022-06-30 14:30:18 -07:00

SR_ASSIGN

Instruction Arguments

None.

Stack Arguments

int32 lhs - The left hand side of the assignment (heap index of structure page)
int32 rhs - The right hand side of the assignment (heap index of structure page)
int32 type - The structure type

Description

Copy a structure page into an existing structure page of the same type.

Example

PUSHLOCALPAGE ; stack: [pagno]
PUSH 0x0      ; stack: [pageno, 0]
REF           ; stack: [struct1] where struct1 is the structure page at localpage[0]
PUSHLOCALPAGE ; stack: [struct1, pageno]
PUSH 0x1      ; stack: [struct1, pageno, 1]
REF           ; stack: [struct1, struct2] where struct2 is the structure page at localpage[1]
PUSH 0x4      ; stack: [struct1, struct2, 4] where 4 is the structure type of both struct1 and struct2
SR_ASSGIN     ; stack: [struct2] and struct1 is now a copy of struct2