Latest Uploads
Super Shap ... ration Kit

Andy_A

Platdude Spotting

Jayenkai

Nom nom nom

Jayenkai

Rainbow Trout

Pakz

King Salmon

Pakz

Snooker

Jayenkai

Showcase > Apps and Utilities ( Created 29 June 2010 | Last Edited 30 June 2010)

Virtual Machine + Assembler - Created by HoboBen (No Votes)

An open source Virtual Machine and Assembler for the Cobra programming language.
Created using Cobra > WindowsView Worklog (0 entries)
1.6mb zip
VM Updates
The imaginatively named "vm" Virtual Machine is a typeless, procedural VM, with native support for functions and strings. Use the "vmAsm" assembler to assemble programs into a vmx (VM eXecutable) binary file that vm can run.

This program is open source - see license-vm.txt and license-vmAsm.txt for licensing details.

Contains an example front-end with an example script ready-to-run!
Highslide JS

Latest Comments

Posted : Friday, 02 July 2010, 10:11
HoboBen


Bugs & fixes:

Fixed a bug where global arrays were accessed in the wrong direction (local ones were working). Here's the fix - replace the Vm_ResolveOpStackIndex function in vm.cps (line 300) with the following:

-->

Additionally, HAPI funcs were buggy. Fix Vm_GetHapiFunc in vm.cps (line 456):
-->

At approx line 1200, these instructions also need fixing:
-->

Unfixed: Assembly scripts will not work properly if a function has both local variables (var) AND parameters (param). Either on its own will work. Workaround: use global variables for some function vars or params.

Posted : Monday, 05 July 2010, 17:32
HoboBen


Working pacman example:

Highslide JS

Download (ready-to-run!) ~1.5 MB

The example is over 1000 lines of assembly and took four days. You'd be mad to actually use the VM this way, but as a "proof of concept" it's pretty good.

Host API functions:

; HapiDrawCell (x, y, cellState)
; HapiCreateSprite(), returns index
; HapiPositionSprite(index, x, y)
; HapiSetSpriteFrame(index, frame)
; HapiFreeSprite(index)
; HapiGetDelta(), returns delta as real
; HapiRnd(), returns random number between 0 and 1
; HapiGetTicks(), returns ticks as integer
; HapiKeyDown(key), returns 0 (false) or 1 (true)
; HapiDisplayStats(score, eaten)

-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 732|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Steve's Car Buying Disaster
steve_ancell Wed 14:32
New Pound Coin
Jayenkai Tue 14:45
Homefries
steve_ancell Tue 01:47
Jeremy Bloody Kyle
steve_ancell Mon 09:45
GamerBlock
Jayenkai Mon 09:06
Laptop Aaargh...
Jayenkai Mon 07:06
Changing Thumbnail Sizes
Jayenkai Mon 05:27
Technology on Planes
therevillsgames Sat 17:00
London Car/Stab Incident
steve_ancell Sat 12:10
A New Korg Gadget!
Jayenkai Sat 04:53
More

Latest Items
Dev-Diary : Sensitive - Arduboy!
Jayenkai Thu 05:03
Link : Super Shapes Exploration Kit
Andy_A Tue 16:56
Snippet : Skylines
steve_ancell Tue 14:25
Blog : My Arduino experience.
steve_ancell Fri 13:45
Showcase : Infinitron
rychan Tue 03:02
Dev-Diary : PS2 to N64 Adapter
spinal Sun 10:49
Link : Vector Tutorials/Help page.
Pakz Thu 23:00
Blog : mini project
spinal Sun 10:13
Showcase : Blockman Returns
Jayenkai Fri 03:04
Snippet : Wall Tracing on Random Maps (rpg)
rskgames Wed 22:48
Snippet : Path Following
Pakz Mon 16:25
Snippet : Flowers (Jan 2017)
Kuron Thu 01:13
Showcase : Clusters of Hex
therevillsgames Mon 15:01
Article : Maths 101 - Episode 1: Basic Trigonometry
shroom_monk Sun 14:07
Article : Maths 101 - Episode 5: Line Intersection
shroom_monk Sun 14:02
More

Who's Online
Pakz
Thu, at 12:33
Jayenkai
Thu, at 12:32
spinal
Thu, at 12:20
Andy_A
Thu, at 09:58
rychan
Thu, at 09:56
rockford
Thu, at 07:45
steve_ancell
Thu, at 03:36
rskgames
Thu, at 03:09
Evil Roy Ferguson
Wed, at 19:54
9572AD
Wed, at 17:27
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.