Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-30 Thread Rugxulo
Hi, On Sun, Jun 29, 2014 at 4:11 PM, dmccunney wrote: > On Sun, Jun 29, 2014 at 4:21 PM, Rugxulo wrote: >> On Sun, Jun 29, 2014 at 1:19 PM, dmccunney wrote: >> >> I think you're mistaking it for ALGOL 60. Because Pascal always had >> I/O built-in to the language (and compiler). That part was al

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-30 Thread John R. Sowden
On 06/29/2014 11:19 AM, dmccunney wrote: > On Sat, Jun 28, 2014 at 8:35 PM, Zbigniew wrote: > >> It was always a bit strange to me, that I had - well, I still have ;) >> - a few quite useful Pascal compilers for such little machine, like >> Commodore 64, and just one C compiler (Power C), which is

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread dmccunney
On Sun, Jun 29, 2014 at 4:21 PM, Rugxulo wrote: > On Sun, Jun 29, 2014 at 1:19 PM, dmccunney wrote: > > I think you're mistaking it for ALGOL 60. Because Pascal always had > I/O built-in to the language (and compiler). That part was always > there, even before ISO got involved. Not in Wirth's or

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Rugxulo
Hi, On Sun, Jun 29, 2014 at 8:02 AM, Zbigniew wrote: > 2014-06-29 14:04 GMT+02:00, Tom Ehlert : > >> Most probably because you use printf(). Most C programs use printf (or sprintf, etc.) a fair bit. Very rarely can you say, "Well, I don't need it." > It seems, not too much I can do about this u

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Rugxulo
Hi, On Sun, Jun 29, 2014 at 1:19 PM, dmccunney wrote: > > There are fundamental language differences to take into account. > > Niklaus Wirth created Pascal as a teaching tool, for teaching > algorithm design. It was originally intended to be "compiled" on > paper, with the teacher grading the qu

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread dmccunney
On Sat, Jun 28, 2014 at 8:35 PM, Zbigniew wrote: > It was always a bit strange to me, that I had - well, I still have ;) > - a few quite useful Pascal compilers for such little machine, like > Commodore 64, and just one C compiler (Power C), which is cumbersome > and hard to work with. C compiler

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Michael B. Brutman
I have noticed quite a few code bloat issues with the Watcom C runtime. For some of the more obscure functions it is often better to write some inline assembly and make the DOS or BIOS call directly than it is to use the corresponding C runtime function. The "stat()" family of functions are a

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Tom Ehlert
>> Most probably because you use printf(). > It seems, not too much I can do about this using Turbo C: > 1. Compilation of "Hello, world!" containing "printf" gave around 370 > bytes for OBJ, and 8.3k for EXE. > 2. The same when replaced "printf" with "puts" gave 6.4k for EXE. puts() is essentia

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Zbigniew
2014-06-29 14:04 GMT+02:00, Tom Ehlert : > Most probably because you use printf(). It seems, not too much I can do about this using Turbo C: 1. Compilation of "Hello, world!" containing "printf" gave around 370 bytes for OBJ, and 8.3k for EXE. 2. The same when replaced "printf" with "puts" gave

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-29 Thread Tom Ehlert
Hallo Herr Zbigniew, am 29. Juni 2014 um 02:35 schrieben Sie: > 2014-06-29 1:13 GMT+02:00, Rugxulo : >> Turbo Pascal has a smartlinker while Turbo C does not. Turbo C linker is about as smart as Turbo Pascal. > Indeed I noticed even earlier, that OBJ is of "decent size" (just a > little more th

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-28 Thread Zbigniew
2014-06-29 1:13 GMT+02:00, Rugxulo : > Turbo Pascal has a smartlinker while Turbo C does not. Actually, I wasn't aware that Pascal compilers are that smart - for example: while searching for some more info, just discovered a Pascal compiler for... 8051, which is very memory-constrained: http://tu

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-28 Thread Rugxulo
Hi, On Sat, Jun 28, 2014 at 8:58 AM, Zbigniew wrote: > 2014-06-28 15:45 GMT+02:00, Mateusz Viste : >> >> About size - you should probably get it down a few KiB by compiling into >> a COM binary. From what I saw, you don't use any memory segments, just >> (plenty of) INT calls, so a COM would fit

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-28 Thread Zbigniew
2014-06-28 15:45 GMT+02:00, Mateusz Viste : > About size - you should probably get it down a few KiB by compiling into > a COM binary. From what I saw, you don't use any memory segments, just > (plenty of) INT calls, so a COM would fit perfectly. Just add -mt -lt to > your tcc call. And since you d

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-28 Thread Mateusz Viste
About size - you should probably get it down a few KiB by compiling into a COM binary. From what I saw, you don't use any memory segments, just (plenty of) INT calls, so a COM would fit perfectly. Just add -mt -lt to your tcc call. And since you don't use any floats, you might also try to pass

Re: [Freedos-user] EMODE - translation from Pascal to C - solved

2014-06-28 Thread Zbigniew
Solved - the problem was in totally different place, than I was looking for it: misdeclaration of variable types in auxiliary function "holeParameter". It should have been look like this: void holeParameter(unsigned char *pzeilen, unsigned char *pspalten, char *argv[]) { unsigned char sp_allowed