News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

two complement notation

Started by Xor Stance, July 06, 2005, 02:22:11 AM

Previous topic - Next topic

Xor Stance

Sorry, I had being stubborn wasting time and I admit that I just pass read it to chapter about the hardware and now again I read it and I understand.

$8000 is negative because the H.O. bit is one.

$100 is positive because the H.O. bit is zero.

$7FFF is positive.

$FFFF is negative.

$FFF is positive

I don't understand, my calculator doesn't work to pass back to binary. But, if the bits are from the right or left?

0111  if this one should I invert?
1000
1001

EDIT: how do you find the hexadecimal operation the bits?

Sevag.K

Attached is a program that'll give you a visual representation of bits using hex, signed and unsigned decimal notations.
It also allows you to see how some CPU instructions affect the flag bits.



[attachment deleted by admin]

Xor Stance


Safena


frtrnr

Quote from: Sevag.K on July 06, 2005, 03:34:49 AM
Attached is a program that'll give you a visual representation of bits using hex, signed and unsigned decimal notations.
It also allows you to see how some CPU instructions affect the flag bits.


I try this code in HIDE1.3.102, first it update the project and the "old_cCalc.hpr" is saved.
While I compile it, it throw out the error:  maybe GetDlgItemText undefined at here:
    w.GetDlgItemText(hwin,ED_INPUT,&buffer,@size(buffer));
  Then I use a full-text search tool, and found maybe I should use GetDlgItemTextA instead of GetDlgItemText so that here I change it to :
     w.GetDlgItemTextA(hwin,ED_INPUT,&buffer,@size(buffer));  // ok, this passed!

Now the another error is thrown out, HIDE says:
Error in file "src\cCalc.hla" at line 475 [errid:63569/hlaparse.bsn]:
Expected ':', encountered '('
(Possible undefined ID '.strTod').

ValidateInput::
mov(false,error_mode);
pat.match(bufstr);
_if(input_mode = MODE_HEX)
// valid hexadecimal?
pat.oneOrMoreCset( { 'a'..'f', 'A'..'F','0'..'9','_'} );
pat.EOS();
try
conv.strTod(bufstr,0);  ////Line 475
anyexception
mov(true,error_mode);
endtry;

I use the full-text search tool again, but I found

procedure strTod( s:string; index:dword );

exactly in conv.hhf
So please help me out how i can correct this!

Sevag.K


That's an old version.  Fiddle around with this one:



[attachment deleted by admin]