gson@niksula.hut.fi (Andreas Gustafsson) (11/15/90)
In article <0471181703FF001A65@gacvx2.gac.edu> CW%APG.PH.UCL.AC.UK@pucc.PRINCETON.EDU writes: > i) I find moving the sprite to the left is quite difficult > since there is no equivalent instruction to Vx=Vx-KK only > Vx=Vx+KK. Am I missing something fundamental? Does anyone have > a nice little routine or algorhythm (spelling?) to explain > a simple way to do it. Yes, you are missing something fundamental. Because all arithmetic in CHIP-8 is done modulo 256, you can subtract a constant simply by adding the two's complement of that constant. For instance, the instruction 7AFF will subtract one from VA. > ii) Can the string that contains the game be any length, or is > it REALLY limited to 4K. Three and a half, actually, because the addresses 000-1FF are reserved. But CHIP-8 code is very compact, so you can do quite a lot in 3.5 k. You should remember that CHIP-8 was originally designed in the late seventies, to run on machines that seldom had more that one or two k of memory. -- Andreas Gustafsson Internet: gson@niksula.hut.fi Voice: +358 0 563 5592