flat assembler
Message board for the users of flat assembler.

Index > Heap > Who really wrote that code?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Rocket fuel, I suspect. Wink
Post 13 Dec 2013, 13:45
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1180
Location: Unknown
HaHaAnonymous
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:02; edited 1 time in total
Post 13 Dec 2013, 14:15
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
lol =D

Quote:
“The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.”
― Bertrand Russell


Quote:
“If you can't explain it to a six year old, you don't understand it yourself.”
― Albert Einstein


Quote:

When asked about his success, Eisenhower said "Whenever I run into a problem I can't solve, I always make it bigger.
Post 13 Dec 2013, 14:25
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
Thread has good chances to get over 9000 posts. Wink
Post 13 Dec 2013, 14:43
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
MazeGen:
Quote:
m3ntal, who cares about your opinion on Dex? Stop these personal attacks.
Obviously, he does. I was talking to him, not you. See who started the personal discussions.

Here's the deal: If Dex finally listens to me and improves DexBASIC macros, I'll leave him alone. But if he continues to ignore me and distribute garbage, I will destroy him.

Search for DexBASIC. Distributed to 10,000s people. 1,000s of unanswered questions about macros. Wrong person to ask. Worst macro language ever, not as good as beginner attempts in the Macros forum


Last edited by m3ntal on 15 Dec 2013, 19:18; edited 2 times in total
Post 14 Dec 2013, 04:22
View user's profile Send private message Reply with quote
Walter



Joined: 26 Jan 2013
Posts: 143
Walter
Very entertaining.

Yet, should we need help from the FASM judicial system,
this will be the Judge's decision!
Post 14 Dec 2013, 07:44
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Great news Cool , DexBasic is going to be included in a number of commercial products, The first of which, is the new ver of this.
http://www.fuze.co.uk/
Post 14 Dec 2013, 18:56
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
SERIOUS PROBLEMS WITH DEXBASIC!

Just examples:

Problem: DexBASIC imm32 (mov r, i) always produces 4 instructions even for byte values that should only take 1 instruction.
Code:
macro imm32 reg,immediate {
mov reg,(immediate) and $FF
orr reg,(immediate) and $FF00
orr reg,(immediate) and $FF0000
orr reg,(immediate) and $FF000000
}    
Solution: if/else directives to prevent pointless "orr 0's". For byte values, this macro will only produce 1 instruction instead of 4. For 16BIT, only 2 instructions. For 24BIT, 3 instructions. For constant rotation, standard mov r0, 7F000000h does this. See Magic-ARM to understand it. For PC-relative load from literal pool, see FASMARM's macros. Note that ASM directives - equ/forward/if/else/etc - by themselves do not output any code (if/else is similar to #if/#else in C).
Code:
macro imm32 a, b {
 local n
 if (b)=-1 | (b)=0FFFFFFFFh
  mvn a, 0
 else if (b)>0 & (b)<255
  mov a, (b)
 else
  mov a, (b) and 0FFh
  n=(b) and 0FF00h
  if n<>0
   orr a, a, n
  end if
  n=(b) and 0FF0000h
  if n<>0
   orr a, a, n
  end if
  n=(b) and 0FF000000h
  if n<>0
   orr a, a, n
  end if
 end if
}    
Problem: DexBASIC function start + return always produces 72 BYTES PER USAGE!
Code:

Macro substart                                           ;
{                                                        ;
        push   (lr)                                      ;
        push   (r4)                                      ;
        push   (r5)                                      ;
        push   (r6)                                      ;
        push   (r7)                                      ;
        push   (r8)                                      ;
        push   (r9)                                      ;
        push   (r10)                                     ;
        push   (r11)                                     ;
}

Macro return                                             ;
{                                                        ;
        pop   (r11)                                      ;
        pop   (r10)                                      ;
        pop   (r9)                                       ;
        pop   (r8)                                       ;
        pop   (r7)                                       ;
        pop   (r6)                                       ;
        pop   (r5)                                       ;
        pop   (r4)                                       ;
        pop   (pc)                                       ;
}    
Solution: ARM can push/pop 1-16 registers in one instruction. Replace these 18 instructions (72 bytes) with 2 (8 bytes), saving 64 bytes per usage:
Code:
push {r4-r11, lr} ; start
pop {r4-r11, pc}  ; return    
return macro can specify an optional value for r0/a1. An improved "return value":
Code:
macro return v {
 if ~v eq           ; if parameter was sent
  movi r0, v        ; or your imm32/ldr #
 end if
 pop \{r4-r11, pc\} ; return
}    
Problem: color (set font color) produces 92 BYTES PER USAGE! It should be ONE instruction, a call/bl to a proc/function. Very common routine: 10 usages will produce 920 bytes!

Code:
macro color _opt1                                        ;
{                                                        ;
        push   (r0)                                      ;
        push   (r1)                                      ;
        push   (r2)                                      ;
        imm32  r0,_opt1                                  ;
                                                         ;
        mov    r2,r0,lsr 24                              ;
        and    r1,r0,16711680                            ;
        orr    r2,r2,r0,lsl 24                           ;
        orr    r2,r2,r1,lsr 8                            ;
        and    r0,r0,65280                               ;
        orr    r0,r2,r0,lsl 8                            ;
        mov    r0,r0,lsr 8                               ;
        orr    r0,0xff000000                             ;
        imm32  r1,Font_Color                             ;
        str    r0,[r1]                                   ;
        pop    (r2)                                      ;
        pop    (r1)                                      ;
        pop    (r0)                                      ;
}    
Problem: cls (clear screen) produces 144 BYTES PER USAGE! It should be ONE instruction, a call/bl to a proc/function.
Code:
Macro cls   _color1                                      ;
{                                                        ;
        local .FillOffScrBuffLoopMacro                   ;
        push   (r0)                                      ;
        push   (r1)                                      ;
        push   (r2)                                      ;
                                                         ;
        imm32  r0,SCREEN_X                               ;
        imm32  r1,SCREEN_Y                               ;
        mul    r2,r0,r1                                  ;
        push   (r2)                                      ;
        imm32  r0,_color1                                ;
                                                         ;
        mov    r2,r0,lsr 24                              ;
        and    r1,r0,16711680                            ;
        orr    r2,r2,r0,lsl 24                           ;
        orr    r2,r2,r1,lsr 8                            ;
        and    r0,r0,65280                               ;
        orr    r0,r2,r0,lsl 8                            ;
        mov    r0,r0,lsr 8                               ;
        orr    r0,0xff000000                             ;
        imm32  r1,ScreenBuffer                           ;
        pop    (r2)                                      ;
align 4                                                  ;
.FillOffScrBuffLoopMacro:                                ;
        str    r0,[r1],4                                 ;
        subs   r2,r2, 1                                  ;
        bne    .FillOffScrBuffLoopMacro                  ;
        pop    (r2)                                      ;
        pop    (r1)                                      ;
        pop    (r0)                                      ;
}    
... etc, I could go on forever. DexBASIC is the SLOWEST, MOST WASTEFUL, POORLY WRITTEN, HORRIBLY INEFFICIENT TRASH I've EVER seen in my life! Yet he has the audacity to call this shit the "Fastest code ever"?!

To those who don't know what a macro is, know this: When you use a macro, it is equivalent to re-writing its entire definition; ie, 92 BYTES PER "set font color"! Thus, in the wrong hands, macros can produce shitloads of additional code if the programmer does not know what they're doing.

Dex: You have 3 choices:

1. Lies, false claims, "he's jealous", etc. OR...
2. Ignore me as you do in other communities. OR...
3. Improve your code. Listen to experienced programmers.

I care deeply about what is true and accurate and do not want anyone else to repeat these mistakes.

(Keywords for search engines: DexOS Dex BASIC DexBASIC raspberry PI macro language assembler ARM X86 dex ban banned if .if while .while loop let high level features raspberry PI RPI bare metal string graphics art font icon draw pixel image bitmap font converter file I/O input output memory manager card flash RiscOS raspbian programming ARM ASM assembler assembly tutorials how to learn introduction beginner manual bare metal GBA header gameboy advance SP raspberry pi instruction reference encodings list decode register memory ip sp lr pc load relative mov ldr adr immediate constant address branch pipeline cache alu THUMB 1 2 FPA VFP SIMD NEON vector floating point FP FPA bios interrupt coprocessor emulator disassembler simulator ARM keil DS-5 armulator PDF manual DexBASIC DexBASIC DexBASIC DexBASIC macros macros macros macros DexBASIC DexBASIC DexBASIC macros macros macros macros raspberry pi RPI raspberry pi RPI raspberry pi RPI raspberry pi RPI OS OS OS example source code tutorials DexOS Dex BASIC DexBASIC raspberry PI macro language assembler ARM X86 dex ban banned if .if while .while loop let high level features raspberry PI RPI bare metal string drawing graphics art font icon draw pixel image bitmap font converter file I/O input output memory manager card format address org start code data flash RiscOS raspbian install raspbian RPI programming ARM ASM assembler assembly tutorials how to learn introduction beginner manual bare metal GBA header gameboy advance SP raspberry pi instruction reference encode encodings list decode register memory ip sp lr pc load relative mov ldr adr immediate constant address branch pipeline cache alu T1 T2 THUMB 1 2 FPA VFP SIMD NEON vector floating point FP FPA bios interrupt coprocessor emulator disassembler simulator ARM keil DS-5 armulator PDF manual DexBASIC DexBASIC DexBASIC DexBASIC macros macros macros macros DexBASIC DexBASIC DexBASIC macros macros macros macros raspberry pi RPI raspberry pi RPI raspberry pi RPI raspberry pi RPI OS OS OS example source code tutorials ARM ASM assembler assembly tutorials how to learn introduction beginner ARM ASM assembler assembly tutorials how to learn introduction beginner)
Post 15 Dec 2013, 17:21
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
Quote:
“The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.” ― Bertrand Russell
I agree, but you have it the wrong way. All I hear from you is dumb misconceptions about a person who is beyond human comprehension, something you could never understand. Who is really the over-confident one who believes he's good when he's really not?
Quote:
"One thing I've learned is not to accept anyone's belief about how they feel about me. Because if you believe them when they tell you you're on top of the world, you're the king, then you're gonna believe them when they tell you you aint shit. So, it's like, I appreciate the compliment if it really is one but I'm going to stick with what I believe about myself. And I don't want to hear the good or the bad" - DMX (Rapper)
Post 15 Dec 2013, 19:10
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal
sleep: You'll never be a programmer. You'll always be an emotional thinker, a reporter, advertiser, one who promotes bullshit, unproven theories and superstitions: Read, believe, repeat. Believe whatever makes you feel comfortable. That represents truth.
Quote:
both compete to write something equal, then make it public and see how public rank, at least in such positive and competitive way, world gain, public gain, let the competition begin.... =)
Anyone, anytime, anywhere (without using art/graphics, that's just the cover of my book). Bring it, step into my ring, first round knockout. However, the judges must be people who are experienced in writing ARM assembler AND advanced macros. Why would you ask the general public (non-programmers) what is good assembler code? Does that make sense?
Post 16 Dec 2013, 09:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17279
Location: In your JS exploiting you and your system
revolution
There is no winner. And no loser. Let's just write code that does what we need and forget about all this petty bickering.
Post 16 Dec 2013, 09:48
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8902
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
m3ntal wrote:

sleep: You'll never be a programmer. You'll always be an emotional thinker, a reporter, advertiser, one who promotes bullshit, unproven theories and superstitions:

jackpot!
thanks for the complimentary =)
Post 16 Dec 2013, 10:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.