Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Assembly Language

Sat May 31, 2014 5:20 pm

Hi I am a Newb and I would like to try and learn Assembly ?, as a Component I sell uses it so what do I need , ie downloads etc to get started on my Pi, any help appreciated, Regards DM

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Sat May 31, 2014 5:33 pm

Assuming you are running Raspbian as the Operating System on your RPi, I don't think you need to download anything, it is ready to use.

There is a short beginners tutorial here - http://thinkingeek.com/2013/01/09/arm-a ... chapter-1/
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Assembly Language

Sat May 31, 2014 6:42 pm

There are so few assembly only programmers out there anymore that it is a rarity to find one. Having said that, the c compiler produces assembler code and then compiles that.

A really good programmer can look at the output of a disassembler and see the original 'c' code. I got into assembler many years ago but It adversely affected my social skills so I stopped.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Sat May 31, 2014 9:40 pm

DeeJay wrote:Assuming you are running Raspbian as the Operating System on your RPi, I don't think you need to download anything, it is ready to use.

There is a short beginners tutorial here - http://thinkingeek.com/2013/01/09/arm-a ... chapter-1/
Hi Thanks I will giv it a try and Thanks for the Link, Regards DM

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Sun Jun 01, 2014 4:36 pm

DeeJay wrote:Assuming you are running Raspbian as the Operating System on your RPi, I don't think you need to download anything, it is ready to use.

There is a short beginners tutorial here - http://thinkingeek.com/2013/01/09/arm-a ... chapter-1/
Hi DeeJay, I have started on the tutorial from the link you gave me , but I have not got very far, I am using GNU Nano 2.2.6 and can not see how to save when it says " Name and save ?? so any help appreciated, Regards DM

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Sun Jun 01, 2014 6:42 pm

You don't have to use nano if you are not familiar with it. Any text editor will suffice.

If you want to persist with nano -

The clue is in the two lines of reminders at the bottom of the editor screen, starting ^G Get Help and ^X Exit...

When your file is finished and correct, press Ctrl/X (that is, press and hold Ctrl, press X, then let go of both keys.)

You should get "Save modified buffer?". Type Y for Yes.

You should get "File name to write: " The name of the file you opened for editting, in this case probably first.s will be filled in for you. (If you started nano without a filename, you will need to enter the filename here.) Just press [[Return]] to confirm the filename to save.

That's it. Nothing to do with Assembler.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Sun Jun 01, 2014 8:14 pm

DeeJay wrote:You don't have to use nano if you are not familiar with it. Any text editor will suffice.

If you want to persist with nano -

The clue is in the two lines of reminders at the bottom of the editor screen, starting ^G Get Help and ^X Exit...

When your file is finished and correct, press Ctrl/X (that is, press and hold Ctrl, press X, then let go of both keys.)

You should get "Save modified buffer?". Type Y for Yes.

You should get "File name to write: " The name of the file you opened for editting, in this case probably first.s will be filled in for you. (If you started nano without a filename, you will need to enter the filename here.) Just press [[Return]] to confirm the filename to save.

That's it. Nothing to do with Assembler.
Hi DeeJay, Thanks,as I am not familar with any Text Editors's and I had seen Nano before so Tutorial mentioned Nano so that was the one I choose , and I had done all you said several times but either my File name "first.s" was wrong but it would not go any further, and I have redone the excercise several times and always same result, so again any help appreciated, Regards DM

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Sun Jun 01, 2014 9:10 pm

Dinoman wrote:I have redone the excercise several times and always same result
What exercise? What is that result? What do you need help with?
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Sun Jun 01, 2014 9:48 pm

DeeJay wrote:
Dinoman wrote:I have redone the excercise several times and always same result
What exercise? What is that result? What do you need help with?
Hi DeeJay, this is the Link you said I should try http://thinkingeek.com/2013/01/09/arm-a ... chapter-1/ and I am trying to complete the very first exercise, and I get to save and I can not get it saved, Regards DM

User avatar
rpdom
Posts: 15177
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Assembly Language

Mon Jun 02, 2014 5:12 am

What exactly isn't working? What errors do you get?

I type "nano" to start the editor, type in the text from the example, press Ctrl and "O" to "WriteOut" as it says at the bottom of the screen, then when it says "File Name to Write:" I type in "first.s" and press Enter. The file is now saved in my current directory/folder.

hampi
Posts: 223
Joined: Fri May 31, 2013 11:29 am
Contact: Website

Re: Assembly Language

Mon Jun 02, 2014 12:15 pm

Richard-TX wrote:A really good programmer can look at the output of a disassembler and see the original 'c' code.
Even the assembly code is often made by copy-and-paste of code segments once you have figured out how the elementary things can be done in the machine language and how to present the data in the memory and file registers. In the small microcontrollers the assembly code can still be used though most programmers prefer to use C now. You can program assembly code on the RPi too, but there you have a real choise of different programming languages with high level execution and data structures. And many libraries already build into the system.

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Tue Jun 03, 2014 12:21 pm

rpdom wrote:What exactly isn't working? What errors do you get?

I type "nano" to start the editor, type in the text from the example, press Ctrl and "O" to "WriteOut" as it says at the bottom of the screen, then when it says "File Name to Write:" I type in "first.s" and press Enter. The file is now saved in my current directory/folder.
Hi Rpdom, I have redone the excercise again , pressed "Ctrl and o" ( I did not know that "WriteOut" meant Save ?) then filled in filename " /first.s" then pressed enter, then it askes if I want to "save file under a different name so I press "n" then my "file name to write: /path/to/first.s" returns so what do I do now, and if I press enter again it just repeats same again, any help appreciated, Regards DM

User avatar
DougieLawson
Posts: 36098
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Assembly Language

Tue Jun 03, 2014 12:22 pm

Press [CTRL+X] to exit from nano.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Tue Jun 03, 2014 12:48 pm

DougieLawson wrote:Press [CTRL+X] to exit from nano.
Been there, done that, the tee-shirt is so old it is falling to bits! (See my verbose reply at 7.42pm Sun 1st June)
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Tue Jun 03, 2014 12:52 pm

DougieLawson wrote:Press [CTRL+X] to exit from nano.
Hi Dougie, I tried "Ctrl +X" but nothing happens, all I can think is I have not completed the " File Name correctly" ?? so any help appreciated, Regards DM

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Assembly Language

Tue Jun 03, 2014 12:53 pm

Hi Rpdom, I have redone the excercise again , pressed "Ctrl and o" ( I did not know that "WriteOut" meant Save ?) then filled in filename " /first.s" then pressed enter, then it askes if I want to "save file under a different name so I press "n" then my "file name to write: /path/to/first.s" returns so what do I do now, and if I press enter again it just repeats same again, any help appreciated, Regards DM
I'd say: Learn vi. It sounds like nano is too complicated. That's why I never have and never will use it (or things like it). Note that 'nano' is based on an earlier "It's so easy that anyone can use it" editor called 'pico' (that I, also, could never figure out).
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Tue Jun 03, 2014 12:54 pm

Dinoman wrote:pressed "Ctrl and o" ( I did not know that "WriteOut" meant Save ?) then filled in filename " /first.s" then pressed enter, then it askes if I want to "save file under a different name so I press "n" then my "file name to write: /path/to/first.s" returns so what do I do now, and if I press enter again it just repeats same again, any help appreciated, Regards DM
So presumably 'first.s' is not the filename you give when you start nano.

So nano is carefully making sure that is the name you want to choose. If you say NO then it has no option but to ask you again for the name of the file. If you want to save the file under a different name then you need to answer Yes.

You almost certainly do NOT want to save your sample assembler source code as /first.s. Just first.s .
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Tue Jun 03, 2014 1:26 pm

DeeJay wrote:
Dinoman wrote:pressed "Ctrl and o" ( I did not know that "WriteOut" meant Save ?) then filled in filename " /first.s" then pressed enter, then it askes if I want to "save file under a different name so I press "n" then my "file name to write: /path/to/first.s" returns so what do I do now, and if I press enter again it just repeats same again, any help appreciated, Regards DM
So presumably 'first.s' is not the filename you give when you start nano.

So nano is carefully making sure that is the name you want to choose. If you say NO then it has no option but to ask you again for the name of the file. If you want to save the file under a different name then you need to answer Yes.

You almost certainly do NOT want to save your sample assembler source code as /first.s. Just first.s .[/quote

Hi as an Newb I am following the instructions to the letter ?? and double checking after every attempt,( must have redone at least 10 times now) and pressing "n" first then when that dose not work go back and try "y" all to no avail, again any help appreciated, Regards DM

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Tue Jun 03, 2014 6:15 pm

There is a tutorial here - http://staffwww.fullcoll.edu/sedwards/N ... oNano.html that contains screenshots of what should appear on the screen as you try to save the file. I think it says what I said on Sunday, but sometimes it helps to have things explained in different words...
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Tue Jun 03, 2014 6:29 pm

DeeJay wrote:There is a tutorial here - http://staffwww.fullcoll.edu/sedwards/N ... oNano.html that contains screenshots of what should appear on the screen as you try to save the file. I think it says what I said on Sunday, but sometimes it helps to have things explained in different words...

Hi DeeJay, sorted ?, what I had failed to realise is I had to delete " Path to file name" first then enter my first.s file name and hurrah all was fine, so again Thanks for all the help and patience with me, Regards DM

Dinoman
Posts: 46
Joined: Wed Jul 25, 2012 2:03 pm
Location: Little Bentley, Colchester, Essex

Re: Assembly Language

Wed Jun 04, 2014 1:59 pm

Joe Schmoe wrote:
Hi Rpdom, I have redone the excercise again , pressed "Ctrl and o" ( I did not know that "WriteOut" meant Save ?) then filled in filename " /first.s" then pressed enter, then it askes if I want to "save file under a different name so I press "n" then my "file name to write: /path/to/first.s" returns so what do I do now, and if I press enter again it just repeats same again, any help appreciated, Regards DM
I'd say: Learn vi. It sounds like nano is too complicated. That's why I never have and never will use it (or things like it). Note that 'nano' is based on an earlier "It's so easy that anyone can use it" editor called 'pico' (that I, also, could never figure out).
Hi Thanks, so what is "vi", Regards DM

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Assembly Language

Wed Jun 04, 2014 2:05 pm

vi is a text editor.

Using Raspbian in the RPi, the command vi actually starts a similar editor named vim

From man vi -
DESCRIPTION
Vim is a text editor that is upwards compatible to Vi. It can be used
to edit all kinds of plain text. It is especially useful for editing
programs.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Assembly Language

Wed Jun 04, 2014 2:06 pm

Dinoman wrote: Hi Thanks, so what is "vi", Regards DM
https://en.wikipedia.org/wiki/Vi
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Beginners”