flat assembler
Message board for the users of flat assembler.

 Index > Main > What does 0x123 mean?
Author
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!
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!
23 Nov 2004, 16:40
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
23 Nov 2004, 17:48
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???
24 Dec 2004, 15:23
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
24 Dec 2004, 15:58
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?
25 Dec 2004, 20:08
MCD

Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 25 Dec 2004, 20:11
yes
25 Dec 2004, 20:11
gumletis

Joined: 18 Dec 2004
Posts: 128
gumletis 29 Dec 2004, 10:26
say nothing... www.asciitable.com...
29 Dec 2004, 10:26
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

128
32
2
1
=
163

- Diode

_________________
Mac for productivity. Unix for development. Windows for solitaire.
05 Jan 2005, 05:24
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
05 Jan 2005, 17:20
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?
19 Jan 2005, 01:29
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum