flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > A preprocessor for using operators like C-- |
Author |
|
JohnFound 22 Nov 2015, 18:46
C-- compiler?
BTW, assembly language code is not so hard to understand. But like any other language, it needs to be well learned first. |
|||
22 Nov 2015, 18:46 |
|
SergeASM 22 Nov 2015, 20:32
Yes, but while asm programmer writes and debugs one big program, high-level language programmer writes and debugs 100 programs and earns 100 times more money.
|
|||
22 Nov 2015, 20:32 |
|
JohnFound 22 Nov 2015, 22:03
Well, the ratio is far from such numbers. My estimation is that the code creation takes 2 times slower in ASM for small projects and close to 1 for big projects. But notice that the quality of the assembly language programs is much higher.
|
|||
22 Nov 2015, 22:03 |
|
SergeASM 22 Nov 2015, 22:37
Try regexp search/replace in asm then in Perl.
|
|||
22 Nov 2015, 22:37 |
|
JohnFound 22 Nov 2015, 23:52
SergeASM wrote: Try regexp search/replace in asm then in Perl. It is a matter of libraries, not the "level" of the language itself. And who knows how many hours they wrote the library for regexp parsing? For example, FreshLib contains parser for MarkDown-like markup language, so writing web sites that use it is pretty easy. And IMHO, using regular expressions always ruins the quality of the code and is source of bugs. _________________ Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9 |
|||
22 Nov 2015, 23:52 |
|
revolution 23 Nov 2015, 00:35
Repeat this 10 times: Assembly code is not C code.
After one understands that then everything else goes smoothly. Lets' see: If you want C code then perhaps you can write C code and use a C compiler. If you want assembly code then perhaps you can write assembly code and use an assembler. I don't see C coders trying to make their code look like assembly. So why should assembly coders try to make their code look like C? In assembly "ebx++" is simply "inc ebx". |
|||
23 Nov 2015, 00:35 |
|
idle 23 Nov 2015, 17:25
http://www.plantation-productions.com/Webster/HighLevelAsm/hla_examples/index.html ?
edit: i would, despite his odd behaviour sometimes, select z-lang/abakis macro extension by z3n/m3ntal |
|||
23 Nov 2015, 17:25 |
|
SergeASM 24 Nov 2015, 07:48
Thanks, idle, but I want simple replace asm opcodes to "human" operators:
mov - = add - + and - & mul - * ... jmp - goto mov eax,[dd1] add eax,10 cmp eax,100 ja .m1 -> eax=[dd1]; if ((eax+=10) > 100) goto .m1 |
|||
24 Nov 2015, 07:48 |
|
revolution 24 Nov 2015, 08:56
For this line:
eax=[dd1]; You would have to make a macro and/or struc named "eax" and do all the processing inside that. For the next line: if ((eax+=10) > 100) goto .m1 The same applies, a macro and/or stuc named "if". But be aware that fasm also has an internal usage for "if". BTW: You might also be interested in fasmg: http://board.flatassembler.net/topic.php?t=17952 |
|||
24 Nov 2015, 08:56 |
|
JohnFound 24 Nov 2015, 09:23
Quote: Thanks, idle, but I want simple replace asm opcodes to "human" operators: These are not "human" operators. These are "algebraic" actually. The assembly COPs are much more "human" operators because they describe exactly the steps of the data processing. The FASM preprocessor is pretty powerful and can make such things, but this way you will lose all the advantages of the assembly language, without getting any of the advantages of the HLLs. Better learn to think in assembly language and everything will be OK. |
|||
24 Nov 2015, 09:23 |
|
system error 24 Nov 2015, 09:27
This is a kind of brain damage normally caused by a HLL.
|
|||
24 Nov 2015, 09:27 |
|
codestar 29 Nov 2015, 07:41
Quote: idle wrote: i would, despite his odd behaviour sometimes, select ... abakis macro extension Quote: revolution wrote: So why should assembly coders try to make their code look like C? Why create/use macro languages? To make programs fast and easily, for high-volume production, OS portability, easier syntaxes (see example below), for conversion to/from C/C++, for fun, recreation, experimentation, testing algorithms, creating small utilities and games, to access machine code, for knowledge of semantics, for the ability to use BOTH "HL features" in addition to pure assembler and to do things which you can't do with a HL compiler. Using C style macro syntaxes is NOT the same as using a C compiler which doesn't have the power of FASM/G. None of my macros prevent from writing 100% assembler like FreshLib's HL macro language does. IMO, the HL macro language included with FASM - struct, proc, invoke, .if, .while - is old, outdated and should be upgraded. Try writing this in C, it will be much longer. What could be easier than this? Code: ; Easiest file I/O example include 'z.inc' text t(128), f='LOG.TXT',\ s='EXAMPLE TEXT DATA' n=s.$ function main create f ; create file write s, n ; write to current file close ; close after create open f ; reopen read t, n ; read to t say t ; display text close ; close after open execute f ; execute maximize endf |
|||
29 Nov 2015, 07:41 |
|
bzt 28 Nov 2018, 15:07
Sorry for posting in such an old topic, but I've finaly found it!
JohnFound wrote: C-- compiler? The original code was written by Peter Cellik, but his site is gone for long now. Luckily I've found a mirror (hurray ): http://c--sphinx.narod.ru/indexe.htm It turned out the project wasn't dead for a long time (I lost track around version 0.192 when I switched to Linux). It has DPMI and Windows interface, and there are even OpenGL examples written in C--. The project although seems to be dead, latest update is from 2007. Full source of the compiler on GitHub (a mirror from 2016) https://github.com/justdanpo/c--sphinx IMPORTANT NOTE: this is NOT THE SAME C-- that Norman Ramsey wrote. https://en.wikipedia.org/wiki/C-- is a totally different project! Cheers, bzt |
|||
28 Nov 2018, 15:07 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.