flat assembler
Message board for the users of flat assembler.

Index > Main > What does 0x123 mean?

Author
Thread Post new topic Reply to topic
Kristian_



Joined: 13 Nov 2004
Posts: 38
Kristian_ 23 Nov 2004, 16:40
Hello!
I'm sorry! This is one of my stupid questions again! Embarassed
I know what is binary and what is hexdecimal, but in lot of assembler code examples authors use 0x123 instead of a decimal, hexdecimal or binary numbers! What are this 0x* things called? Thank you!
Post 23 Nov 2004, 16:40
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 23 Nov 2004, 17:48
aren't these in Flat Assembler Documentations?

C typed = Pascal = ASM standard
0x123 = $123 = 0123h

0123o is octal
Post 23 Nov 2004, 17:48
View user's profile Send private message Visit poster's website Reply with quote
Kristian_



Joined: 13 Nov 2004
Posts: 38
Kristian_ 24 Dec 2004, 15:23
Thanx, but forexample if I have 0xA3, then it is in decimal 13?, because A = 10? And what does 0x mean???
Post 24 Dec 2004, 15:23
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 24 Dec 2004, 15:58
0xA3
= (3 x 16^0) + (A x 16^1)
= (3 x 1) + (10 x 16)
= 163

0xA34
= (4 x 16^0) + (3 x 16^1) + (A x 16^2)
= (4 x 1) + (3 x 16) + (10 x 256)
= 4 + 48 + 2560
= 2612

"0x" is used as a symbol to treat the particular number as hexadecimal which also mean, based 16 number Smile
Post 24 Dec 2004, 15:58
View user's profile Send private message Visit poster's website Reply with quote
Kristian_



Joined: 13 Nov 2004
Posts: 38
Kristian_ 25 Dec 2004, 20:08
Thank you!
But does 0x13 = 19?

(3x16^0) + (1x16^1) = (3x1)+(1x16) = 19

Is this true?
Post 25 Dec 2004, 20:08
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 25 Dec 2004, 20:11
yes
Post 25 Dec 2004, 20:11
View user's profile Send private message Reply with quote
gumletis



Joined: 18 Dec 2004
Posts: 128
gumletis 29 Dec 2004, 10:26
say nothing... www.asciitable.com... Laughing
Post 29 Dec 2004, 10:26
View user's profile Send private message Reply with quote
Diode



Joined: 04 Jan 2005
Posts: 15
Diode 05 Jan 2005, 05:24
Kristian, if this helps you,

0xA3 is hexadecimal for A = 1010 3 = 0011

1010 0011, appended =

10100011

(From the left) First 1 = 128, second 1 = 32, third 1 = 2, and last 1 = 1

So, add them

128
32
2
1
=
163

- Diode

_________________
Mac for productivity. Unix for development. Windows for solitaire.
Post 05 Jan 2005, 05:24
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 05 Jan 2005, 17:20
try this, it's from my tutorial, you may find something there
http://decard.net/?body=tajga&chapter=chap06
Post 05 Jan 2005, 17:20
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius 19 Jan 2005, 01:29
Yeah, but why convert to binary when you can use

(10 * 16^1) + (3 * 16^0) ;10- that's for the A part of A3

so easily?
Post 19 Jan 2005, 01:29
View user's profile Send private message AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.