>>5
So they managed to take assembly, which is well defined and easy to read, and make an unreadable monstrosity out of it? Is this Assembly++ or something?
You're not forced to use it and I doubt you even know how horrible x86 asm is to begin with.
Name:
Anonymous2012-01-24 10:08
>>12 Every modern assembler has a preprocessor.
What is your point?
You're not forced to use it and I doubt you even know how horrible x86 asm is to begin with.
Have you ever worked with someone else, or do you always just write small 100 line toy programs by yourself?
Name:
Anonymous2012-01-24 10:26
Bitches don't know about my FASM macros.
macro proc stackspace, name, [remaps]
{
common
label name
match =N, CALLTRACE \{
if stackspace < 0
; Forced entry
push rbp
mov rbp, rsp
else if stackspace > 0
push rbp
mov rbp, rsp
sub rsp, stackspace*8
end if
macro ret \\{
if stackspace <> 0
leave
end if
ret
\\}
macro tailcall addr \\{
if stackspace <> 0
leave
end if
jmp addr
\\}
macro sysretq \\{
if stackspace <> 0
leave
end if
sysretq
\\}
macro retj c, landing \\{
if stackspace <> 0
j\\#c leave.\\#landing
else
j\\#c landing
end if
\\}
\}
match =Y, CALLTRACE \{
push rbp
mov rbp, rsp
if stackspace > 0
sub rsp, stackspace*8
end if
macro ret \\{
leave
ret
\\}
macro tailcall addr \\{
call addr
ret
\\}
macro sysretq \\{
leave
sysretq
\\}
macro retj c, landing \\{
j\\#c leaving.\\#landing
\\}
\}
local to_restore
to_restore equ
macro _remap reg, re \{
\local prg
prg equ
irp tst, a,b,c,d \\{
match =tst, reg \\\{
append prg, r\#re
r\#re equ r\#reg\#x
append prg, r\#re\#d
r\#re\#d equ e\#reg\#x
append prg, r\#re\#w
r\#re\#w equ reg\#x
append prg, r\#re\#b
r\#re\#b equ reg\#l
append prg, r\#re\#h
r\#re\#h equ reg\#h
\\\}
\\}
irp tst, di,si,sp,bp \\{
match =tst, reg \\\{
append prg, r\#re
r\#re equ r\#reg
append prg, r\#re\#d
r\#re\#d equ e\#reg
append prg, r\#re\#w
r\#re\#w equ reg
append prg, r\#re\#b
r\#re\#b equ reg\#l
\\\}
\\}
irp tst, 8,9,10,11,12,13,14,15 \\{
match =tst, reg \\\{
append prg, r\#re
r\#re equ r\#reg
append prg, r\#re\#d
r\#re\#d equ r\#reg\#d
append prg, r\#re\#w
r\#re\#w equ r\#reg\#w
append prg, r\#re\#b
r\#re\#b equ r\#reg\#b
\\\}
\\}
append to_restore, prg
\}
macro remap [rem] \{
\forward match reg->re, rem \\{
_remap reg, re
\\}
\}
forward
match reg->re, remaps \{
_remap reg, re
\}
common
if ~ used name
display "WARN: Proc " # `name # \
" is defined but not used.", 10
end if
;if used name
macro endproc
\{
; end if
\local I, top
match I, to_restore \\{
irp top, I \\\{
restore top
\\\}
\\}
purge endproc, remap, _remap, ret, tailcall, sysretq, retj
\}
}
Name:
Anonymous2012-01-24 11:27
>>13 Have you ever worked with someone else, or do you always just write small 100 line toy programs by yourself?
Have you worked with any x86 asm at all in your entire toilet scrubbing life you mental midget?
Have you worked with any other language that is well defined and has a preprocessor or do you just stick to your shitty toy languages with no value at all?
>>23
Percent signs in front of register names is GAS syntax not AT&T syntax. AT&T syntax is almost PDP-11/VAX syntax except it uses * for double indirection instead of @ and a few other minor differences. Look at the old BSD source code for an example of AT&T syntax. VAX instructions use b/w/l/q/o (byte, word, longword, quadword, octaword) size suffixes, and use r0-r15 as register names no matter what size the data is. Intel instructions use the register names and keywords like DWORD to determine the size. x86 GAS uses both, which makes it look ugly. Even with the ugly percent signs, GAS syntax looks alright on a VAX, but it looks like shit on x86 because the operands are switched around. On a VAX, cmpl A, B; jle label does exactly what it looks like, but on an x86 with GAS syntax, it branches if B is less than or equal to A.