flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > TABLES.INC - instruction table

Author
Thread Post new topic Reply to topic
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 21 Jan 2013, 23:25
I have to extend the tables.inc structure, the part instructions for a special project with different but mostly similar targets and other coding of instructions. I don't want to do separate versions because they are really similar but not 100% identical.

So I wonder about this calculation:

Code:
instructions:
 dw instructions_2-instructions,(instructions_3-instructions_2)/(2+3)
 dw instructions_3-instructions,(instructions_4-instructions_3)/(3+3)
 dw instructions_4-instructions,(instructions_5-instructions_4)/(4+3)
 dw instructions_5-instructions,(instructions_6-instructions_5)/(5+3)
 dw instructions_6-instructions,(instructions_7-instructions_6)/(6+3)
 dw instructions_7-instructions,(instructions_8-instructions_7)/(7+3)
 dw instructions_8-instructions,(instructions_9-instructions_8)/(8+3)
 dw instructions_9-instructions,(instructions_10-instructions_9)/(9+3)
 dw instructions_10-instructions,(instructions_11-instructions_10)/(10+3)
 dw instructions_11-instructions,(instructions_12-instructions_11)/(11+3)
 dw instructions_12-instructions,(instructions_13-instructions_12)/(12+3)
 dw instructions_13-instructions,(instructions_14-instructions_13)/(13+3)
 dw instructions_14-instructions,(instructions_15-instructions_14)/(14+3)
 dw instructions_15-instructions,(instructions_16-instructions_15)/(15+3)
 dw instructions_16-instructions,(instructions_end-instructions_16)/(16+3)
    

First word is the offset of the instruction table "part".
Second word is the size of every instruction "part" but what is that division for ?

Looks a bit crazy, try to understand the purpose. Maybe someone can answer (other than look in source Rolling Eyes ).

Thanks !
Post 21 Jan 2013, 23:25
View user's profile Send private message Send e-mail Reply with quote
Spool



Joined: 08 Jan 2013
Posts: 151
Spool 22 Jan 2013, 04:00
[ Post removed by author. ]


Last edited by Spool on 17 Mar 2013, 04:28; edited 1 time in total
Post 22 Jan 2013, 04:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20630
Location: In your JS exploiting you and your system
revolution 22 Jan 2013, 05:04
shutdownall wrote:
Second word is the size of every instruction "part" but what is that division for ?
It computes the total number of instructions of each length.
Post 22 Jan 2013, 05:04
View user's profile Send private message Visit poster's website Reply with quote
shutdownall



Joined: 02 Apr 2010
Posts: 517
Location: Munich
shutdownall 22 Jan 2013, 17:04
Thanks, now it's got clear. First I thought about different length of instruction names but it is per section. +3 ist for the identification "byte" plus offset of the function to process the instruction.

Maybe yesterday was to late when I took a view in the source. Razz
Post 22 Jan 2013, 17:04
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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 cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.