Skip to content

Commit

Permalink
ACTIONSCRIPT: Implement actionGreater opcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nostritius authored and DrMcCoy committed Jul 7, 2019
1 parent e0a4375 commit 324ae80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/aurora/actionscript/asbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ enum Opcodes {
kActionCallMethod = 0x52,
kActionEnumerate2 = 0x55,
kActionStrictEquals = 0x66,
kActionGreater = 0x67,
kActionExtends = 0x69,
kActionGetURL = 0x83,
kActionStoreRegister = 0x87,
Expand Down Expand Up @@ -141,6 +142,7 @@ void ASBuffer::execute(AVM &avm) {
case kActionIncrement: actionIncrement(); break;
case kActionCallMethod: actionCallMethod(avm); break;
case kActionEnumerate2: actionEnumerate2(); break;
case kActionGreater: actionGreater(); break;
case kActionExtends: actionExtends(); break;
case kActionGetURL: actionGetURL(avm); break;
case kActionStoreRegister: actionStoreRegister(avm); break;
Expand Down Expand Up @@ -526,6 +528,17 @@ void ASBuffer::actionEnumerate2() {
debugC(kDebugActionScript, 1, "actionEnumerate2");
}

void ASBuffer::actionGreater() {
const Variable &a = _stack.top();
_stack.pop();
const Variable &b = _stack.top();
_stack.pop();

_stack.push(a < b);

debugC(kDebugActionScript, 1, "actionGreater");
}

void ASBuffer::actionExtends() {
ObjectPtr superClass = _stack.top().asObject();
_stack.pop();
Expand Down
1 change: 1 addition & 0 deletions src/aurora/actionscript/asbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class ASBuffer {
void actionIncrement();
void actionCallMethod(AVM &avm);
void actionEnumerate2();
void actionGreater();
void actionExtends();
void actionGetURL(AVM &avm);
void actionStoreRegister(AVM &avm);
Expand Down

0 comments on commit 324ae80

Please sign in to comment.