It is currently Sat Jan 16, 2021 10:23 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Remove unneeded Line MOV if OnError is enabled
PostPosted: Thu Nov 13, 2008 10:51 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 02, 2007 12:11 pm
Posts: 256
Location: Germany
Today I saw that the OnError support adds a MOV statement for every line that has compiled text inside, empty lines and comments are ignored, but not constant definitions, enumerations and structures. Those are static and don't do anything at runtime, I don't think there is a need to add debugging information for them.

I am using PB 4.30 Beta 4.

Examples:
Code:
; #jaPBe_CompilerVersion="4.30 BETA 4"
  MOV    dword [CLN],1
; #jaPBe_IsDebuggerRunning=0
  MOV    dword [CLN],2
; #jaPBe_IsExecute=1
  MOV    dword [CLN],3
; #jaPBe_ExecuteBuild=164
  MOV    dword [CLN],4
; #jaPBe_ExecuteType=0
  MOV    dword [CLN],5
; #jaPBe_OnError=1
  MOV    dword [CLN],6

Code:
; Enumeration
; #MAX_NETWORK = 8
  MOV    dword [CLN],16777218
; #MAX_ADDRESS = 15
  MOV    dword [CLN],16777219
; #MAX_IDENTIFIER = 32
  MOV    dword [CLN],16777220
; #MAX_STRING = 255
  MOV    dword [CLN],16777221
; EndEnumeration
;
; Structure Last
; sIP.s{#MAX_ADDRESS}
  MOV    dword [CLN],16777225
; sResult.s{#MAX_STRING}
  MOV    dword [CLN],16777226
; bPrompt.b
  MOV    dword [CLN],16777227
; lTime.i
  MOV    dword [CLN],16777228
; lUserData.i
  MOV    dword [CLN],16777229
; EndStructure


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 14, 2008 1:13 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 3164
Location: United Kingdom
What would be best is if we could turn this on/off with some kind of compilation switch in the source code.

_________________
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 14, 2008 7:32 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 02, 2007 12:11 pm
Posts: 256
Location: Germany
Good idea, but could it ever happen that such line raises an error that the OnError line would catch? Structures, enumerations and constants are checked on compilation ;-) As you can see in my examples, there is no code generated from those lines.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Nov 14, 2008 7:48 am 
Offline
Addict
Addict

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 3371
If a line that has only a constant on it causes a runtime error then there is a bigger bug to be worried about.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Nov 15, 2008 1:59 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 02, 2007 12:11 pm
Posts: 256
Location: Germany
The thing is, my program has hundreds of Structure and Enumeration lines, more than 6kb unneeded MOV statements are in my executable.

BTW-- It does also take effect on Import(C) statements.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Dec 17, 2008 9:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 02, 2007 12:11 pm
Posts: 256
Location: Germany
With PB 4.30 final I still get hundreds of unneeded MOV statements. I would really like that to be changed :)

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Dec 17, 2008 9:54 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 3164
Location: United Kingdom
I would like it if it didn't create the mov's on effectively blank lines, but also allowed the ability top turn it on/off on normal code lines at will.

_________________
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Dec 29, 2008 7:07 am 
Offline
Addict
Addict
User avatar

Joined: Wed Mar 24, 2004 11:04 pm
Posts: 902
Location: Seattle, USA
Isn't this a bug and not a "feature" ?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye