+xucaen Posted June 29, 2006 Share Posted June 29, 2006 Hi, I was just looking at the disassembly of Yar's Revenge courtesy of Debro. Around line 3248, there is a block of code that controls the swirl motion. The code uses the character "|". Now, I know in C and in C++ this is a bit operator for OR. How is it being used here? I did searches in my 6502 documents and couldn't find any reference to it. SwirlMotionTable IF COMPILE_VERSION = NTSC .byte HMOVE_0 | 10 .byte HMOVE_L2 | 11 .byte HMOVE_L3 | 13 .byte HMOVE_L5 | 14 .byte HMOVE_L6 | 0 .byte HMOVE_L5 | 2 .byte HMOVE_L3 | 3 .byte HMOVE_L2 | 5 .byte HMOVE_0 | 6 ELSE .byte HMOVE_0 | 9 .byte HMOVE_L3 | 10 .byte HMOVE_L4 | 12 .byte HMOVE_L6 | 13 .byte HMOVE_L7 | 0 .byte HMOVE_L6 | 3 .byte HMOVE_L4 | 4 .byte HMOVE_L3 | 6 .byte HMOVE_0 | 7 ENDIF Quote Link to comment Share on other sites More sharing options...
djmips Posted June 29, 2006 Share Posted June 29, 2006 (edited) Yup, you are correct. It's bitwise OR. For example. Referencing the source you are talking about HMOVE_0 = $70 So .byte HMOVE_0 | 10 would generate $7A (since 10 = $0A) Edited June 29, 2006 by djmips Quote Link to comment Share on other sites More sharing options...
vdub_bobby Posted June 29, 2006 Share Posted June 29, 2006 (edited) I did searches in my 6502 documents and couldn't find any reference to it. That's because it is pseudo-code for the assembler, not code for the 6502, so you'll want to look at the docs for the assembler - DASM, almost certainly. I.e., this: lda #($10|$01) Will be assembled as: lda #$11 For that reason, you can't bitwise OR two variables. Edited June 29, 2006 by vdub_bobby 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.