This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[deriving(FromPrimitive)] | |
enum Instruction { | |
INTEGER = 0x00, | |
STRING = 0x01, | |
ADD = 0x02, | |
SHOWINTEGER = 0x0A, | |
SHOWVERSION = 0x0E, | |
EXITVM = 0x0F | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn execute(&mut self, execbyte: u8) -> () { | |
if self.push { | |
self.push(execbyte); | |
self.push=false; | |
}else{ | |
let op: Option<Instruction> = FromPrimitive::from_u8(execbyte); | |
match op{ | |
None => { | |
println!("Unknown instruction, skipping..."); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[deriving(FromPrimitive)] | |
enum Instruction { | |
INTEGER = 0x00, | |
STRING = 0x01, | |
ADD = 0x02, | |
SHOWINTEGER = 0x0A, | |
SHOWVERSION = 0x0E, | |
EXITVM = 0x0F | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn execute(&mut self, execbyte: u8) -> () { | |
if self.push { | |
self.push(execbyte); | |
self.push=false; | |
}else{ | |
let op: Option<Instruction> = FromPrimitive::from_u8(execbyte); | |
match op{ | |
None => { | |
println!("Unknown instruction, skipping..."); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn push(&mut self, value: u8) -> (){ | |
self.stack.push(value); | |
} | |
fn pop(&mut self) -> u8{ | |
let a: Option<u8>=self.stack.pop(); | |
match a{ | |
None => { | |
println!("Failed to pop"); | |
0 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod vm; | |
fn main(){ | |
let bytecode = "\x0E\x00\x02\x00\x03\x02\x0A"; | |
let mut perin = vm::PerinVM::new(); | |
perin.interpreter(bytecode); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author : Hemanth.HM | |
# Email : hemanth[dot]hm[at]gmail[dot]com | |
# License : GNU GPLv3 | |
# | |
function useage() | |
{ | |
cat << EOU | |
Useage: bash $0 <path to the binary> <path to copy the dependencies> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern "C" | |
void ND_Keyboard_Handler(struct regs* r) | |
{ | |
unsigned char scancode = ND::Keyboard::GetChar(); | |
if(scancode!=255) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nsigned char ND::Keyboard::GetChar() | |
{ | |
unsigned char scancode; | |
scancode=(unsigned char)ND::Ports::InputB(0x60); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned char en_US[128]= | |
{ | |
0,27,'1','2','3','4','5','6','7','8','9','0','-','=', '\b', | |
'\t','q','w','e','r','t','y','u','i','o','p','[',']','\n', | |
0, /* Ctrl */ | |
'a','s','d','f','g','h','j','k','l',';', | |
'\'','`',0, /* Left Shift */ | |
'\\','z','x','c','v','b','n','m',',','.','/', 0,/* Right shift */ | |
'*', 0, /* Alt */ | |
' ', |
OlderNewer