Pong Test - 'That' segment error

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

Pong Test - 'That' segment error

thecoolio1
Can anyone help me understand what I'm doing wrong. When I run the pong test all of my OS jack files work except for the Screen.jack and Math.jack. When I run the pong test with them in the folder I get the following error:

'That' segment must be in the Heap or Screen range in Math.init.38

So I tried taking the Math.vm out of the folder and ran the pong test, and got the following error:

'That' segment must be in the Heap or Screen range in Screen.init.43

When I removed the Screen.vm from the folder and ran the pong test again it worked.

Any help would be greatly appreciated.

Thanks,

Jason
Reply | Threaded
Open this post in threaded view
|

Re: Pong Test - 'That' segment error

cadet1620
Administrator
Are you using your compiler or the supplied compiler? If you are using the supplied compiler, the only thing that its generated code uses that for is array references. You likely have a bad Array base pointer.

Does it fail if you use the supplied Screen and Math VM files instead of just deleting yours?

There is dependency between the various OS modules. For instance the supplied Screen.vm and Math.vm use Arrays, and Array.vm uses Memory.alloc. Therefore, Sys.vm must call Memory.init() before calling either Screen.init() or Math.init(). I suspect that the built-in system functions don't mimic this dependency.

Your dependencies may not be the same as the supplied OS modules'. Therefore, your Sys.vm may not be interchangeable with the supplied Sys.vm.

If you can't get anywhere, feel free to email me your OS sources and I'll take a look at them. I should have time over the Thanksgiving weekend.

--Mark