Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Calling Assembly #139

Description

@RossComputerGuy

I'm trying to execute assembly and I'm having a problem figuring out how to impliment this system call in the NativesObject class. Does anyone know the best way? I think that if I have an enum that has all of the assembly opcodes that I could store them inside of a map so when someone executes the function it would read the map and execute the opcode.

Current Code:

NATIVE_FUNCTION(NativesObject,Assembly) {
  USEARG(0);
  char* cmd = (arg0.As<v8::String>())->Value();
  if(strcmp(cmd,"cli") == 0) {
   asm volatile ("cli");
  } else if(strcmp(cmd,"sti") == 0) {
   asm volatile ("sti");
  } else if(strcmp(cmd,"hlt") == 0) {
   asm volatile ("hlt");
  } else {
   args.GetReturnValue().Set(v8::Boolean::New(iv8,false));
  }
  args.GetReturnValue().Set(v8::Boolean::New(iv8,true));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions