Re: A85: Pixel mover


[Prev][Next][Index][Thread]

Re: A85: Pixel mover



The calc will always add the two numbers when you do an add. So add a,$B9
adds $B9 to a.

In 2's complement the numbers are encode in a way which makes the calc
give
the right result even when you use numbers <0 (if you do not look at the
carry flag) An exampel

$B9  | 1011 1001 ||  -$47
+
$52  | 0101 0010 ||  +$52
-----------------------------------
$10B| 1 0000 1011 ||  $B

(bit number 8 is the carry flag.) If you think as the number as 2's
complement you get the result to the right, otherwise you get the result
to
the left. So the only differnce is how you look at the numbers.

Dines
-----Original Message-----
From: Erik L Gillespie <egillespie@juno.com>
To: assembly-85@lists.ticalc.org <assembly-85@lists.ticalc.org>
Cc: assembly-85@lists.ticalc.org <assembly-85@lists.ticalc.org>
Date: 12. november 1997 03:34
Subject: Re: A85: Pixel mover


>ok, i understand why it subtracts 7 from a but how does the calculator
>know when you want to subtract and when you want to add?  for instance
>would this statement:
>
>add a, $B3
>
>add 179 to a or would it subtract 77 from a?
>(might not be the right #s but i think you get the idea)
>
>Wyrmlord
>egillespie@juno.com
>


_______________________________________

Dines Justesen
Email: dines@post1.com or
       c958362@student.dtu.dk
WWW  : http://www.gbar.dtu.dk/~c958362/
_______________________________________


Follow-Ups: