Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8773365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:16:34+00:00 2026-06-13T18:16:34+00:00

I posted earlier inquiring how to define hex constants for this program, which someone

  • 0

I posted earlier inquiring how to define hex constants for this program, which someone helped me out with, and now I’m trying to figure out if this program is running correctly.

The program is intended to compute the logic expression X’Y + X’Z + YZ and put the result into D0. I need to show the contents of D0 in binary when the program completes. Here’s what I have (alignment got a bit jumbled here, but it’s aligned in the assembler (EASy 68K)):

START:  MOVE    X,D0
    NOT D0
    MOVE    D0,D1
    MOVE    Y,D2
    AND D2,D0
    AND Z,D1
    AND Z,D2
    OR  D1,D0
    OR  D2,D0
EXIT:   BRA EXIT
X:  DC  $000F
Y:  DC  $0033
Z:  DC  $0055

This is what I end up with in the respective data registers:

D0: 00000071
D1: 00000050
D2: 00000011

Ignoring the fact that the result is supposed to be shown in binary…being that this is a logic expression, and I use only AND and OR, shouldn’t the result in D0 be either 1 or 0? Because X, Y, and Z are all non-zero constants, the expression evaluates to 1 (YZ=1)…have I made an error in the program? Or is my understanding off?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:16:35+00:00Added an answer on June 13, 2026 at 6:16 pm

    Logical expressions are executed simultaneously for every bit in the registers.

    In C language e.g. integers 1,2,7 and -12313 are all considered equal in the context of
    if (a)
    printf(“True”);
    else
    printf(“False”);

    And the same applies for
    if (a || b) printf(“a was not zero OR maybe b was not zero OR even both were not zero”);

    But for bitwise logical operations

    00000000001 (binary) == 1 in decimal  
    00000000010 (binary) == 2 in decimal  
    ------------------------------------  
    00000000011 = 1 OR 2 == 3 in decimal
    00000000000 = 1 AND 2 == 0 in decimal
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a related question to one I posted earlier... I'm trying to sum
I posted this earlier on wordpress.stackexchange.com. However, never got a reply. Hence, trying my
This simple problem is kiling me. I posted something earlier about trying to clean
This is the super simple version of the question I posted earlier (Which I
This is a related question to one I posted earlier today, I was initially
I had posted this earlier on Stack Overflow, but couldn't get a positive result.
Sorry guys, I posted this earlier today where my add as linked images were
I need to find the maximum route of a triangle. I earlier posted this
I posted a question earlier about stopping all sounds in a swf. Now, to
I'm working from a question I posted earlier ( here ), and trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.