binary in pascal

hi,

can i write binary numbers in pascal like
hex numbers which r written with the '$'- sign?
(without inline- assembly).

Comments

  • : hi,
    :
    : can i write binary numbers in pascal like
    : hex numbers which r written with the '$'- sign?
    : (without inline- assembly).
    :

    Of course you can... but can you explain a bit more
    what exatly you want to do? In program you can use
    any form. Form $XXXX works all the time while
    XXXXh is not always accepted (for example in PORT instr.).


    Example:

    [code]
    var i:integer

    begin
    i:=15; writeln(i);
    i:=$000F; writeln(i);
    i:=000Fh; writeln(i);
    end;
    [/code]


    Above example will display always decimal value. If you want
    to DISPLAY hexadecimal number, you need to convert it.
    Check this message board. There are plenty code
    samples that do just that.


    Iby




  • sorry, u misunderstood me, but its my fault.

    i mean something like:

    [code]
    I := 10011100b
    [/code]

    the constant should be written in binary.
    the line above doesn't work.



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories