flat assembler
Message board for the users of flat assembler.

Index > Main > Converting Pascal to pure assembler

Thread Post new topic Reply to topic

Joined: 24 Jun 2004
Posts: 20
prino 21 Mar 2017, 16:25
Hi all,

Sometime ago, like around April 1994, I wrote the first version of the program that processes my hitchhike data, using Turbo Pascal V3.01a. Over the years it evolved, and the current version is written in Virtaul Pascal V2.79... Actually, it compiles with that compiler, but I recently finished converting the last remnants of Pascal into in-line assembler (and that caused the linecount to exceed 32,767, revealing a bug in the compiler in the generation of the assembler listing... But I digress)

Obviously the final step would be to completely abandon Pascal, and go to pure assembler, which would allow me to more fully use the instruction set of modern CPUs (VP goes up to the Pentium, so I've had to add rather a lot of "db" sequences to add MMX code, the format of the data I'm processing lends itself very well to using those instructions. Venturing into XMM would only be useful to avoid MMX vs FPU dependencies as the program (still) uses tiny bits of FPU code, which would be hard to replace by integer code due to the fact that the magnitudes of the data processed by the FPU vary greatly, and so far I've been unable to come up with a way to scale the four variables involved in such a way that performing the calculation with pure integer operations delivers the same result.

The other, far more obvious, issues are the dependency on the VP RTL. I've managed to trim these back to the minimum, but there are still 87(!) of them left, many used by other RTL routines, and among them a few pretty obvious ones like the setting up of the Windows run-time environment, command-line handling, memory management and, not in the least, I/O, and that's where I'm rather stumped, so the question is, are there any ***simple*** programs you can point me to that handle a few of those tasks?

Robert AH Prins
robert dot ah dot prins at the big account from Google Wink
Post 21 Mar 2017, 16:25
View user's profile Send private message Visit poster's website Reply with quote
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 20203
Location: In your JS exploiting you and your system
revolution 21 Mar 2017, 16:40
The fasm file 'system.inc' handles many of those things. And it comes in various forms for different OSes and linkers.
Post 21 Mar 2017, 16:40
View user's profile Send private message Visit poster's website 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 © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.