Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

taking it to the next level


  • Please log in to reply
7 replies to this topic

#1 comet@earth

comet@earth

  • Members
  • 170 posts
  • OFFLINE
  •  
  • Local time:04:29 AM

Posted 29 May 2011 - 12:16 PM

Hello everyone
Is there any book you could suggest that explains how a programming language works at the machine level or lower level.
Thank You

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:59 PM

Posted 29 May 2011 - 01:56 PM

I am not sure what you are asking. A program is a program, whether it be in assembly or Ruby. They use a syntax particular to that language, they use available libraries, etc. An 'if' loop does the exact same thing no matter the language. A for loop does the exact same thing no matter the language. I am also confused as to what you mean by 'lower level'. The machine level (hardware level) is as low as you can go.

What is it exactly you want to learn?

#3 markr9

markr9

  • Members
  • 31 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:midwest USA
  • Local time:04:59 PM

Posted 29 May 2011 - 05:38 PM

In simple terms the high level language is compiled to a lower level code which is then executed as the processors machine code. Any book on compilers should have a section on that. I cant recommend one because I last studied in the 1970s ;)

#4 Didier Stevens

Didier Stevens

  • BC Advisor
  • 2,685 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:59 AM

Posted 30 May 2011 - 10:01 AM

Is there any book you could suggest that explains how a programming language works at the machine level or lower level.


Yes, there is the dragon book: https://secure.wikimedia.org/wikipedia/en/wiki/Compilers:_Principles,_Techniques,_and_Tools

But try to get a copy first from a library before you decide to buy it, it might not be what you expect.

Didier Stevens
http://blog.DidierStevens.com
http://DidierStevensLabs.com

SANS ISC Senior Handler
Microsoft MVP 2011-2016 Consumer Security, Windows Insider MVP 2016-2019
MVP_Horizontal_BlueOnly.png

 

If you send me messages, per Bleeping Computer's Forum policy, I will not engage in a conversation, but try to answer your question in the relevant forum post. If you don't want this, don't send me messages.

 

Stevens' law: "As an online security discussion grows longer, the probability of a reference to BadUSB approaches 1.0"


#5 comet@earth

comet@earth
  • Topic Starter

  • Members
  • 170 posts
  • OFFLINE
  •  
  • Local time:04:29 AM

Posted 31 May 2011 - 11:03 PM

What I mean is:float and int are 32 bit in Java.Why is it that float can store larger values than int.At a higher level we can easily answer the question but I want to know what is happening inside the computer.
Thank You

#6 markr9

markr9

  • Members
  • 31 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:midwest USA
  • Local time:04:59 PM

Posted 01 June 2011 - 12:25 AM

At a machine level each processor has an Instruction Set. That determines what it can do, and what data needs to be supplied. The compiler needs to know what Instruction set it is to use so that when you say in a program q = 1+1 the compiler can create a program that says for example , load 1 to register a, load 1 to register b, execute add, then move register c to memory location X.

The compiler generated code for floating point mathematics can be quite complex.

That should all be covered in a book on compilers. Try your library.
A look at an assembly language book might also help.
It really depends on how much depth you want.

#7 Didier Stevens

Didier Stevens

  • BC Advisor
  • 2,685 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:59 AM

Posted 01 June 2011 - 01:42 AM

What I mean is:float and int are 32 bit in Java.Why is it that float can store larger values than int.At a higher level we can easily answer the question but I want to know what is happening inside the computer.
Thank You


Floating numbers are almost always stored with the IEEE 754 standard: https://secure.wikimedia.org/wikipedia/en/wiki/IEEE_754-2008

Didier Stevens
http://blog.DidierStevens.com
http://DidierStevensLabs.com

SANS ISC Senior Handler
Microsoft MVP 2011-2016 Consumer Security, Windows Insider MVP 2016-2019
MVP_Horizontal_BlueOnly.png

 

If you send me messages, per Bleeping Computer's Forum policy, I will not engage in a conversation, but try to answer your question in the relevant forum post. If you don't want this, don't send me messages.

 

Stevens' law: "As an online security discussion grows longer, the probability of a reference to BadUSB approaches 1.0"


#8 Rootkit Hunter

Rootkit Hunter

  • Members
  • 63 posts
  • OFFLINE
  •  
  • Local time:05:59 PM

Posted 03 June 2011 - 09:24 PM

Short answer:

32-bit signed integer values have a range of -(2^31) to (2^32-1), you reserve one bit for the sign and the rest go towards the actual number. This range translates into − 2,147,483,647 to 2,147,483,647, around 2^32.

IEEE 754 Single Precision (32-bit) signed floating point values use one bit to represent the sign, eight bits to represent the exponent, and 23 bits to represent the actual number. So, by strictly looking at the exponent value, you can represent numbers around 2^127.

And in general, if you are interested in assembly programming, there are a number of good books listed on Amazon. My preference would be "The Art of Assembly Language". Good luck.

Edited by Rootkit Hunter, 03 June 2011 - 09:27 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users