Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

help on assembly language

Posted on 1998-10-31
1
Medium Priority
?
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
mark2150 earned 150 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

Introducing the WatchGuard 420 Access Point

WatchGuard's newest access point includes an 802.11ac Wave 2 chipset, providing the fastest speeds for VoIP, video and music streaming, and large data file transfers. Additionally, enjoy the benefits of strong security as the 3rd radio delivers dedicated WIPS protection!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

730 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