flat assembler
Message board for the users of flat assembler.

flat assembler > IDE Development > [BUG] FASM DOS IDE - CTL-BREAK, ZERO & UP-DIR issues

Author
Thread Post new topic Reply to topic
DOS386



Joined: 08 Dec 2006
Posts: 1904
. . .

. . .

1.69.31, new bugs discovered (does not necessarily mean that the bugs have been also recently introduced, though):

1. CTL-BREAK inserts a space into the text. When saved however, there is no space, but ZERO on that place. (STATUS: PATCH PENDING)

Solution: insert nothing, or a proper space, or something else ("!")

2. When loading a file containing ZERO values, it aborts just at the earliest ZERO. (STATUS: OPEN)

Solution: convert ZERO values into something else ("!")

3. UP-DIR hangs in some special cases. Regrettably I could not find a "100% fail" steps to reproduce. Especially adding older versions into the DIR (to test where it broke) makes the problem vanish Sad (STATUS: PROBABLY FIXED 2016-Jul)

Wishlist:

- Report total text size in Byte's in the bottom bar
- Progress indicator for load and save (with 4 KiB block size it's quite slow)
- Add a "no undo" mode (allowing to edit bigger texts) (done)

http://board.flatassembler.net/topic.php?t=17366 (absurdly long lines and CTL-BREAK, both fixed)
http://board.flatassembler.net/topic.php?t=11061 (garbage text, fixed)
http://board.flatassembler.net/topic.php?t=10302 (beer, drunk & fixed)
http://board.flatassembler.net/topic.php?t=10078 (S&R, fixed, not BUG)
http://board.flatassembler.net/topic.php?t=9925 (memhog, S&R, fixed, almost)
http://board.flatassembler.net/topic.php?t=9910 (files, done)
http://board.flatassembler.net/topic.php?t=9679 (calc, done)
http://board.flatassembler.net/topic.php?t=9494 (1'000'000'000, my fork)
http://board.flatassembler.net/topic.php?t=7459 (???, partially done)
http://board.flatassembler.net/topic.php?t=6626 (2007-Jan, 2 bugs + misc)


Last edited by DOS386 on 12 Jul 2016, 17:21; edited 3 times in total
Post 21 Feb 2011, 07:37
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6876
Location: Kraków, Poland
DOS386 wrote:
2. When loading a file containing ZERO values, it aborts just at the earliest ZERO.

Solution: convert ZERO values into something else ("!")
This one is intentional - fasm always treated zero byte the same as EOF, and so fasm's editors do the same.
Post 16 Jun 2012, 08:15
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Tomasz Grysztar wrote:
This one is intentional - fasm always treated zero byte the same as EOF, and so fasm's editors do the same.


Some systems use CTL-Z for the very same purpose Very Happy But please look at the others, that are probably not intentional.
Post 16 Jun 2012, 08:38
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1388
Location: Toronto, Canada
Why would anyone need zero byte in text file?
Post 16 Jun 2012, 12:52
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
AsmGuru62 wrote:
Why would anyone need zero byte in text file?


It's NOT about need ... it's about text files that may contain ZERO's for whatever obscure reason ... and they are getting truncated silently, so I still think that this behavior (of FASM, INFOPAD, and maybe more) is bad, and an editor should convert the incoming ZERO's (and other faulty values) into something (space, "{ZERO}", "\0" or whatever) less bad.

I got a PM from AsmGuru62 and I see no point making the thing secret:

> To: DOS386
> Posted: 04 Apr 2013, 12:28
> Subject: Does FreeDOS have a good FASM IDE?
> Hi,
> I am aware that FASM package (for MS-DOS) includes a DOS IDE,
> but is there anything more advanced?

Probably NO. But what features do you miss ?

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 10 Apr 2013, 12:03
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1388
Location: Toronto, Canada
I never actually code for DOS anymore.
I was thinking maybe others need something.
Post 10 Apr 2013, 21:54
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Code:
; FASMD.ASM 129'101 2016-02-05 21:53 ; BD16'46BE'4E25'9B42'3620'8730'BB22'B45F ; flat assembler IDE for DOS/DPMI ; Copyright (c) 1999-2016, Tomasz Grysztar. ; All rights reserved. browser_directory_ok: cmp byte [buffer+1],':' jne browser_drive_ok ; FWD mov dl,[buffer] sub dl,'A' cmp dl,'Z'-'A' jbe browser_change_drive ; FWD sub dl,'a'-'A' browser_change_drive: mov ah,0Eh int 21h browser_drive_ok: push 0 ; PUSH here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< cmp dword [buffer],'..' jne name_to_select_ok ; FWD mov edi,buffer+3000h mov al,'\' find_last_directory_name: mov esi,edi repne scasb cmp byte [edi],0 jne find_last_directory_name ; HANG here <<<<<<<<<<<<<<<<<<<<<<<< lea ecx,[edi-1] sub ecx,esi mov edi,buffer+400h mov [esp],ecx mov ebx,upper_case_table get_name_to_select: lodsb xlatb stosb loop get_name_to_select ; BCK SMALL LOOP name_to_select_ok: mov edi,buffer+3000h call get_current_directory jc browser_drive_invalid ; JUMP OUT here <<<<<<<<<<<<<<<<<<<<<<<< cmp byte [edi-2],'\' je browser_new_path_ok ; FWD mov word [edi-1],'\' browser_new_path_ok: call make_list_of_files call draw_browser_path mov ebx,filename_buffer xor eax,eax mov [ebx+8],eax mov [ebx+12],eax mov [ebx+16],al mov ebx,boxes mov esi,[file_list] mov [ebx+12],esi mov ecx,[file_list_buffer_top] sub ecx,esi shr ecx,2 mov [ebx+6],cx xor eax,eax mov [ebx+8],eax mov eax,esi pop edx ; POPE here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< find_name_to_select: cmp eax,[file_list_buffer_top] je file_list_selection_ok ; FWD mov esi,[eax] add esi,2 mov edi,buffer+400h mov ecx,edx repe cmpsb je select_directory ; FWD add eax,4 jmp find_name_to_select ;------------------------- select_directory: sub eax,[file_list] shr eax,2 mov [ebx+8],ax file_list_selection_ok: test byte [filename_buffer+1],1 jnz activate_file_input ; BCK jmp activate_file_browser ; BCK ;--------------------------- browser_drive_invalid: mov dl,[buffer+3000h] sub dl,'A' cmp dl,'Z'-'A' jbe browser_restore_drive ; FWD sub dl,'a'-'A' browser_restore_drive: mov ah,0Eh int 21h pop eax jmp file_list_selection_ok ; BCK ;----------------------------


I've now isolated the UP-DIR-BUG and discovered one more potential BUG.

UP-DIR, whether triggered by clicking the ".." or by the [DEL] key, hangs sometimes (not always, unfortunately).

It hangs inside the "find_last_directory_name" loop. I suspect some sort of uninitialized variable or buffer.

Also, there is a PUSH ... POP section of code, and a JUMP OUT maybe leaving the ZERO on the stack.

Hope it can be fixed now.

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 12 Jul 2016, 05:01
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6876
Location: Kraków, Poland
DOS386 wrote:
It hangs inside the "find_last_directory_name" loop. I suspect some sort of uninitialized variable or buffer.
You are right - ECX is uninitialized there. Please try with the correction I uploaded (it's added "or ecx,-1" after "mov al,'\'" instruction).
Post 12 Jul 2016, 07:02
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Tomasz Grysztar wrote:
ECX is uninitialized there. Please try with the correction I uploaded (it's added "or ecx,-1" after "mov al,'\'" instruction).


Great ... UP-DIR-BUG fixed after just 2 hours Smile (I'll test)

What about the possible stack-BUG?
Post 12 Jul 2016, 08:21
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6876
Location: Kraków, Poland
DOS386 wrote:
What about the possible stack-BUG?
There should be no problem there, "pop eax" does the cleanup.
Post 12 Jul 2016, 09:02
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
> "pop eax" does the cleanup

I see -> CLOSED:INVALID Sad
Post 12 Jul 2016, 09:31
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Code:
; Patch for the CTL-BREAK-BUG wait_for_input: call update_clock mov ah, $11 int $16 jz wait_for_input ; No key mov ah, $10 int $16 ; AL ASCII code | AH scan code test ax, ax ; CMPNTQ AX, ZERO jz wait_for_input ; NOT valid, most likely [CTL]-[BREAK] ret ;----


Also the CTL-BREAK-BUG is very easy to fix.
Post 12 Jul 2016, 17:00
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 6876
Location: Kraków, Poland
OK, these two lines do not hurt. Wink Added.
Post 12 Jul 2016, 18:52
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
Great ... another 2 hours later another 10 years old BUG is killed. Smile

Last known BUG for now (NOT recently retested): FASM IDE aborts loading if the incoming file contains a ZERO, file is loaded incompletely and after re-save truncated. IMHO ZERO (and maybe $1A EOF and other possible faulty values) should be handled some better way:
- turn them into spaces
or
- completely reject the file
Post 13 Jul 2016, 14:52
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 2004-2018, Tomasz Grysztar.

Powered by rwasa.