flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > only xor, only add and only sub |
Author |
|
uri 19 Aug 2005, 09:45
Look at this 3 different but identical programs:
Code: org 100h ptr fix ; for fasm xor word ptr [0106h],6530h xor byte ptr [bp-33h],10h xor word ptr [0110h],13F0h xor al,04 xor word ptr [0118h],0AF89h xor sp,[bp+03] xor word ptr [0127h],1F13h xor word ptr [011Bh],3C6Ah xor cl,0EEh xor word ptr [0136h],54A7h xor word ptr [012Ah],3C6Ah xor al,0BAh xor word ptr [0144h],44C3h xor word ptr [0138h],3C6Ah xor word ptr [bx+di],0FFD4h xor word ptr [0153h],0BB90h xor word ptr [0147h],3C6Ah xor word ptr [bp+di-56h],0EFE2h xor word ptr [0164h],7E73h xor word ptr [0158h],3C6Ah xor bp,[01B4h] xor word ptr [0174h],644Ch xor word ptr [0168h],3C6Ah xor word ptr [bp+si+58h],0CE74h xor word ptr [0185h],5EF9h xor word ptr [0179h],3C6Ah xor al,7Eh Code: org 100h ptr fix ; for fasm add word ptr [0106h],05AEh add cl,[10CDh] add word ptr [0110h],7BC0h add al,9Ch add word ptr [0118h],4EB8h add bh,[bp+di+3] add word ptr [0127h],0EB8Eh add word ptr [011Bh],046Ah add ax,0EE03h add word ptr [0136h],0DA8Fh add word ptr [012Ah],046Ah add al,14h add word ptr [0144h],0B4BDh add word ptr [0138h],046Ah add ax,0FFD4h add word ptr [0153h],0C191h add word ptr [0147h],046Ah add byte ptr [0E2AAh],0EFh add word ptr [0164h],1A3Dh add word ptr [0158h],046Ah add si,[01B4h] add word ptr [0174h],8F4Ah add word ptr [0168h],046Ah add word ptr [bx+7458h],0FFCEh add word ptr [0185h],24C9h add word ptr [0179h],046Ah add al,0FCh Code: org 100h ptr fix ; for fasm sub word ptr [0106h],2A79h sub [10CDh],di sub word ptr [0110h],0A268h sub al,0BAh sub word ptr [0118h],8873h sub ax,0352h sub word ptr [0127h],149Ah sub word ptr [011Bh],2396h sub ax,0EE03h sub word ptr [0136h],0B599h sub word ptr [012Ah],2396h sub al,0A4h sub word ptr [0144h],0CEEBh sub word ptr [0138h],2396h sub ax,[si-2Ch] sub word ptr [0153h],6672h sub word ptr [0147h],2396h sub word ptr [0E2AAh],0FFEFh sub word ptr [0164h],3DE9h sub word ptr [0158h],2396h sub [bp+01B4h],cx sub word ptr [0174h],97B3h sub word ptr [0168h],2396h sub byte ptr [bp+7458h],0CEh sub word ptr [0185h],155Fh sub word ptr [0179h],2396h sub al,36h Do you ou like it? Files for creating code, which contains only xor, only add or only sub commands(random.inc, xor.inc) and examples (add.asm, sub.asm, xor.asm, effect.asm), are in an attach.
be careful, this macro is beta and must have bugs. if you have questions - post it here. i'll try to write article about it, but don't sure that it can be done. thanks.
|
|||||||||||
19 Aug 2005, 09:45 |
|
MCD 19 Aug 2005, 12:50
Hi uri
maybe this old post of mine may inspire you: http://board.flatassembler.net/topic.php?t=2749 have fun |
|||
19 Aug 2005, 12:50 |
|
vid 22 Aug 2005, 21:07
funny idea FASMs macrosystem is really good source for humor. by the way there's no reason for specific "add" and "sub" it's same, you just invert one bit and constant.
|
|||
22 Aug 2005, 21:07 |
|
uri 23 Aug 2005, 09:02
vid wrote: funny idea no reason for specific "add" and "sub" it's same, you just invert one bit and constant. Yes, but then you will have 2 different programs (xor and add), and i'm have 3 different (+sub) In realy macros is universal for xor and add and sub, and i'm not sure to add more logic to invert sign bit. If i will have a time - i'll add more commands. |
|||
23 Aug 2005, 09:02 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.