How to learn assembely?


Closed Thread
Results 1 to 26 of 26

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Hi,
    whether Basic or C or any other high level language-- you can see later--
    i feel better you do some funda in assy language for gaining command over the chip and its intricacies.

    after you fiish implementing few projects, you try to go foe bulk programming-- then you can start pacticing whichever HLL you like- cuz whetther apple orange, pineapple, leamon--it is taste for it and for example,

    I try to argue in favorof a lanfguage, that i have been practicing and always i try try to put plus points of that-- but natural.

    but you better have few projects developed in assy language -- it helps you
    Regards,
    Sarma

  2. #2
    Join Date
    Aug 2006
    Location
    Iran
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Hi, i have done alot of project in picbasic but i found that it has some problem,for example i found that in conditional instruction (if... then..),intrupt doesn't work.
    i wrote a program to read the keyboard(4*4) with conditonal instruction but RB0 interrupt didin't work but when i used RB0 interrupt in other programs without conditional instructions it worked ver well.
    so i think the best langauge is assembly.it's faster. conversion of the C or Pic basic to assembely or hex file is not optimal. in some project speed is very important so the best choice is assembly.

  3. #3
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by amindzo View Post
    Hi, i have done alot of project in picbasic but i found that it has some problem,for example i found that in conditional instruction (if... then..),intrupt doesn't work.
    i wrote a program to read the keyboard(4*4) with conditonal instruction but RB0 interrupt didin't work but when i used RB0 interrupt in other programs without conditional instructions it worked ver well.
    so i think the best langauge is assembly.it's faster. conversion of the C or Pic basic to assembely or hex file is not optimal. in some project speed is very important so the best choice is assembly.
    I admit that I am no expert in these languages, but , to my little knowledge, any program written in HLL has to be compiled and you know what happens if you compile such a file. it looks into a pre wriitten code and uses a judicious part of the code available there. Perhpas over a period these HLLs are revised to cover difficiencies. --that is the reason you find that a particular suppliers Basic otr 'C' is better than others etc,

    thus ifeel there is nothing wrong, ifct it is better to write(be able to write) in assy language. aprogram written by a skilled writer in assy is much better than a compiled Basic or C-- of course my personal feeling.
    Regards,
    Sarma

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Whatever the language you're using, just get the job done and that's it.

    mvs_sarma, you have many good points which i agree with. Writing in assembler , even if looks monster and painfull, have it's advantages. I wish i could go back and learn Assembler first.. bah too late

    At least, someone's beginning programming in assembler will probably learn better how to use, set-up, the internal PIC ressources... as there's nothing already done. Let's say ADCIN, HSEROUT etc etc. Better hardware understanding.

    Also it force the programmer to use it's brain a little bit much. Let's say someone want to compute a multicondition IF THEN ELSE like
    Code:
    IF (ByteA<300) AND (ByteC>=ByteA) AND (ByteC+ByteD<127) then...
    Obviously, knowing how many assembler instruction you have, and what's available, he will spend more time to write the code than with any compiler.

    But both will produce the same result, one will be faster to write.

    Better because it's written in assembler? no, 'cause both work. Maybe one may need more codespace... but less time to write.

    I will stop here and stick on my opinion. Nothing is better, if the final code/product works as expected and bug-free.

    Sure i don't reject any language advantages. You just have to trust the compiler you're using.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Code:
    IF (ByteA<300) AND (ByteC>=ByteA) AND (ByteC+ByteD<127) then...
    If ByteA really is a byte then the first condition will always be true

    Not having a dig Steve, just posting something to make the "you have not posted for a while" message go away. LOL
    Keith

    www.diyha.co.uk
    www.kat5.tv

  6. #6
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Few Tips

    Quote Originally Posted by keithdoxey View Post
    Code:
    IF (ByteA<300) AND (ByteC>=ByteA) AND (ByteC+ByteD<127) then...
    This is an extremely inefficient, code space consuming argument.<hr/>
    Here's a better approach that will use much less code space and probably be a lot faster too.<hr/>
    Code:
    IF ByteA<300 THEN
       IF ByteC>=ByteA THEN
          IF (ByteC+ByteD<127 THEN
          'do something
          ENDIF
       ENDIF
    ENDIF
    Willing to bet this is about 20-30 bytes shorter.
    <br/>

  7. #7
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post Select Case - By far the best way!

    Using Select Case is by far the very best methodology for implementing well structured decision making procedures. I'm a little uncertain as to just how advantageous it can be in PBP, but in Visual Basic, it's a god sent!

    Consider the following:
    Code:
    SELECT CASE UserInput
    
       CASE 1
               GOSUB Temperature
               LOW LED
               
       CASE 2
               GOSUB LightLevel
               HIGH LED
    END SELECT
    <hr/>
    Much easier to read and much faster. Select Case is a much more efficient, IF statement equivalent. However they can at times be a bit quirky for certain things.
    <br/>

Similar Threads

  1. Can you teach a PIC to learn?
    By lew247 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st December 2009, 02:06
  2. help converting assembely program
    By ahmed_salah in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 7th August 2008, 16:28
  3. How do you learn best?
    By T.Jackson in forum Off Topic
    Replies: 41
    Last Post: - 30th May 2008, 15:32
  4. Who wants to learn...
    By Stoverus in forum Off Topic
    Replies: 1
    Last Post: - 21st October 2006, 08:08
  5. How to learn PIC BASIC compiler in 7 days?
    By luqman83salleh in forum General
    Replies: 2
    Last Post: - 13th August 2004, 15:15

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts