Recent Posts

Pages: [1] 2 3 ... 10
1
The Laboratory / Re: Hardware Enumerator [pre-release]
« Last post by Raistlin on Today at 02:12:16 AM »
Yes master  :( I shall endeavour to do better. Meaning
fixing the bug without freaking out too many ppl.
2
Romper Room / Re: A small joke
« Last post by zedd151 on Today at 02:03:01 AM »
(Sp)ecial Assembler == Spasm.   :P
3
Romper Room / Re: A small joke
« Last post by P1 on Today at 01:35:07 AM »
I'm developing such a good assembler, that I'm gonna name it ORG-ASM :)
Runs as a .eek, Right ???   :eusa_naughty:

Regards, P1
4
Game Development / Re: Function Pointers In Game Logic
« Last post by mineiro on Today at 01:15:19 AM »
hello Caché GB;
Maybe you can gain some cycles if you do a mov and a jump; I think is more viable/quickly than a call/ret pairs.

Something like:
lea eax,[g_pBehaviour+??*4]  ;*4 because dwords addresses
jmp eax

align 4
Behaviour00:
...
jmp go_back_to_loop

go_back_to_loop is better if aligned to a multiple. (align 4,8,...)

The way to go is using tables, we often do this while on eletronics, only logic tables (or pre calculated tables) that are translated to logic circuits (diodes, transistors, ...).
5
The Soap Box / Re: PHUN with a 4tb HDD.
« Last post by mineiro on Today at 12:58:15 AM »
Yes sir sinsi;
These new hard drivers have internally a table. When this table get fully filled with remaped "bad blocks" so that message comes out.
6
The Soap Box / Re: PHUN with a 4tb HDD.
« Last post by jj2007 on Today at 12:51:48 AM »
7
The Soap Box / Re: PHUN with a 4tb HDD.
« Last post by hutch-- on Today at 12:20:01 AM »
I seem to have been fortunate that I got everything off it intact as I found it early but I tried writing some video to it today and the reads were starting to fail again so the only solution is the new WD 4tb RED that I have ordered from a vendor on eBay. The drive that failed is a 4tb Seagate so there will be no more of that model.
8
UASM Assembler Development / Re: Symbol not defined
« Last post by HSE on June 22, 2018, 11:55:59 PM »
Hi!
We have talked about the same before. It's a jwasm problem. Nidud solved for AsmC exactly a year ago.
.  Bad file names in errors messages. 
9
The Workshop / Re: About fpu
« Last post by Siekmanski on June 22, 2018, 10:02:21 PM »
10
Game Development / Re: Function Pointers In Game Logic
« Last post by Caché GB on June 22, 2018, 08:48:50 PM »
Thanks felipe for the info.

Once again thanks to HSE and Siekmanski. Jump Tables are definitely the goto.

I see that hierarchical complexity can quickly be implemented and for deep nesting, it is possible to have
predetermined or calculated code paths (tree transversal) for rapidly dealing with course and effect. As
daydreamer pointed out "loads array of STATE for 100's of ... and use jump table".

Thanks daydreamer.

Awesome! Welcome to the JUNGLE, Table.

Code: [Select]

.data

szEntityZero   db "I am Entity Zero", 0
szEntityOne    db "I am Entity One", 0
    etc.

g_pBehaviour   dd offset Behaviour00, offset Behaviour00Routine00,  offset Behaviour00Routine01,  offset Behaviour00Routine02
               dd offset Behaviour01, offset Behaviour01Routine00,  offset Behaviour01Routine01,  offset Behaviour01Routine02
               dd offset Behaviour02, offset Behaviour02Routine00,  offset Behaviour02Routine01,  offset Behaviour02Routine02
               dd offset Behaviour03, offset Behaviour03Routine00,  offset Behaviour03Routine01,  offset Behaviour03Routine02
               dd offset Behaviour04, offset Behaviour04Routine00,  offset Behaviour04Routine01,  offset Behaviour04Routine02
               dd offset Behaviour05, offset Behaviour05Routine00,  offset Behaviour05Routine01,  offset Behaviour05Routine02

GameEntity     ENTITY  NumEntities dup (<>)

.code

 ;===========================================>

          ...
          lea  esi, GameEntity
       assume  esi:ptr ENTITY

          mov [esi].ENTITY.MyName, offset szEntityZero
          add  esi, sizeof(ENTITY)
          mov [esi].ENTITY.MyName, offset szEntityOne
          add  esi, sizeof(ENTITY)
             
          etc.

          mov  i, 0
       .while (i < NumEntities)

          invoke  RAND32, 6              ;; RNG by NaN (May 5, 2001)
            imul  eax, 4
             mov  edx, eax
             mAm [esi].ENTITY.BehaviourPtr, [g_pBehaviour+eax*4]
   
          invoke  RAND32, 3
             add  eax, 1
             add  eax, edx
             mAm [esi].ENTITY.RoutinePtr, [g_pBehaviour+eax*4]

             add  esi, sizeof(ENTITY)
             inc  i
        .endw
       assume  esi:
          ...
 ;===========================================>
          ...
         lea  esi, GameEntity
      assume  esi:ptr ENTITY
          mov  i, 0
       .while (i < NumEntities)         
            push  esi
            call [esi].ENTITY.BehaviourPtr
             add  esi, sizeof(ENTITY)
             inc  i
        .endw
       assume  esi:nothing
          ...

;===========================================>

Behaviour00 PROC  Who:PTR ENTITY

          mov  edx, Who
       assume  edx:ptr ENTITY
       invoke  MessageBoxA, null, CSTR("Acting out Behaviour 0"),  [edx].ENTITY.MyName, MB_OK   

          mov  edx, Who
         call [edx].ENTITY.RoutinePtr
       assume  edx:nothing
          ret

Behaviour00 ENDP

    Behaviour00Routine00 PROC
       invoke  MessageBoxA, null, CSTR("while doing 0s Routine 0"),  [edx].ENTITY.MyName, MB_OK
          ret
    Behaviour00Routine00 ENDP

    Behaviour00Routine01 PROC
       invoke  MessageBoxA, null, CSTR("while doing 0s Routine 1"),  [edx].ENTITY.MyName, MB_OK
          ret
    Behaviour00Routine01 ENDP

    Behaviour00Routine02 PROC
       invoke  MessageBoxA, null, CSTR("while doing 0s Routine 2"),  [edx].ENTITY.MyName, MB_OK
          ret
    Behaviour00Routine02 ENDP

  etc.

;==================================================================>

Pages: [1] 2 3 ... 10