Image Map Image Map
Page 3 of 10 FirstFirst 1234567 ... LastLast
Results 21 to 30 of 99

Thread: Decided to start learnig C

  1. #21
    Join Date
    May 2011
    Location
    Outer Mongolia
    Posts
    3,230

    Default

    Quote Originally Posted by Chuck(G) View Post
    Low-end MCUs are generally best done in assembly, as speed and memory are minimal and you may be counting cycles for timing.
    I'm actually kind of amazed how close C comes to assembly on the AVR 8-bits; if you need cycle *exactness* then, yeah, either pure assembly or slapping in some embedded ASM is a thing you'll need to do. But it's still pretty incredible that you can use a "higher-level" language on an eight-bit CPU and still do "a useful thing" several million times a second.
    My Retro-computing YouTube Channel (updates... eventually?): Paleozoic PCs

  2. #22
    Join Date
    Jan 2005
    Location
    Principality of Xeon W-2140B the Great State of Central New Jerky
    Posts
    2,428

    Default

    Quote Originally Posted by Agent Orange View Post
    Last year I bought a C++ book from Amazon and it came from Walmart. It was supposed to have the CD/DVD with it but I never received it. Still going round and round with Amazon and I don't think I'm going to win.
    what is the name of the book? there's the possibility I have the cd/dvd.

    yeah buying used books and expecting to get the disk usually results in melancholy. Once in a while I'm presently surprised though. That is if it/they don't wind up cracked in half!

  3. #23
    Join Date
    Jan 2005
    Location
    Principality of Xeon W-2140B the Great State of Central New Jerky
    Posts
    2,428

    Default

    someone mentioned Herb Schildt. In iirc C the Complete Reference he builds a C interpreter. Pretty groovy. It's real basic (not BASIC), but still pretty interesting.

  4. #24

    Default

    Quote Originally Posted by ibmapc View Post
    I've played around with BASIC since about 1979 but never really got super deep into it. A few years ago, I bought a book about assembly, but couldn't stay awake reading it. So, late in September, I started looking for Online Courses for programming. I stumbled accross "C Programming with Linux" from Dartmouth College. I'm now three courses into a seven course program and learning a LOT! Has anyone here checked this out or completed all seven courses? I'd love to hear feedback and suggestions as to were to go after completion. C++? Python? Java? Other C courses?

    If you click the picture, you'll see my progress so far.
    I really like C for programming on old boxen and for gnawing on the bare metal. It's low-level enough that you can kind of intuit how it's going to look in assembly language as you write it, but it's a lot easier to read and way more portable.

    The good ol' K&R book was updated for ANSI C some years (decades?) ago. That was the book that I cut my C-teeth on, and I still like it best. It's a no-nonsense book that just tells you what you need to know in an understandable and straightforward way, without a bunch of extra stuff.

    Do take care with pointers and buffer overflows, though. There are some compilers that can somehow insert a piece of protected memory at the end of all your arrays/etc, so if you overflow them it will raise a segmentation fault instead of just randomly smashing other variables and continuing. I can't remember what it was called or how it worked, though.

    And be careful and systematic with your dynamic memory allocation. I find it useful to use a malloc replacement that keeps track of all your allocations and then complains at exit if you forgot to deallocate anything.

    (Both of these debugging aids to be removed in production builds, of course.)

    C doesn't try to save you from yourself in either of these regards. I read somewhere that like 90% of C debugging time is spent dealing with memory allocation and buffer overflow issues, so if you can avoid them to begin with or make them easier to notice, you'll save yourself a lot of time and hair-pulling.
    Last edited by bladamson; November 7th, 2020 at 06:08 PM.
    -- Lee
    If you get super-bored, try muh crappy YouTube channel: Old Computer Fun!
    Looking to Buy/Trade For (non-working is fine): Tandy 1000 EX/HX power supply, Mac IIci hard drive sled and one bottom rubber foot, Multisync VGA CRTs, Decent NuBus video card, PC-era Tandy stuff, Weird Old Unix Stuff, Aesthetic Old Serial Terminals (HP and Data General in particular)

  5. #25

    Default

    Quote Originally Posted by Agent Orange View Post
    Back in the day ADA was the thing at the Pentagon. Might be still around in some areas.
    I still have nightmares about Ada. Oh god. Such an unpleasant language named after such an interesting historical figure. Poor Ms. Lovelace's legacy is now forever tainted by the language. :3
    -- Lee
    If you get super-bored, try muh crappy YouTube channel: Old Computer Fun!
    Looking to Buy/Trade For (non-working is fine): Tandy 1000 EX/HX power supply, Mac IIci hard drive sled and one bottom rubber foot, Multisync VGA CRTs, Decent NuBus video card, PC-era Tandy stuff, Weird Old Unix Stuff, Aesthetic Old Serial Terminals (HP and Data General in particular)

  6. #26
    Join Date
    May 2018
    Location
    Lancashire
    Posts
    725
    Blog Entries
    19

    Default

    Quote Originally Posted by bladamson View Post
    I still have nightmares about Ada. Oh god. Such an unpleasant language named after such an interesting historical figure. Poor Ms. Lovelace's legacy is now forever tainted by the language. :3
    CUTLASS was much easier to write real time control programs in, shame that wasn't widely promoted either. So easy to use and read.

    A task could be scheduled to run on a clock and a three term controller was as simple as writing a=INCPID(Gain,IAT,DT). It automatically handled setting up all the dependant histories for the control functions and provided simple to code state machines for sequence controls, filters, I/O handling etc.

    Still in use too.
    Current fleet
    TRS80 Model 4 - BBC B - Tatung Einstein - PCW9512 - PET 3032 - C64 - ZX81 - Spectrum 48K - Amiga A500 - Apple II europlus - Apple iMAC G3. Sharp MZ-80K. - IBM 5160 XT - Multibus 286/10 - Micro PDP 11/73 - Rainbow PC100A - MicroVax II - MicroVAX 3100, 3300, VAX 4000 VLC & 4000 Model 96 - AlphaStation 225

  7. #27
    Join Date
    Sep 2008
    Location
    SE MI
    Posts
    5,179
    Blog Entries
    6

    Default

    Quote Originally Posted by tipc View Post
    what is the name of the book? there's the possibility I have the cd/dvd.

    yeah buying used books and expecting to get the disk usually results in melancholy. Once in a while I'm presently surprised though. That is if it/they don't wind up cracked in half!
    What I have is "Visual C++ 6" for Dummies (meaning me). It's written by Michael Hyman & Bob Amson (WTFRT2 anyway?). There is a chapter that explains the CD usage and a number to call at Hungry Minds Customer Care", which I just now discovered. I know I know, everyone is going to say I got the wrong book, but my tutor was off that day.
    Surely not everyone was Kung-fu fighting

  8. #28
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    35,709
    Blog Entries
    18

    Default

    Quote Originally Posted by bladamson View Post
    I still have nightmares about Ada. Oh god. Such an unpleasant language named after such an interesting historical figure. Poor Ms. Lovelace's legacy is now forever tainted by the language. :3
    Well, the ISS hasn't fallen out of the sky yet and Nvidia is coding its automotive stuff in Ada, so it's still around. It's not a language that lends itself to coding "quickies". It's not a bad language for mission-critical stuff, unlike, say C.

    C has been described by many people as a "high level assembly language" and indeed the original K&R is a good match to the PDP-11 instruction set. It's C and its descendants that's had a strong influence on computer architecture. For example, ISAs without a stack architecture used to be quite common. Not today. Legacy FORTRAN certainly doesn't require one.

    Any JOVIAL programmers out there? That was another good one for embedded stuff--and easy to read and program, but mostly used by the military. Sad that it's fallen out of favor.

  9. #29
    Join Date
    Apr 2010
    Location
    Albany, OR USA
    Posts
    1,011
    Blog Entries
    1

    Default

    OP Here! Wow. Lots of great replies here. Thanks guys!! I've only quickly skimmed over all of them! One of the questions that came up was asking what hardware I wanted to program for. The answer to that is, well, mostly older stuff like PC XT and AT such as my 5155 and my 5162. The 5162 dual boots to DOS and ZENIX. I have played a very little with a C compiler on ZENIX and would like to do more there. Also, I've been playing with Arduino and other Micro controllers. Lately, I've been playing with Soarer's converter on a Pro-Micro converting a model F-XT keyboard to USB. In fact, that's what I'm typing on now. I found reverse engineered source code for Soarer's converter and have been able to compile it perfectly for the Pro-micro. I would like to tweak it so that it can also convert to AT protocol as well as USB so that I can connect the same XT keyboard to an AT computer or a newer USB capable machine without replacing the firmware completely on the Pro-Micro.

    Someone mentioned that I wouldn't learn much C from seven classes. I think he misunderstood. It's not seven classes. It's SEVEN COURSES. Each course has a bunch of lectures and tests with a Final exam in each course. The EdX Program that Dartmouth College is using is pretty cool. The lectures are done with Code Cast. If you click that link I provided and cut and paste the following tiny bit of code, you can compile and run it to see the output.

    Code:
    #include<stdio.h>
    int main(){
        printf("hello, world\n");
        return 0;
        }

    It's a pretty good teaching tool. The main reason for going with an online course is that I need some structure and some goals to strive for to try to get a good foundation to build upon. The great thing about the Dartmouth program is that they get the student coding right away and keep building to more advanced programming problems. I don't yet understand enough to play manipulate the code for Soarer's converter, but I think I'm making headway.

    Greg

  10. #30
    Join Date
    Feb 2006
    Location
    in the basement
    Posts
    913

    Default

    Quote Originally Posted by Chuck(G) View Post
    ... It's not a bad language for mission-critical stuff......r.
    Would you please explain what "mission-critical" means as far as
    programming is concerned?

    ziloo

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
  •