Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 23rd, 2009, 10:23 PM   #11
zhode
Newbie
 
Join Date: Nov 2009
Posts: 20
Rep Power: 0 zhode is on a distinguished road
Re: Assemblers, Opcodes, Binary...

I know that its just an assembler but each one has different functions in it's library (or whatever its called in assembly :p). Also it's just in my opinion but yeah c can do a lot besides it's still fun just learning how the system works. I could have sworn I read that one to one thing somewhere not quite sure where though.
__________________
I code in C and can code in BASIC but dislike the language for some reason. I'm also starting assembly can't code it yet though.
zhode is offline   Reply With Quote
Old Nov 25th, 2009, 2:29 PM   #12
null_ptr0
Young programmer
 
Join Date: Nov 2007
Posts: 139
Rep Power: 0 null_ptr0 is an unknown quantity at this point
Re: Assemblers, Opcodes, Binary...

Quote:
Originally Posted by Sane View Post
I would recommend writing an assembler for a subset of "MIPS Assembly" to "MIPS Machine Code".

Reference Sheet: http://www.student.cs.uwaterloo.ca/~...ps/mipsref.pdf
Description of MIPS Assembly: http://www.student.cs.uwaterloo.ca/~...s/mipsasm.html

You could write the entire Assembler by reading these two reference sheets. You will not have to write 1000 lines of source code, but you should still learn just as much.

Assemblers are not complicated programs, unless you are trying to be historically accurate by writing one in Machine Code. All an Assembler does is convert humanly recognizable commands to a binary equivalent, and a few other niceties (labels, range checking, remove comments). Good luck.
If you follow this path, ask to use his ^^ lexer.
null_ptr0 is offline   Reply With Quote
Old Dec 2nd, 2009, 7:04 PM   #13
wiseguy12851
Newbie
 
Join Date: Nov 2009
Posts: 2
Rep Power: 0 wiseguy12851 is on a distinguished road
Re: Assemblers, Opcodes, Binary...

All languages branch off of assembly, I hated MASM because it only specialized in Windows Assembly (AKA Windows API) which is not real assembly. Like I said earlier you can write in binary, hex or assembly. Every program on any electronic device with a computer chip (computer or console) uses Binary, Hex, and Assembly as there all the same thing just different ways of viewing the code.

Assembly (Binary, Hex) has total control over the computer (AKA through the processor built-in commands). If you even understand the basics of assembly you can write programs for anything electronic like an arcade system, a computer, or anything else with a processor in it.

Assembly also allows you to open up any computer program on earth and view the machine code in assembly because all programs are compiled to binary and binary is assembly and hex.

So to answer a few other comments:
Search Google for Art of Assembly, they have a book version but also a free version online -- This is one of the best written and completely covers everything you wanted to know about assembly and the computer plus all the ins and outs and every command and how to use it... The website domain ends in .edu -- 16-bit, 32-bit and some 64-bit plus all the machine startup types

I don't recommend assembly unless your planning to write something off of windows and other systems for example -- I wrote a quick code that drew a colorful box at startup burning it to the boot sector of a CD but after that I went straight to programming games for an old handheld device because assembly hardly changes at all between different devices.

If your going to write programs for an existing system like Linux, Windows, MAC, etc... then use one of their languages as your going to have to use their API instead of assembly because it could interfere with the system already in place.

Lastly:
Assembly is very easy to learn. I learned assembly in 2 weeks but it's taking me months to learn c++ and I'm just now getting to the end. So by the time I have gotten this far with c++ I had already written several assembly language programs, some which cracked funny jokes at startup, drew pictures, and even a micro-operating system.

The only reason people say assembly is hard is because they're reading poor documentation and get panicked at the rumors other people spread who are in the same situation.
wiseguy12851 is offline   Reply With Quote
Old Dec 7th, 2009, 8:19 AM   #14
stytwicil
Newbie
 
Join Date: Dec 2009
Posts: 1
Rep Power: 0 stytwicil is on a distinguished road
Re: Assemblers, Opcodes, Binary...

I learned assembly in 2 weeks but it's taking me months to learn c++ and I'm just now getting to the end. So by the time I have gotten this far with c++ I had already written several assembly language programs, some which cracked funny jokes at startup, drew pictures, and even a micro-operating system.
stytwicil is offline   Reply With Quote
Old Jan 13th, 2010, 1:15 AM   #15
GeekyRaptor
Newbie
 
Join Date: Jan 2010
Posts: 1
Rep Power: 0 GeekyRaptor is on a distinguished road
Re: Assemblers, Opcodes, Binary...

Hi, Folks! I have been reading this thread with a lot of interest since it dovetails with something I am working on. I had this bright idea - why don't I, starting with PURE assembly, write my own assembler, then using that write and assemble my own compiler and then using that write my own OS. Yeah, right...that'll take me a couple of million years to do that! But I think that writing an assembler and compiler is achievable if I take help from GCC, NASM or FASM.

I already have the source code of NASM, flex, bison and so on but I am not sure how I should proceed towards the first step- the pristine assembler. My aim, you see, is that the assembler should have ONLY documented instructions of the underlying processor. I would appreciate a nudge to help me get started. The way I see it I would have to sit down and code the basic 'bootstrapping' code in binary(?), then use that to assemble an assembler that will allow me to assemble a compiler which will allow me to compile files for my OS. Whew!!

Can anyone guide me in this.... or are you going to call in the men with the white coats?? hehehe
GeekyRaptor is offline   Reply With Quote
Old Jan 31st, 2010, 10:04 AM   #16
Affair
Newbie
 
Join Date: Jan 2010
Posts: 1
Rep Power: 0 Affair is on a distinguished road
Re: Assemblers, Opcodes, Binary...

Hi guys,
You are asking what I had asked for a long time. And I have spent a long period of time to find the following manuals. Have you guys read them before ?

Intel:
http://www.intel.com/products/processor/manuals/

AMD:
http://developer.amd.com/DOCUMENTATI...s/default.aspx

The above web sites contains documents (manuals of the CPUs) which contains the opcode information of the (x86, x86-64) CPUs (e.g. ADD = 0x04). And you should take some time to read them all.

Hope this information will help you all and the late comer(s).
Affair is offline   Reply With Quote
Old Jan 31st, 2010, 2:47 PM   #17
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 8,069
Rep Power: 15 DaWei will become famous soon enoughDaWei will become famous soon enough
Re: Assemblers, Opcodes, Binary...

Learn about hardware and build a processor from scratch. Then, grasshopper, you will begin to understand.
__________________
The person who coined the phrase, "There's no such thing as a stupid question," hasn't hung around here much.

Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
Politically Incorrect
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary Serialization vs. Byte Streams kurifu C# 1 Apr 7th, 2007 5:17 PM
linked list & binary tree questions n00b C++ 14 Nov 4th, 2006 2:24 AM
Java code to convert binary to decimal and hexadecimal to binary prince_haldir Java 1 Mar 7th, 2006 1:51 AM
Binary Ubert Other Programming Languages 8 Sep 23rd, 2005 10:09 AM
Reading Delphi Binary kcnz C# 2 Aug 7th, 2005 10:35 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:41 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC