Re: [fpc-pascal] Calculating CRC16?

2022-10-25 Thread Marco Borsari via fpc-pascal
On Tue, 25 Oct 2022 08:30:19 +0200 Bo Berglund via fpc-pascal wrote: > Is there some package or code available somewhere which can calculate the > CRC16 > value over a byte array of some 1000 bytes? http://www.retroarchive.org/swag/CRC/index.html -- Simplex sigillum veri _

Re: [fpc-pascal] Interruption handling on i8086

2021-04-10 Thread Marco Borsari via fpc-pascal
Il 09/04/2021 19:56, Guillermo via fpc-pascal ha scritto: Hi pascaloids, I'm doing DOS development for fun and, after installing the compiler (was quite hard), I'm having problems handling interrupts. I have this handler from SWAG, hope it would be helpful. Marco { Unit for reading multiple ke

Re: [fpc-pascal] Archive libraries

2020-08-21 Thread Marco Borsari via fpc-pascal
Il 20/08/2020 17:10, Darius Blaszyk via fpc-pascal ha scritto: To my delight I found out that FPC actually provides quite a few archive handling libraries out of the box. Thanks to all that have contributed to that! So far I found: * tar * tar.gz * zip Are there any other formats out there t

Re: [fpc-pascal] Writing to a drive which may be spun down

2019-11-21 Thread Marco Borsari via fpc-pascal
On Thu, 21 Nov 2019 01:16:16 -0500 Brian wrote: > Hi all, > > Running Ubuntu 18 LTS, I have a console-mode number-cruncher which > writes occasional output files. It works just fine if the output is > directed to a drive which is permanently spun up, but can fail if the > output is directed to a

[fpc-pascal] Documentation typo

2019-02-15 Thread Marco Borsari via fpc-pascal
In the online html documentation, in the Programmer's Guide, at 1.2.4, it reads: "If it is + (the default) then the compiler will only evaluate as many terms as are necessary to determine the result of the complete expression." Obviously it should be "If it is - (the default)" Regards, Marco -- Si

Re: [fpc-pascal] Dos unit for Windows

2019-01-30 Thread Marco Borsari via fpc-pascal
On Wed, 30 Jan 2019 15:14:12 +0100 Marco van de Voort wrote: > Windows attributes can be > 8-bits, see e.g. > https://docs.microsoft.com/nl-nl/windows/desktop/FileIO/file-attribute-constants. But the Dos unit is in Windows for compatibility, if one need the extended attributes there is the equi

[fpc-pascal] Dos unit for Windows

2019-01-30 Thread Marco Borsari via fpc-pascal
Hi all, I have some problem with a file archiver which uses the Dos unit under Windows, I suspect the flaw resides in GetFAttr function. Looking in the source for Win RTL procedure getfattr(var f;var attr : word); var l : longint; s : RawByteString; begin doserror:=0; s:=ToSingleByteFile

Re: [fpc-pascal] Branch table

2018-08-27 Thread Marco Borsari via fpc-pascal
On Sun, 26 Aug 2018 18:32:29 +0200 Florian Klämpfl wrote: > Am 26.08.2018 um 11:43 schrieb Giuliano Colla: > > Il 23/08/2018 11:34, Marco Borsari via fpc-pascal ha scritto: > > > >> It would be for the Wirth optimization in the access of an array, > >> when

Re: [fpc-pascal] Branch table

2018-08-23 Thread Marco Borsari via fpc-pascal
On Thu, 23 Aug 2018 09:32:58 +0200 Florian Klämpfl wrote: > Am 21.08.2018 um 11:42 schrieb Marco Borsari via fpc-pascal: > > Il 20/08/2018 17:32, Giuliano Colla ha scritto: > > > >> On the Intel architecture you cannot perform pointer arithmetic as if a > >> p

Re: [fpc-pascal] Branch table

2018-08-21 Thread Marco Borsari via fpc-pascal
Il 20/08/2018 17:32, Giuliano Colla ha scritto: On the Intel architecture you cannot perform pointer arithmetic as if a pointer were just a number. A pointer is composed of two parts: a "selector" and an "offset", which must be handled separately. Ah, I saw, 32 bit segmentation is quite compli

Re: [fpc-pascal] Branch table

2018-08-18 Thread Marco Borsari via fpc-pascal
Il 17/08/2018 18:04, Giuliano Colla ha scritto: I modified your code, to add a jump table (as it is in the example you mention) I came to that program branch; {$ASMMODE intel} label tab,stop,a,b,c; var idx:byte; begin write('Index? '); readln(idx); asm xor eax,eax; mov al,idx; shl ax,2; mov e

Re: [fpc-pascal] Branch table

2018-08-18 Thread Marco Borsari via fpc-pascal
Il 17/08/2018 18:04, Giuliano Colla ha scritto: Enjoy programming! Giuliano Thank you! ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Branch table

2018-08-17 Thread Marco Borsari via fpc-pascal
Il 16/08/2018 17:40, Giuliano Colla ha scritto: The first thing I notice is that you load BX, which is a 16 bit register (the lower 16 bits of EBX), with the value of "next", and then Jump to the content of EBX which is a 32 bit register, whose lower 16 bits have been loaded but whose upper 16 b

[fpc-pascal] Branch table

2018-08-14 Thread Marco Borsari via fpc-pascal
Why the code below does exit gracefully without prints anything? Sure, it is for my poor knowledge of the assembler, but in some details, please... program branch; {$ASMMODE intel} label next,stop,a,b,c; var idx:byte; begin write('Index? '); readln(idx); asm mov ax,idx; shl ax,2; mov bx,next; a