Deprecated: Array and string offset access syntax with curly braces is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Subs.php on line 3825
TFile2ASM - Makes your data into PB-Code

Author Topic: TFile2ASM - Makes your data into PB-Code  (Read 6575 times)

0 Members and 1 Guest are viewing this topic.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 948
  • User-Rate: +30/-4
    • it-berater
TFile2ASM - Makes your data into PB-Code
« on: June 12, 2009, 12:08:46 PM »
Many will know Hutch popular PB-Tools from


one of them is his "File2ASM".

Its worth a look!

I used it quite often, but had the need for something that would work without an surface and had no Limitation on 1.5 MB.
So I made my own, based on his.

I have added Hutchs "File to ASM Tool" as an alternative.


It will look in its EXE.PATH$ for a INI-File like this:

TFile2ASM.ini
Code: [Select]
[CustomData]
Input-Filename=Neu Textdatei.txt
Output-Filename=YourFunc.inc
Func-Name=b2b_()

and then just generate the code using Hutch's original idea - with a minor improvement (One JMP less then in Hutch's code!  ;D).


If i take the same RAW-Data, here is what both programms generate:


Here is the Output from TFile2ASM:

Code: [Select]
FUNCTION b2b_() AS STRING

   LOCAL S01 AS STRING
   LOCAL T01 AS LONG

   S01 = SPACE$(54)
   T01 = CODEPTR(L43543_9686)

   ! cld
   ! mov ecx,54
   ! mov esi, T01
   ! mov edi, S01
   ! rep movsb

 FUNCTION = S01
 EXIT FUNCTION

 L43543_9686:

  ! db 49,50,51,52,53,54,55,56,57,49,50,51,52,53,54,55,56,57,49,50,51,52,53,54,55,56,57,49,50,51,52,53,54
  ! db 55,56,57,49,50,51,52,53,54,55,56,57,49,50,51,52,53,54,55,56,57

 END FUNCTION   


Code from Hutch's File2ASM


Code: [Select]
FUNCTION Read_BC0A9E5() as STRING

  ' ~\Neu Textdatei.txt 54 bytes(decimal)

  ! jmp end_BC0A9E5

start_BC0A9E5:
  ! db 49,50,51,52,53,54,55,56,57,49,50,51,52,53,54,55
  ! db 56,57,49,50,51,52,53,54,55,56,57,49,50,51,52,53
  ! db 54,55,56,57,49,50,51,52,53,54,55,56,57,49,50,51
  ! db 52,53,54,55,56,57
end_BC0A9E5:

    LOCAL Dest  as STRING
    LOCAL lpLbl as LONG

    Dest  = space$(54)
    lpLbl = CodePtr(start_BC0A9E5)

      ! cld
      ! mov ecx, 54
      ! mov esi, lpLbl
      ! mov edi, Dest
      ! rep movsb

    FUNCTION = Dest

END FUNCTION

[Update-Notice:Updated the attached file on 14.06.2009, due to speed improvements.]
« Last Edit: November 18, 2014, 10:25:41 AM by Theo Gottwald »

Offline Steve Hutchesson

  • Jr. Member
  • **
  • Posts: 83
  • User-Rate: +6/-5
    • The MASM Forum
Re: TFile2ASM - Makes your data into PB-Code
« Reply #1 on: December 07, 2009, 02:33:02 AM »
Hi Theo,

I got it to work once I understood the INI file, runs fine and seems to be fast enough. Tell me this much, why do you use the INI file instead of a normal command line or alternatively in an interface ?

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 948
  • User-Rate: +30/-4
    • it-berater
Re: TFile2ASM - Makes your data into PB-Code
« Reply #2 on: December 07, 2009, 06:37:30 AM »
Quote
why do you use the INI file instead of a normal command line or alternatively in an interface ?

In my project the pathes are too long. A command line has a limited lenght.
As i always use the same input files, a fixed INI File was the best sollution in that case.
Also its possible to write error-messages back into the ini-file.

Think of a (CPU-uOps-)Pipeline. On the left side is all the source code and binaries.
On the right side is the complete result, even the tests run automatically.

This tool has been designed, to work as an integrated and invisible part of a production "pipeline", not as a standalone Sollution.
Thats why i have choosen an INI.

And that was the only reason why i had to replace your smart tool. Your tool was designed as a standalone sollution.



Offline Aslan Babakhanov

  • Newbie
  • *
  • Posts: 24
  • User-Rate: +5/-3
Re: TFile2ASM - Makes your data into PB-Code
« Reply #3 on: July 26, 2013, 11:54:09 AM »
Theo,

You might be interested in CCI (Common Conversion Interface) tool.
http://www.powerbasic.com/support/pbforums/showthread.php?t=46389

You can add your own conversion functions and use one GUI

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 948
  • User-Rate: +30/-4
    • it-berater
Re: TFile2ASM - Makes your data into PB-Code
« Reply #4 on: July 27, 2013, 02:42:36 PM »
Hallo Aslan,

thats  good idea, to put all that stuff in one bag. So we do not need to have so many utilities around.

Download CC-Tool