Solved

help on assembly language

Posted on 1998-10-31
1
158 Views
Last Modified: 2010-04-27

   Hi there,

        I need ur answer for these questions.

         Why does -32,768 an issue? and
           why does it work anyway?
0
Comment
Question by:nirvani
1 Comment
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 1011984
I don't really understand what your question is.

-32,768 is 8000H. This is the largest negative number. CPUs generally represent signed integers in "two's complement" notation. The MSB represents the sign and the remaining bits represent the value.

Two's complement is acheived by negating the value and adding 1. This helps in doing binary math.

0000H = 0
0001H = 1
.
7FFFH = 32,767
8000H = -32,768
8001H = -32,767
.
FFFFH = -1

If you want the absolute value of the negative number simply complement and add 1. Thus
FFFFH = -1

Complement of FFFFH = 0000H
0000H + 1 = 0001H

To make a positive number negative we repeat the process:

Complement of 0001H = FFFEH
FFFEH + 1 = FFFFH

Makes life simple at the electrical level inside the CPU.

This is much less obvious when you're dealing with the decimal equivalents, makes perfect sense at the hex/binary level.

M

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

In this article you will get to know about pros and cons of storage drives HDD, SSD and SSHD.
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now