Check if you are using ASC2.0
compiler.
Fast memory opcode is a part of ASC2.0
compiler and is not a part of the AIR SDK
. Depending on which IDE you are using, avm2.intrinsics.memory
opcode methods might show unresolved error
on the code editor, but it will build fine with ASC2.0
compiler.
The following code is tested with AIR SDK 27
in intelliJ IDEA
.
package {
import flash.display.Sprite;
import avm2.intrinsics.memory.sf64;
import avm2.intrinsics.memory.lf64;
import flash.system.ApplicationDomain;
import flash.utils.ByteArray;
import flash.utils.Endian;
public class FastMemTest extends Sprite {
public function FastMemTest() {
var ba:ByteArray = new ByteArray();
ba.length = ApplicationDomain.MIN_DOMAIN_MEMORY_LENGTH;
ba.endian = Endian.LITTLE_ENDIAN;
ApplicationDomain.currentDomain.domainMemory = ba;
const addr:int = 0xf0;
const value:int = 1234;
sf64(1234, value);
trace(value.toString(16), ':', lf64(value));
}
}
}
trace output:
"C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.1\jre64\bin\java.exe" "-Dapplication.home=C:\FlexSDK\AIRSDK_Compiler_27.0.0.132" -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -classpath "C:/FlexSDK/AIRSDK_Compiler_27.0.0.132/lib/legacy/fdb.jar" flex.tools.debugger.cli.DebugCLI
Adobe fdb (Flash Player Debugger) [build development]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
Waiting for Player to connect
"C:\FlexSDK\AIRSDK_Compiler_27.0.0.132\bin\adl.exe" -profile extendedDesktop C:\test\Stage3DTest-app.xml C:\test
Player connected; session starting.
[trace] f0 : 1234