Jump to content
IGNORED

question on assembler notation found in Yar's revenge


Recommended Posts

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

Link to comment
Share on other sites

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 by vdub_bobby
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...