LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2013, 08:06 PM   #166
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241

Really nice video introduction. Thanks.

The simple stack machine would work on it - just by compiling for it.

It would make using a shared memory (stack segment and data segment), though it would likely be nice to have more than a 16 bit limit. Will think on it.

One fun thought would be a 1/2/3 byte operand allowing for 1 or 2 bytes for offsets, and 3 for for offset or memory address (still use 4 bytes for constants). Currently it does 1/2/4, with 2 used for memory address, and 4 bytes for some constants.

Will look at using 4 byte offsets for stack alignment, but with byte addressing via indexing by non-stack pointer. This would allow the greatest ease with sharing addressing between stack and data. Would also need a block transfer for large data copying (wanted that anyway).

Last edited by jpollard; 12-31-2013 at 08:14 PM.
 
Old 01-01-2014, 12:44 AM   #167
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
The M machine is 16/32 bit - you probably would want to use the 32 bit only machines. They are faster and made for a general computing environment. I think their original machine was a 6502 variant (apple II/ commodore 64) and the 6502 was a nice A/Q machine of very early make. I like the ARM instruction set. I think I will stick with the PIC32. Maybe at some later date try out the ARM once I get established. The IDE is from KIEL and costs money. Microchip's IDE is free and works with Linux.
 
Old 01-01-2014, 06:36 AM   #168
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
The ARM IDE could be Linux itself - it runs on nearly all of the chips except the very lowest. Look at the Raspberry PI for an example. The entire system is about $45 (the credit card sized board includes video, ethernet, IO pins to daughter cards, and two USB ports). What brings it up to about $90 is buying other things like power bricks, cables, keyboards/mouse... And comes in two versions: 256MB or 512MB.

As to the 16/32 bit operation, that is up to the compiler (GCC compiles for Cortex-M0/M0+/M3/M4/A9)

The main advantage though is the memory access. Having the data/stack share addressing makes a lot of coding easier, and with a simpler run time.

Last edited by jpollard; 01-01-2014 at 06:42 AM.
 
Old 01-03-2014, 02:38 AM   #169
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
Have you considered writing your assembler and compiler in java so it would run on mac, linux and windows?
 
Old 01-03-2014, 08:14 AM   #170
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Nope. Perl already runs on all three.

It also happens that I'm more familiar with Perl and its builtin tools. Java has to have a huge runtime before it can do anything.

Last edited by jpollard; 01-03-2014 at 08:15 AM.
 
Old 01-03-2014, 07:35 PM   #171
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
I have gotten the debug parse tree walker working again. Next step is to get code generated again. Features for local variables (and even data structures) is also in place, though not used yet.

Once code is generated again, I'll start revisiting the interpreter... I will definitely be re-arranging
the instruction coding, adding a memory copy, and possibly making the stack byte addressable. Whether it gets a larger range or not. It might - I have figured out a memory encoding using 3 byte addresses. The high order two bits would identify the segment (instruction, constants, stack, and variable)
 
Old 01-03-2014, 09:41 PM   #172
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
Spent the first half of the day debugging errors and warnings. Then I found that I had two different string data structures with the more advanced one not fully implemented. Had to look through 3588 lines of c and a large header file to fully implement the advanced data structure. Had to take an elderly lady to a wake and just finished in time to drop it until monday. Still think you should write a book on your stack machine, assembler and compiler. A way to monetize your work.
 
Old 01-07-2014, 03:22 AM   #173
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Got the updated translator working yesterday. a blinding flash of the obvious after looking for it for days... two bugs, with overlapping symptoms. Now to add the array indexing (and document the errors for next time...)
 
Old 01-07-2014, 01:35 PM   #174
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
Double errors were always the hardest to find when working in the VPI&SU computing center years ago.
 
Old 01-07-2014, 04:11 PM   #175
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Quote:
Originally Posted by schmitta View Post
Double errors were always the hardest to find when working in the VPI&SU computing center years ago.
They always are the most aggravating.

The worst one I ever ran across was a hardware bug - We had a display with a stylized diagram of a ship - a pointed bow, rectangular sides, and a rounded stern. Oriented based on GPS position and direction (as computed by our navigation system). Took us a while to get antenna offsets computed right, Compass rotations filtered properly, and showing updates in real time.

A day or so later one of the team goes "Thats odd...", so we watched the display - no problem. "Well what?"... "Keep watching...".. Then, roughly once every 10 or 15 seconds the stern would bend into the center of the ship... Almost like a collision from the rear...

Days later... we added one NOOP between every instruction where the computation had to be going wrong... and it didn't happen. So we took one no-op out at a time, for an entire day. We determined it was a hardware fault when the error would only occur when we took the last NOOP out - which was between a floating divide and a floating store of the register just used in the divide.

It never happened anywhere else that we could detect - just that specific 10-12 instructions, in that specific order, with the divide/store being the last two instructions. Sometimes the store would not get the result of the divide, and get zero.
 
Old 01-07-2014, 04:59 PM   #176
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
Great! really great problem and your solution.

Last edited by schmitta; 01-09-2014 at 05:26 AM.
 
Old 01-09-2014, 05:25 AM   #177
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
Program getting big. Looked for an option of gcc that would print out the function definition and line number. Ended up writing a state machine with some special comments in the c source I was analyzing to do it myself. Next have to alphabetize it. Plan to reduce it to just line number with function name alphabetized. Reduced 3588 lines of code down to three pages of information. Lets me work offline with a printout which for some reason makes me feel calmer about the debugging process. Programming is a very emotional process. For me at least each new error or problem makes me feel defeated and somewhat afraid. I think it is due to my brain chemical problems and anxiety. My defense mechanism has always been to push through even with those feelings. May be revealing too much of myself in this public forum.
 
Old 01-09-2014, 08:03 AM   #178
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Not to worry too much. I sometimes have concentration issues - occasionally what used to take 15 minutes now can take hours (depending on the bug). It can cause headaches - which I break by playing some game or other.
 
Old 01-15-2014, 12:31 AM   #179
schmitta
Member
 
Registered: May 2011
Location: Blacksburg VA
Distribution: UBUNTU, LXLE
Posts: 308

Original Poster
Rep: Reputation: Disabled
One way to learn C is to write an interpreter. I am finding out everything I don't know about C. Somewhat humbling. But it is also fun in a strange way. Just got a post from a friend who is into RC gliders. I think I will build the plane I have sitting around. A good winter project. That is fun too.
 
Old 01-15-2014, 03:20 AM   #180
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,600

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Especially if you can get into the cockpit camera view...

The videos I've seen of that can get down right dizzy.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expressions nova49 Linux - Newbie 4 07-13-2011 08:05 AM
Regular Expressions Wim Sturkenboom Programming 10 11-19-2009 02:21 AM
regular expressions. stomach Linux - Software 1 02-10-2006 07:41 AM
Regular Expressions overbored Linux - Software 3 06-24-2004 03:34 PM
help with REGULAR EXPRESSIONS ner Linux - General 23 11-01-2003 12:09 AM


All times are GMT -5. The time now is 02:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration