+atari2600land Posted January 31, 2012 Share Posted January 31, 2012 How does one do "if a>#07eh" in assembly? Right now I've got this: movx a,@r0 add a,#07eh ; check right boundary jnz loop_2b Which I'm guessing only checks to see if the sprite is at (and only at) #07eh, but I'd like to check for greater numbers than #07eh as the game progresses and the sprites move faster. Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 31, 2012 Share Posted January 31, 2012 In 6502 you need one of the compared numbers in A. e.g. LDA XPOS CMP #LEFTSIDE BCS NOT_HIT CMP does a subtract without affecting the register. Carry is set if A >= the immediate data or content on memory. Carry clear if A < data. Branches are relative and limited in range. If the range isn't big enough then you can use JMP - but Jump can't have conditions so you typically branch around it on the opposite condition. e.g. LDA XPOS CMP #LEFTSIDE BCC HIT JMP NOT_HIT Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted January 31, 2012 Author Share Posted January 31, 2012 What does the Odyssey2 use? 6502? Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 1, 2012 Share Posted February 1, 2012 Erm... How can you code in assembly language for the Videopac if you don't know what the processor is? Anyways... something like this should work (however I'm not a Videopac programmer) :- add a,#081h ; check right boundary jc BeyondRightBoundary Which will jump to the BeyondRightBoundary label when a >= 0x7F (which is like saying a > 0x7E). You'll need to make reference to chapter 5 in the following document for a list of 8048 opcodes :- http://home.mnet-online.de/al/mcs-48/mcs-48.pdf Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted February 1, 2012 Author Share Posted February 1, 2012 Yeah, I know. I am trying really hard to learn assembly, but it's really hard. And what's even more difficult is that if I decide to do assembly for the Atari 2600, I'd need to learn more assembly! There are still some things I just don't get yet, but I hope to some day make a game that's good for the Videopac (the Odyssey2 here in the US.) Maybe Fatso! will be it... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.