VM program with calls to OS facilities constantly halts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

VM program with calls to OS facilities constantly halts

Acsor
Morning everyone, I'm tasked to write some VM (non Jack) programs that make use of arbitrary sets of the OS functions.

My first attempt has been developing a program that prints an X centered on screen that gets expanded when the user presses the '+' button and shrunk when they press '-'. The logic seems to be working fine, but when hitting on the Keyboard.readChar or Keyboard.keyPressed functions the VM emulator kind of stops the execution flow. I need to halt and click the fast-forward button to have it run another cycle of my program.

I'm leaving the VM code of my program attached, can any of you suggest what is going wrong? Also its setup consists of all the other OS files (Array.vm, Keyboard.vm, ...) being included in the same Cross/ directory.
Reply | Threaded
Open this post in threaded view
|

Re: VM program with calls to OS facilities constantly halts

Acsor
I've made some small changes to the attachment, removing reminiscences from old edits, including code commented out and instructions that I'd tested out. Quite unexpectedly, the program seems to be working better now, but now quite as good as I'd expect.