flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
mikegonta 21 Nov 2008, 21:35
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:55; edited 2 times in total |
|||
![]() |
|
Tomasz Grysztar 21 Nov 2008, 21:44
Check out the Sphinx C-- project.
|
|||
![]() |
|
mikegonta 22 Nov 2008, 12:31
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:55; edited 1 time in total |
|||
![]() |
|
baldr 22 Nov 2008, 14:49
mikegonta,
For simple instructions like add eax, ebx notation is obvious, but what about more complex one (CISC, heh? ![]() By the way, eax = BYTE *ptr; and movzx eax, BYTE [ptr] aren't equivalent, are they? May be eax = *(unsigned BYTE *)&ptr;? ![]() |
|||
![]() |
|
mikegonta 22 Nov 2008, 15:36
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:55; edited 1 time in total |
|||
![]() |
|
mikegonta 22 Nov 2008, 18:09
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:56; edited 2 times in total |
|||
![]() |
|
revolution 22 Nov 2008, 18:12
The ADC looks very problematic. One needs to be careful about opcode reordering due to optimisation steps. Remember that x86 has a fixed assignment of which opcodes update the flags, so the carry can easily become overwritten by intervening instructions.
|
|||
![]() |
|
mikegonta 22 Nov 2008, 18:26
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:56; edited 1 time in total |
|||
![]() |
|
revolution 22 Nov 2008, 18:32
mikegonta wrote: However since all operators have equal precedence the ordering is completely under the programmer's control. Code: eax += ebx - ecx; Code: // which would translate to add eax, ebx sub eax, ecx But what about: Code: eax += ebx - ecx * edx + esi; |
|||
![]() |
|
baldr 22 Nov 2008, 19:14
mikegonta,
OK, let's make it straight: ptr in your example is constant or variable? void * const ptr = 0xB8000; or void *ptr; (not strictly correct, but enough to catch the difference)? Terse appears to be too terse ![]() mikegonta wrote: I would prefer the functions to be spelled out instead of mnemonic: Code: exchange equ xchg pushAll equ pusha ![]() I think, verbosity of pure assembly is a merit, not flaw. You can use macros to automate repetitive tasks, for example to define new instruction mov sreg2, sreg1 having opcode 000sr110 000sr111 with side-effect of setting [sp-2] ![]() revolution, I thought Mike was about new syntax for instructions, not granting compiler right to evaluate run-time expressions… |
|||
![]() |
|
revolution 22 Nov 2008, 19:28
baldr wrote: I thought Mike was about new syntax for instructions, not granting compiler right to evaluate run-time expressions… Code: eax += ebx - ecx; |
|||
![]() |
|
mikegonta 22 Nov 2008, 19:34
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:56; edited 1 time in total |
|||
![]() |
|
mikegonta 22 Nov 2008, 19:39
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:57; edited 1 time in total |
|||
![]() |
|
mikegonta 22 Nov 2008, 19:43
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:57; edited 1 time in total |
|||
![]() |
|
revolution 22 Nov 2008, 19:44
mikegonta wrote: So |
|||
![]() |
|
mikegonta 22 Nov 2008, 19:49
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:57; edited 1 time in total |
|||
![]() |
|
baldr 22 Nov 2008, 19:54
mikegonta,
OK, compound assignment (op=) should be banned as counter-intuitive (consider eax –= ebx – ecx; ![]() edx:eax = eax * r/m32? I'm not nit-picking. To describe most of useful instructions it will take several lines (if not pages) of C-like pseudocode. New syntax only for a few instructions? Does it worth efforts? |
|||
![]() |
|
mikegonta 22 Nov 2008, 20:18
[ Post removed by author. ]
Last edited by mikegonta on 28 Jan 2009, 08:58; edited 1 time in total |
|||
![]() |
|
baldr 22 Nov 2008, 21:06
mikegonta,
"Merely notation shortcut"? In C expr1 += expr2 is semantically different from expr1 = expr1 + expr2 eax -= ebx - ecx compiled as eax -= (ebx + ecx) will be unpleasant surprise for almost any C programmer. Can rcl qualify as simple instruction? ![]() Why don't use postfix notation? It's unambiguous and you'll end up with another FORTH compiler… ![]() Jokes aside, may be you should try to write specification for that syntax (just syntax, i.e. rules for statement composition, for a small subset of instructions of your choice)? It's not easy to develop consistent yet simple to use syntax. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.