Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 39

Thread: assembly -- where would you begin

  1. #21
    Join Date
    Mar 2009
    Location
    pennslyvania
    Beans
    122
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: assembly -- where would you begin

    I have destroyed an operating system before--that is how I wound up using ubuntu.
    But there was still something there or I would not have been able install another operating system.
    There has to be some software that allows be to load an operating system right?
    Is it impossible to write over that?

    edit:

    This is off topic please ignore.
    Last edited by audit; January 22nd, 2011 at 01:20 AM. Reason: off topic

  2. #22
    Join Date
    Jan 2011
    Beans
    3

    Re: assembly -- where would you begin

    Ack.

    Modern MMU should prevent non-BIOS and OS writes to protected addresses when running User Profile(s). Relying on the hardware people to do their job is ok,there's nothing wrong with it. It's that I prefer to know where and what I need to keep my grubby little fingers out of. If I know where to keep clear and I know that I'm running under User, not system, level privileges ... it makes life simplier.

  3. #23
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: assembly -- where would you begin

    Quote Originally Posted by NathanB View Post
    After you read those, worksofcraft, you will no longer be living in 1992.
    With or without the segmented architecture, the instruction set of the x86 is still an abomination and I have every intention of leaving the assembly code I did back in 1992 for ever and ever

    However one plan that I have in the back of my mind is to create an emulator for Knuth's MIX processor.
    This would be specifically for educational purposes, so if there are any eductionalists out there... do share your views on the merits of still learning such fundamental principles... or if it can all be done much better in Python today
    Last edited by worksofcraft; January 22nd, 2011 at 01:45 AM.

  4. #24
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: assembly -- where would you begin

    Quote Originally Posted by audit View Post
    I have destroyed an operating system before--that is how I wound up using ubuntu.
    But there was still something there or I would not have been able install another operating system.
    There has to be some software that allows be to load an operating system right?
    Yes. That is called the Basic Input/Output System.
    http://en.wikipedia.org/wiki/BIOS

    Used to be, it was contained in ROM. But on modern machines, it usually resides in some sort of Flash-RAM.

    Is it impossible to write over that?
    Well, at one time the answer was no. But, on a modern machine, it is possible. But not by accident. One would have to really know certain particulars about the motherboard specs in order to do it.

  5. #25
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: assembly -- where would you begin

    Quote Originally Posted by worksofcraft View Post
    However one plan that I have in the back of my mind is to create an emulator for Knuth's MIX processor.
    I once wrote an assembler for 6502. I had planned to also write an emulator/debugger system to complete the package, but I never did get around to doing that.
    This would be specifically for educational purposes, so if there are any eductionalists out there... do share your views on the merits of still learning such fundamental principles... or if it can all be done much better in Python today
    Well, if you are anything like me and don't care about being "cycle exact" with the timing of the emulator, then Python is perfect for the task.

  6. #26
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: assembly -- where would you begin

    Quote Originally Posted by NathanB View Post
    I once wrote an assembler for 6502. I had planned to also write an emulator/debugger system to complete the package, but I never did get around to doing that.

    Well, if you are anything like me and don't care about being "cycle exact" with the timing of the emulator, then Python is perfect for the task.
    Hum well the 6502 was a bit b4 my time but I gather it had a reasonably logical and orthogonal instruction set.

    What I meant though was not if Python would be good for writing an emulator but whether it was more suitable than assembler for teaching fundamental concepts like how things are allocated in memory, how pointers work etcetera...

  7. #27
    Join Date
    May 2007
    Beans
    245
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: assembly -- where would you begin

    Quote Originally Posted by worksofcraft View Post
    Hum well the 6502 was a bit b4 my time but I gather it had a reasonably logical and orthogonal instruction set.
    Yes, it was some time ago. The set is intuitive but memory-oriented. Not much different from the 8051/52 micro-controllers that were popular until the ARM recently usurped the stage. Come to think of it, I now remember that the 6502 was usually clocked at only 1MHz, so it would not be hard at all to approach cycle-exact. I might just talk myself into finishing that project.
    What I meant though was not if Python would be good for writing an emulator but whether it was more suitable than assembler for teaching fundamental concepts like how things are allocated in memory, how pointers work etcetera...
    When did Python get pointers??

    Well, I suppose that one could describe it like so...
    PHP Code:
    >>> = ['the''cow''jumped''over']
    >>> 
    2
    >>> a[x]
    'jumped' 
    Here, 'x' is an index into a list, but, in a way, it is also a "pointer" to the third element (or seventh character) of that list.

    Does that work? Or would that just confuse people??

  8. #28
    Join Date
    Sep 2007
    Location
    Christchurch, New Zealand
    Beans
    1,328
    Distro
    Ubuntu

    Re: assembly -- where would you begin

    Quote Originally Posted by NathanB View Post
    Yes, it was some time ago. The set is intuitive but memory-oriented. Not much different from the 8051/52 micro-controllers that were popular until the ARM recently usurped the stage. Come to think of it, I now remember that the 6502 was usually clocked at only 1MHz, so it would not be hard at all to approach cycle-exact. I might just talk myself into finishing that project.


    When did Python get pointers??

    Well, I suppose that one could describe it like so...
    PHP Code:
    >>> = ['the''cow''jumped''over']
    >>> 
    2
    >>> a[x]
    'jumped' 
    Here, 'x' is an index into a list, but, in a way, it is also a "pointer" to the third element (or seventh character) of that list.

    Does that work? Or would that just confuse people??
    I think it would seriously confuse students.
    From the many beginner questions I've seen here on this forum I would say an assembler based programming course is very much lacking.
    Simple concepts like: what is a memory fetch cycle, how the stack works with function calls and local data items, static memory allocation... how are pass by value and pass by reference actually implemented, instructions v.s. data... what is a register... how does the ALU work, interrupt servicing and also controling input/output hardware.. realitive and absolute addressing modes... and many more

    Would you believe recently there was a thread from someone who was soon to be doing a course on micro-controllers... which they were going to be programming in BASIC

    Can you actually think of ANYTHING one could learn about micro controllers when programming in BASIC ? TBH I really really can't even begin to imagine!
    Last edited by worksofcraft; January 22nd, 2011 at 05:47 AM.

  9. #29
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Wink Re: assembly -- where would you begin

    Quote Originally Posted by audit View Post
    I do not understand segment faults, stack overflow and memory addresses are Greek to me.
    Έλα ρε φιλαράκι, μην μιλάς Για ελληνικά τώρα... Μίλα για κινέζικα καλύτερα... Τέλοσπαντων, το καταπίνω....

    Anyway, I think you should try to Debug your program. See the segmentation fault and search for null pointers etc

  10. #30
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: assembly -- where would you begin

    Quote Originally Posted by worksofcraft View Post
    This would be specifically for educational purposes, so if there are any eductionalists out there... do share your views on the merits of still learning such fundamental principles... or if it can all be done much better in Python today
    Well, what constitutes "fundamental principles" has been a bone of contention here for years, it's probably the most discussed issue if you recall... the high/low level languages "megathread" in particular has a lot of stuff about this.

    While I certainly believe that a well-rounded programmer will have to have an understanding of those things eventually, from an educational perspective, I would dispute whether those things really are "fundamental". If one wants to understand, say, the idea of an indirect reference -- which a pointer essentially is -- array indexing does just as well. Pass-by-reference is a general conceptual issue; the high-level language approach of symbol bindings to values teaches the "idea" much more effectively than an exposition of how a compiler might implement it in something like C++.

    So yes, it (learning) can be done better in Python today -- but it is not as contrary to "learning fundamental principles" as you put it. Of course coding things like microcontrollers is a special problem domain which requires knowledge specific to it.
    LambdaGrok. | #ubuntu-programming on FreeNode

Page 3 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

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