Page 1 of 1

Assembly Language

Posted: Sat May 31, 2014 5:20 pm
by Dinoman
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

Re: Assembly Language

Posted: Sat May 31, 2014 5:33 pm
by DeeJay
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/

Re: Assembly Language

Posted: Sat May 31, 2014 6:42 pm
by Richard-TX
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.

Re: Assembly Language

Posted: Sat May 31, 2014 9:40 pm
by Dinoman
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

Re: Assembly Language

Posted: Sun Jun 01, 2014 4:36 pm
by Dinoman
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

Re: Assembly Language

Posted: Sun Jun 01, 2014 6:42 pm
by DeeJay
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.

Re: Assembly Language

Posted: Sun Jun 01, 2014 8:14 pm
by Dinoman
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

Re: Assembly Language

Posted: Sun Jun 01, 2014 9:10 pm
by DeeJay
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?

Re: Assembly Language

Posted: Sun Jun 01, 2014 9:48 pm
by Dinoman
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

Re: Assembly Language

Posted: Mon Jun 02, 2014 5:12 am
by rpdom
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.

Re: Assembly Language

Posted: Mon Jun 02, 2014 12:15 pm
by hampi
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.

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:21 pm
by Dinoman
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

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:22 pm
by DougieLawson
Press [CTRL+X] to exit from nano.

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:48 pm
by DeeJay
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)

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:52 pm
by Dinoman
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

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:53 pm
by Joe Schmoe
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).

Re: Assembly Language

Posted: Tue Jun 03, 2014 12:54 pm
by DeeJay
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 .

Re: Assembly Language

Posted: Tue Jun 03, 2014 1:26 pm
by Dinoman
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

Re: Assembly Language

Posted: Tue Jun 03, 2014 6:15 pm
by DeeJay
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...

Re: Assembly Language

Posted: Tue Jun 03, 2014 6:29 pm
by Dinoman
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

Re: Assembly Language

Posted: Wed Jun 04, 2014 1:59 pm
by Dinoman
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

Re: Assembly Language

Posted: Wed Jun 04, 2014 2:05 pm
by DeeJay
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.

Re: Assembly Language

Posted: Wed Jun 04, 2014 2:06 pm
by Joe Schmoe
Dinoman wrote: Hi Thanks, so what is "vi", Regards DM
https://en.wikipedia.org/wiki/Vi