Solved

# help on assembly language

Posted on 1998-10-31
158 Views

Hi there,

I need ur answer for these questions.

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

LVL 12

Accepted Solution

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

### 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.