Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: thepenguin77 on March 17, 2011, 07:30:18 pm

Title: Really Long Source Code
Post by: thepenguin77 on March 17, 2011, 07:30:18 pm
Edit 3:
    Topic move weirdness. My original first post is the sixth post (http://ourl.ca/9693/186255). So that is where the question is at.



______________________________________________________________________________________________

would you imagine the source is 100K, and over 2500 lines of pure code? (for starfox) O.O

You think 2500 is big?

zStart: 8223 (All files tallied)
Geowars: 6815
Starfox: 6783 (I have no idea what you're looking at :D)
Chess: 4821
Imposble: > 4000
TetrisM: 4005
Tower: 3995 (Never mentioned, never finished)
BluTooth:3307
LandRovr: 2205 (Never mentioned, never finished)
Missile: 2124
Bubble:2056


That was after he emailed it to me ;) and with the email came the permission to use what I wanted ^-^ you guys don't have that.  HAH.  SUCKERS.  :P jk

Also, anyone can use it as long as they give me credit ;)


Edit:
   If you meant starfox is only 2500 of code, the code ends around 5188. And I definitely did not skip every other line.

Edit2:
   Those all add up to 48,000. I'm prolific, lol.
Title: Re: Really Long Source Code
Post by: calc84maniac on March 17, 2011, 08:12:19 pm
That made me curious about my projects. I was surprised to find that TI-Boy has

Spoiler For Spoiler:
*drumroll please*
Spoiler For Spoiler:
OVER 9000!
Spoiler For Spoiler:
11661 to be exact. Quite a few lines in the opcodes asm file are macros though.
Title: Re: Really Long Source Code
Post by: Quigibo on March 17, 2011, 08:51:52 pm
Hehe... Axe's source code is 9200 lines of code but then the commands add another 3700 lines.
Title: Re: Really Long Source Code
Post by: apcalc on March 17, 2011, 08:53:33 pm
/me thinks calc84maniac and Quigibo are in a competition to make the largest program!
Title: Re: Really Long Source Code
Post by: Deep Toaster on March 17, 2011, 09:31:32 pm
Hehe... Axe's source code is 9200 lines of code but then the commands add another 3700 lines.

IT'S ... er, wow. These are huge programs, even for ASM :o
Title: Re: Really Long Source Code
Post by: thepenguin77 on March 17, 2011, 10:35:24 pm
============ Original first post ===========

I am going to split from here (http://ourl.ca/6640/186268) because I feel like this might go on for a while.

How do you people deal with source code when it starts getting over 4000 lines long? I feel like once it starts reaching this length, I start losing time by searching through the code for routines. At these sizes, the scroll bar is almost useless.

I only have two ways that I've adapted to this kind of thing:
-Ctrl-F, then search for a routine name
-Split file up into multiple files in a folder, this is good, but it takes time to do and maintain, especially because it requires a new batch file


Does anyone have a better system? I use notepad currently, so I'm as basic as it gets.
Title: Re: Really Long Source Code
Post by: Snake X on March 17, 2011, 10:39:51 pm
Shouldn't spencer putt have some system for this situation? I'm sure that his zelda project is very large just like yours
Title: Re: Really Long Source Code
Post by: phenomist on March 17, 2011, 10:40:14 pm
Hmm... If you don't have Word Wrap turned on, you could use the statusbar at the bottom, and create something of a "Table of Contents" including the line numbers for your routines.

You could create an ASCII-art type comment in order to be able to identify routines when scrolling.

Yeah, I suppose that non-interpreted comments would be a good way to mark your routines.
Title: Re: Really Long Source Code
Post by: leafy on March 17, 2011, 10:43:52 pm
Wow, i think graviter is only somewhere around 600-700 lines.
Title: Re: Really Long Source Code
Post by: ztrumpet on March 17, 2011, 10:45:32 pm
Wow, i think graviter is only somewhere around 600-700 lines.
Please note that this is Asm and not Axe, so the line lengths will be extremely different. ;)
Title: Re: Really Long Source Code
Post by: leafy on March 17, 2011, 10:46:13 pm
Yeah, Assembly programs have a frickin huge number of lines.
Title: Re: Really Long Source Code
Post by: thepenguin77 on March 17, 2011, 11:02:49 pm
Hmm... If you don't have Word Wrap turned on, you could use the statusbar at the bottom, and create something of a "Table of Contents" including the line numbers for your routines.

You could create an ASCII-art type comment in order to be able to identify routines when scrolling.

Yeah, I suppose that non-interpreted comments would be a good way to mark your routines.

I already do comment headers, and they work nicely because they stand out.

The table of contents is a cool idea, but the code moves, so it wouldn't be valid for very long.
Title: Re: Really Long Source Code
Post by: Xeda112358 on March 17, 2011, 11:17:58 pm
Hehe, here is the form I compile BatLib in:
http://pastebin.com/Ee0Hi7Bk
Then here is the code output from Assemblex (minus the image and fontset which uses >1000 bytes of code)
http://pastebin.com/jWvEMGPx
I don't know how accurate that is, but it is still a lot of code x.X 146 pages of it, actually, and that is without any of the notes I usually like to include
Title: Re: Really Long Source Code
Post by: AngelFish on March 18, 2011, 12:55:48 am
Quote
;Working with mnemonics is just so tedious

Ya know, some people might disagree :P
Title: Re: Really Long Source Code
Post by: Xeda112358 on March 18, 2011, 12:58:22 am
Psh, never :P
I just don't like typing out:
 ld a,32
 add a,l

when I could do 3E2085 or something. It is so much more compact and it is easier to see what is going on :D
Title: Re: Really Long Source Code
Post by: SirCmpwn on March 18, 2011, 09:24:03 am
tiDE's folder encompasses 24.3 MB.  This includes images, source code, and other assets.
Of that, there are 869 files, and 225 folders.
Within the code files of tiDE, there are 26,082 lines.  This only includes actual code, no images or other files were included in my calculation.
This is in *one* project.
Don't believe me?  The source code is publicly available here (http://tidenv.codeplex.com/SourceControl/changeset/view/7319).
I don't think anyone could possibly beat that.
If anyone would like a program that counts all the lines in *.cs files within a given directory, let me know ;)
Title: Re: Really Long Source Code
Post by: aeTIos on March 18, 2011, 09:25:34 am
:o
Title: Re: Really Long Source Code
Post by: Deep Toaster on March 18, 2011, 09:30:02 am
Yeah, Assembly programs have a frickin huge number of lines.

But even for that, this is huge!
Title: Re: Really Long Source Code
Post by: SirCmpwn on March 18, 2011, 09:41:32 am
Here's a program to count all the lines of any code files in a specific directory.  Click Choose Directory to pick it, and Count Lines to get the line count.  Pretty straightforward.  Change the Filter text box with whatever kind of file you're looking for.  If you want *.cs files, type "*.cs".  If you're looking for *.asm files, type "*.asm".  If you're looking for any file called "test" with any extension, type "test.*".
Title: Re: Really Long Source Code
Post by: yunhua98 on March 18, 2011, 10:19:54 am
Wow, I can see why people are reluctant to discontinue ASM programs...

@Xeda:  I still don't know how you understand Hex more than Assembly.  ???  But thats just amazing.  :o
Title: Re: Really Long Source Code
Post by: Xeda112358 on March 18, 2011, 11:45:27 am
I group the code together, so it makes it a little more compact and readable. If you read in your native language, if you know what to expect, you don't need to read the whole word and sometimes you don't even need to read the sentence! So when I type:
EFF142D878C0EB4E234623EB
I only read the "EFF" part and since it is unique, I know that the whole line is devoted to finding a variable and getting the size in BC. I then look at the last byte for an EB to see if the pointer to the data is returned in HL or DE (DE in this case). Or if I see:
3E30ED67FE3A3802C607121BC9
I can tell almost instantly by the "3E30" that it deals with numbers because 30h is the token for "0" and if I read further and see C607 I know the line is involved in converting hex, too. I find that a lot easier to pinpoint and recognise in a code than:
Code: [Select]
ld a,30h
 rrd
 cp 3Ah
 jr c,$+4
  add a,7
 ld (de),a
 dec de
 ret
It is just easier for me to understand as a language, I guess.
Title: Re: Really Long Source Code
Post by: Ashbad on March 18, 2011, 01:23:52 pm
Wallball (the old slow assembly version, very unoptimized) was around only 1200 lines.  I look at it now and realized it could drop below 700.
Title: Re: Really Long Source Code
Post by: AngelFish on March 18, 2011, 03:45:09 pm
I don't know if data files count, but the unoptimized and uncompressed map for Black uses 1.5 million polygons and takes 81.5 MB.

As for the longest program I've ever written, it would probably have to be an AI program I wrote in Python that took around 2000 lines.
Title: Re: Really Long Source Code
Post by: FloppusMaximus on March 19, 2011, 12:42:07 am
Mimas is currently 16040 lines, not counting auto-generated files.  That's by far the largest assembly program I've ever written.

How do you people deal with source code when it starts getting over 4000 lines long? I feel like once it starts reaching this length, I start losing time by searching through the code for routines. At these sizes, the scroll bar is almost useless.

etags. :)  And occasionally grep.

And yeah, I'd say 4000 lines is too long for a single source file, no matter what language or editor you're using.
Title: Re: Really Long Source Code
Post by: z80man on March 19, 2011, 12:57:44 am
@FloppusMaximus, by any chance did you ever try assembling Mimas with Mimas. I don't know if it's possible or not with all those macros and stuff, but it would be pretty cool.
Title: Re: Really Long Source Code
Post by: Deep Toaster on March 19, 2011, 10:39:54 am
@FloppusMaximus, by any chance did you ever try assembling Mimas with Mimas. I don't know if it's possible or not with all those macros and stuff, but it would be pretty cool.

I don't think it would fit... It would be cool though.

Mimas is currently 16040 lines, not counting auto-generated files.  That's by far the largest assembly program I've ever written.

How do you get auto-generated files?
Title: Re: Really Long Source Code
Post by: SirCmpwn on March 19, 2011, 10:45:08 am
How do you get auto-generated files?
I don't know about Mimas, but when I have a lot of code to write, I'll generally make a program to write it for me.
Title: Re: Really Long Source Code
Post by: FloppusMaximus on March 19, 2011, 04:02:50 pm
I don't know about Mimas, but when I have a lot of code to write, I'll generally make a program to write it for me.
Exactly.  In this case, there's a Perl script to generate the instruction patterns and rules from a simple text description (which I could have done by hand, but writing a script was easier, and probably less error-prone), and another script to compile the built-in symbols (which involves compressing and sorting them, and there's no way I could have done it by hand.)  Since the results are generated automatically, I don't think those files count as part of the source code.
Title: Re: Really Long Source Code
Post by: DJ Omnimaga on March 24, 2011, 03:50:59 am
I wonder how many lines of code TI-Nspire OS 2.1 has and by how much percentage it would shrink down if 3rd-party OSes were possible and if one of the hardcore TI-Nspire programmers here optimized it? O.O
Title: Re: Really Long Source Code
Post by: Deep Toaster on March 24, 2011, 11:19:09 am
Remember a lot of the extra space 2.1 needed was because of its Chinese character support.
Title: Re: Really Long Source Code
Post by: Quigibo on April 10, 2011, 05:31:23 pm
My editor has an instant search box in the upper right hand corner.  All label names in my program end with a colon so if I want to jump to a label, I just enter the label name plus colon and it instantly jumps to that line.  Very useful for large files.  I also keep other tags like TODO and FIXME around for easy access.  That and general categorization of the code makes it manageable.  I actually find it faster than some of my other projects that I've split into separate files because you don't have to switch back and forth.
Title: Re: Really Long Source Code
Post by: Munchor on April 10, 2011, 05:44:44 pm
Mimas is currently 16040 lines, not counting auto-generated files.  That's by far the largest assembly program I've ever written.

How do you people deal with source code when it starts getting over 4000 lines long? I feel like once it starts reaching this length, I start losing time by searching through the code for routines. At these sizes, the scroll bar is almost useless.

etags. :)  And occasionally grep.

And yeah, I'd say 4000 lines is too long for a single source file, no matter what language or editor you're using.

You win us all.

And @SirCmpwn: Half of the tiDE code (or maybe even more) is code generated by the GUI designer, hence I'm not impressed with 26thousand lines.
Title: Re: Really Long Source Code
Post by: SirCmpwn on April 10, 2011, 06:40:21 pm
And @SirCmpwn: Half of the tiDE code (or maybe even more) is code generated by the GUI designer, hence I'm not impressed with 26thousand lines.
Are you kidding me?  Maybe 1/8th is generated.
Title: Re: Really Long Source Code
Post by: XVicarious on April 10, 2011, 07:55:54 pm
Okay... I'll settle this Visual Studio stuff. I'm gonna count my lines. Once with everything. The other withonly the *.designer.* files.

Everything: 1524
Designer Files: 1178...

So 1178/1524
589/762
77.3% of my visual studio project is Designer code.  Though take into consideration that C# takes up more lines that Basic with all the braces and stuff. So. SirCmpwn. Do a *.Designer.cs search on your project and see what happens.
Title: Re: Really Long Source Code
Post by: Munchor on April 11, 2011, 05:28:55 am
Okay... I'll settle this Visual Studio stuff. I'm gonna count my lines. Once with everything. The other withonly the *.designer.* files.

Everything: 1524
Designer Files: 1178...

So 1178/1524
589/762
77.3% of my visual studio project is Designer code.  Though take into consideration that C# takes up more lines that Basic with all the braces and stuff. So. SirCmpwn. Do a *.Designer.cs search on your project and see what happens.

Maybe, I forgot that tiDE has a giant Assembler, and code for extra classes (like DockPanel and Text Editor).
Title: Re: Really Long Source Code
Post by: SirCmpwn on July 15, 2011, 05:49:10 pm
Update on the size of tiDE:
Total lines of code: 46,778
Total lines of code (non-generated): 40,226  [This means ~86% is manually written]
Total size of source and binaries: 30.6 MB
Size of source alone: 6.86 MB (total size of everything you should have to run tiDE without source)
Number of files: 736
Number of folders: 148

There are 15 projects that contribute to the tiDE code base.  They are:
-Assembly (exposes methods for manipulating assembly files, including assembly and disassembly
-Basic (exposes methods for manipulating TI-Basic files, including tokenization and detokenization)
-Brazil (core z80 emulation library)
-DCS7Design (a graphical designer for DCS7 GUI)
-GenerateTable (one of several programs that assist the other libraries, this one generates a table file for Assembly)
-GenerateTI83PlusIncDocumentation (another assist project, it generates documentation in XML for ti83plus.inc from WikiTI)
-GenerateTIBasicDocumentation (assist project, generates documentation in XML for TI-Basic commands from TI|BD)
-GenerateTIBasicHighlighting (assist project, generates the file that TI-Basic syntax highlighting is based on)
-GenerateZ80CodeCompletion (assist project, generates the z80 documentation that is used for code completion)
-Stetson (TI-83+ emulator)
-TableFileEditor (assist project for manipulating files created by GenerateTable)
-TI Developer API (library for manipulating TI files such as 8xp and 8xk files)
-tiDE (the main interface that ties together all the other projects and provides an IDE)
-Tokenizer (old project that provides some support to Basic)
-WinFormsUI (controls the dock capability of tiDE)
Title: Re: Really Long Source Code
Post by: ben_g on July 16, 2011, 09:02:33 am
A java game I'm working at has 9 files, each with an average of 2000 lines. That's a total of around 18000 lines of java code. And I still have a lot to do.
My largest basic program is almost 700 lines and over 11Kb large, which is large for a basic program which has almost no text in it.
Largest axe program: 40 lines. I haven't coded much in axe...
My largest (and only) asm program is now around 2500 lines, and also with this program, I still have a lot to code. I think I'm abouth halfway thereof the coding part, then I still have to make levels..

I don't think I can beat someone with the lenght of my programs, but maybe with the lenght of routines: My longest ams routine is 798 lines of (unoptimised) code.
Title: Re: Really Long Source Code
Post by: Munchor on July 24, 2011, 09:59:29 am
SirCmpwn, could you make something that loops all folders and all files in a directory and adds all lines? So it's not just for Visual Studio Projects, but for any directory? I wanna count the lines in wxwabbitemu.
Title: Re: Really Long Source Code
Post by: SirCmpwn on July 24, 2011, 02:16:06 pm
Yeah, look back a ways, the program I already posted does this.
Title: Re: Really Long Source Code
Post by: TIfanx1999 on July 24, 2011, 03:41:03 pm
Update on the size of tiDE:
Total lines of code: 46,778
Total lines of code (non-generated): 40,226  [This means ~86% is manually written]
Total size of source and binaries: 30.6 MB
Size of source alone: 6.86 MB (total size of everything you should have to run tiDE without source)
Number of files: 736
Number of folders: 148

There are 15 projects that contribute to the tiDE code base.  They are:
-Assembly (exposes methods for manipulating assembly files, including assembly and disassembly
-Basic (exposes methods for manipulating TI-Basic files, including tokenization and detokenization)
-Brazil (core z80 emulation library)
-DCS7Design (a graphical designer for DCS7 GUI)
-GenerateTable (one of several programs that assist the other libraries, this one generates a table file for Assembly)
-GenerateTI83PlusIncDocumentation (another assist project, it generates documentation in XML for ti83plus.inc from WikiTI)
-GenerateTIBasicDocumentation (assist project, generates documentation in XML for TI-Basic commands from TI|BD)
-GenerateTIBasicHighlighting (assist project, generates the file that TI-Basic syntax highlighting is based on)
-GenerateZ80CodeCompletion (assist project, generates the z80 documentation that is used for code completion)
-Stetson (TI-83+ emulator)
-TableFileEditor (assist project for manipulating files created by GenerateTable)
-TI Developer API (library for manipulating TI files such as 8xp and 8xk files)
-tiDE (the main interface that ties together all the other projects and provides an IDE)
-Tokenizer (old project that provides some support to Basic)
-WinFormsUI (controls the dock capability of tiDE)

Holy crap, that's massive!!!
Title: Re: Really Long Source Code
Post by: Munchor on July 24, 2011, 04:56:29 pm
Today I had the opportunity to read gcc.c and python.c and more files of the source code of GCC and Python.

Python's Source Code is very well organized and very well commented, but GCC is just crazy O.O