flat assembler
Message board for the users of flat assembler.
Index
> MenuetOS > Tinypad improvements, etc |
Author |
|
pelaillo 28 Jul 2004, 14:02
Very good job !!
-- A little suggestion for the gui objects: using meaningful constants (and macros) could ease readability and permit reducing comments. |
|||
28 Jul 2004, 14:02 |
|
Wishing 29 Jul 2004, 04:45
Reduceing comments in Assembly source code... is probably not something
anyone in their right mind should suggest I agree that the comments in that source arent very complete... they should be more organized and explained. Comments in a language as coarse as assembly are a must. Without them, coming back to that source... after a few months or so.. it would take me weeks to figure out how it worked... The GUI.INC is not finished... There are some more local methods i need to write for the textboxes... one being a thing to return the current string pointer. Another being a way to activate and de activate the textbox... another possibly to turn on or off capitols... with the macros idea, I would like to try it.. however i have not found a webpage listing available FASM syntax for macros.. and what things can an cannot be done... I tend to stay away from such things as to improve portability... As far as constants go.. what constants could there be? The code is very object oriented... pointers to pointers and such... things are so fluid and dynamic that i dont see what constants could come about? what things woud be constant across a range of textboxes? I did once try to make local constants that took the given textbox data and shuttled it to local variables... this proved difficult... it also wastes space and memory... adds excess code... with skill and thoughtfulness one can shuttle registers and stack stuff around so as to do any work needed. Please, I am open for any suggestions as on how to improve my code.. my coding style.. or the logic behind my code... though i am happy that someone likes it... considering i started ASM coding only a few months ago Wishing _________________ 446f6c7068696e |
|||
29 Jul 2004, 04:45 |
|
pelaillo 29 Jul 2004, 12:36
Comments are a good thing, so one should take specially care. Let me explain better:
Code: ;LOCAL METHODS -------------- shiftback: ;push edi mov edx,edi mov edi,[edx+28] ;get address of string add edi,[edx+16] ;add to it the cursor position mov esi,edi ;copy it to start position inc esi ;inc the end position mov ecx,dword [edx+32] ;max char length add ecx,2 ;adjust 2 bigger ;mov ecx,43 - the above two lines replaced this sub ecx,[edx+16] cld rep movsb ;pop edi ret And this is the suggestion: Code: ;LOCAL METHODS -------------- shiftback: ;push edi mov edx,edi mov edi,[edx+TEXTOBJ.text] add edi,[edx+TEXTOBJ.cursor_pos] mov esi,edi inc esi mov ecx,dword [edx+TEXTOBJ.max_size] add ecx,2 ;adjust 2 bigger ;mov ecx,43 - the above two lines replaced this sub ecx,[edx+TEXTOBJ.cursor_pos] cld rep movsb ;pop edi ret Please note that some comments such as "add to it the cursor position" are superfluous because are easy to grab it from source. Constants replaces hardcoded numbers, so you easily change offsets without revising the entire source code (and risking to forget some one). Constants are replaced by numbers in preprocessing stage, so the code result is the same in both cases, in other words, no memory consumption. Please consider that no criticism is intended. I like your job and I wanted to help. |
|||
29 Jul 2004, 12:36 |
|
Wishing 30 Jul 2004, 06:23
Comments like 'add it to the cursor position' are not superflouous at all...
if you had not looked up that the offset of 16 bytes was the cursor you mihgt not know if there was not a comment to help things like 'adjust it 2 bigger' are superflous I like your ideas and how they make things more flexible... but the code that you did not include is the code i cannot find info on and do not know how to make work. IE.. the macro language of FASM... i dont know how to make those blah.blah references to addresses with the exception of makin each one indivudually... Also... where would this macro code go? In GUI.INC? no criticism intended? what good would you be doing if you did not criticise... its DESTRUCTIVE criticism that noone wants to hear By all means i appreciate your help Wishing _________________ 446f6c7068696e |
|||
30 Jul 2004, 06:23 |
|
Wishing 02 Aug 2004, 06:45
I have discovered a bug with tinypad's new textboxes... it has to do with the filename length not being updated by the textboxes... I have fixed it and some other minor problems.... I will upload
the new sources ASAP. Also GUI.INC will have some improvements made. first versions arent perfect Wishing |
|||
02 Aug 2004, 06:45 |
|
Wishing 05 Aug 2004, 07:05
Ok... ive fixed a bunch of bugs in Tinypad and the GUI.INC file
Ive decided to rename GUI.INC to TXBOX.INC since thats the only thing in it. I feel that any gui stuff shouldnt be lumped together in one file... this alows coders to pick and choose and link what they need whilst leaving out unneeded extras. Also... Tinypad now has a 3rd plugin that alows you to adjust all the colors. I find that a black background with green text works nicely... The ability to switch from code mode to text mode has also been added In TXBOX.INC (formorly gui.inc) the ability to set the focus of the textbox has been added... this is accompanied by a method to do so. Also the ability to highlight certain text portions in the text box is added. Given the start character and the length in a packed int, highlighting can be done. The highlight color cant be set (this is trivial). A bug was fixed where the textbox never updated its own string length has been fixed... however there are no methods to retrieve them, besides offset access. A new code block for organizing events and return values has been added to the textboxs. There is a bug however... in Tinypad.. I am not sure exactly where this stems from. it occurs when writing is done to the HD... the file is cut up and wrapped around itself badly. I belive that this is due to my old kernal. version 76 (im having trouble with kernal 77 on my lappy, anyone got one that works on toshiba?). I do not think it is my code or any in tinypad. If others can test this version of tinypad with the file IO/saving/opening on different kernals and report bugs back it would be greatly appreciated. two more dwords added to Textbox datablocks.. not backwards compatable... so dont try and use TXBOX.INC with old apps that had old textboxes... without changing them. Wishing
_________________ 446f6c7068696e Last edited by Wishing on 08 Sep 2004, 07:07; edited 1 time in total |
|||||||||||
05 Aug 2004, 07:05 |
|
Wishing 05 Aug 2004, 07:08
oh... forgot one thing... three new key commands have been added to the text boxes...
ctrl+s moves the start of highlighting to the current cursor positon ctrl+e extends the end of the highlighting length ctrl+d shortens the end of highlighting length support for home key works... however end key doesnt work... fix it if you can... |
|||
05 Aug 2004, 07:08 |
|
Esteban 12 Aug 2004, 01:52
When I create a new file and I save(In ramdisk and in hard disk) It and reload I lose my file, I have screenshots, I'll post It later.
PD: Conditions(MeOs 0.77, P166 64 RAM HD 1.2 GB only width Menuet Os, the tinypad.asm wasn´t in the ramdisk then it not load at the start of the program) (Sorry my english is bad ) |
|||
12 Aug 2004, 01:52 |
|
Wishing 12 Aug 2004, 06:14
As i said... there are bugs to do with saving files... especially to HD.
I have gone over the code for saving the file many times... and i cannot find a reason why it wont save... the code that actuall saves the file is just a system call (5... sometimes i have had luck with using full filenames: /rd/1/test.asm instead of test.asm and vice versa. Tinypad is coded atm to load its own source automatically... you can change it and recompile.. the file name is at the bottom of tinypad.asm, if you change it.. dont forget to also change the filename LENGTH. If anyone can track down the reason for the file saveing bug... please tell me, even if it is not a solution. Wishing _________________ 446f6c7068696e |
|||
12 Aug 2004, 06:14 |
|
Wishing 14 Aug 2004, 06:14
NOTE: After some testing i discovered that if you press 'save' TWICE each time.. this problem does not occur... i do not know the cause... the first time it saves only parts of the file in choppped up pieces... i suspect this i a kernal issue... the second time its saved fully
|
|||
14 Aug 2004, 06:14 |
|
jdmarks 23 Aug 2004, 01:01
Has anyone found the problem and corrected it yet?
|
|||
23 Aug 2004, 01:01 |
|
Wishing 24 Aug 2004, 05:44
Nope... I havent found the cause... but i am starting to see a patern in the occurences of the problem... sometimes switiching to systree save by putting /rd/1/ in front of the filename helps... sometimes pushing the save button twice helps...
I am working on it.. and a few other aspects of Tinypad. Features to look forward to: 1. color change panel 2. asm/text plugin 3. auto jump to error line in asm files with or without debug board. Wishing ps.. if anyone feels like tackling that save bug.. be my guest... _________________ 446f6c7068696e |
|||
24 Aug 2004, 05:44 |
|
bloglite 29 Oct 2004, 12:09
Any new developments in tinypad?
are you using FASM 1.54 or an earlier version? New distro soon. to: Wishing & Ivan.............Thanks for all the improvements. G'day, Mark |
|||
29 Oct 2004, 12:09 |
|
drramble 16 Nov 2004, 10:52
Has anyone found where the file save bug comes from?
I still can't get ftps to work properly on file saving, despite some code fiddling (but I'm a bit out of practise with assembler). If someone can point me in the right direction to track it down, it would help quite a few projects ATM. Keep up the good work everyone! DrRamble |
|||
16 Nov 2004, 10:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.