flat assembler
Message board for the users of flat assembler.
Index
> DOS > PSR Invaders 1.1 Goto page Previous 1, 2 |
Author |
|
revolution 18 Apr 2019, 07:18
Tomasz Grysztar wrote:
Different binary output, same instruction behaviour. Code: v: test al,ah ; test ah,al mov bx,[v] ;what value do we get here? |
|||
18 Apr 2019, 07:18 |
|
Tomasz Grysztar 18 Apr 2019, 08:47
revolution wrote:
What I had in mind was (perhaps only theoretically possible) program that originally worked correctly despite having some instructions assembled wrongly due to some bug in the tool. I mean: would simulating the bug for the sake of it be then the right thing to do? Depends what our priorities would be. rugxulo wrote: The TASM original is in (ancient, v4?) MASM syntax but has a bug (which TASM ignores). "40:[01ah]", TASM32 ignores the segment while JWasm complains. (Programmer error, PEBKAC.) |
|||
18 Apr 2019, 08:47 |
|
rugxulo 28 Apr 2019, 03:22
(Sorry I'm late in replying.) I'm sure you two are already aware of most of these quirks:
Code: salc ; undocumented aad 16 ; undocumented, allegedly didn't work on NEC V20/V30 clones shl ax,79 ; was it 386+ that first limited the shift value? cmp sp, ax ; you know, that whole 286 cpu check since SP's value after push changed in later cpus loadall ; removed in later cpus Not to mention obvious things like "-22 / 7" (-3? -4?) and "-22 % 7" (-1? 6?). Who's the boss? Who will complain (what will break?) if you get it wrong? What if you have to please two conflicting masters at the same time? And yes, many demoscene codes (and other weird ones like that Befunge-93 interpreter I slightly modified, BEFI) used specific assembler encodings, which is "bad". (I'm sure some people are smart enough to do it successfully, but most of us aren't! It should be avoided, IMHO.) 89h (FASM) vs. 8Bh (TASM), used to do self-modifying (ugh! very slow in modern cpus) to change between "MOV" (no-op, in this particular case) and 0EBh "JMPS". (Again, I don't see the point. Simpler code can avoid that trickery. Maybe on some old machines that would be an ideal solution, but it seems dangerously obtuse. I don't recommend it, but some rare people do know what they're doing, even if obscure.) The simplest solution is often the best. It's best not to rely too highly on specific APIs, OSes, arcane tricks, or tools, especially if they aren't free/libre. (Well, even "standard" code can be ignored, obsoleted, disappear.) If you really, really, really know what you're doing, okay, but ... obvious is better than obscure. |
|||
28 Apr 2019, 03:22 |
|
rugxulo 28 Apr 2019, 03:33
Tomasz Grysztar wrote:
I've never had Windows 10 on any machine. I still don't have any AVX machines. (But I'm no pro, so I don't care.) Yes, WSL sounds great, but I meant in general. I think Cygwin has Wget by default, but I don't know if Windows does (even 10, yet?). macOS has Curl, maybe. (antiX Linux has both.) For DOS, it's easy (especially under VM, see here or here) if you have a working packet driver. There you can indeed use Curl or Links2 or similar. At least, to me, that's the most familiar. For other big OSes, it's probably more than obvious. |
|||
28 Apr 2019, 03:33 |
|
rugxulo 28 Jul 2019, 02:57
rugxulo wrote:
I have rewritten the FASM sed script into both Turbo Pascal and AWK. With the DOS version of TP 5.5, the .EXE is only 5 kb (or 3 kb UPX'd; FPC 3.1.1 snapshot outputs 18 kb or 10 kb UPX'd for Small model). The .PAS source is roughly 4 kb. But, again, it's very ad hoc, so not great overall. It needs to be (even) further simplified, modularized, generalized. The AWK script is roughly 1500 bytes, but I feel much less comfortable there. Still, it works. I may just write a small asm version (obvious, right?). But it's mostly pointless. I'm not sure I'm smart enough to write my own reusable tool here. But it's something I like to think about, to barely pretend to understand. Oh, BTW, guess I'll refresh my latest .BAT here (yet again) for more savings! Quote:
|
|||
28 Jul 2019, 02:57 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.