Author Topic: Seek Help~ - -(about a macro explanation)~  (Read 18098 times)

Offline Hack004

  • Jr. Member
  • *
  • Posts: 5
Seek Help~ - -(about a macro explanation)~
« on: April 22, 2010, 10:06:23 PM »
Code: [Select]
; usage: Gate Selector, Offset, DCount, Attr
;        Selector:  dw
;        Offset:    dd
;        DCount:    db
;        Attr:      db
%macro Gate 4
dw (%2 & 0FFFFh) ; ??1
dw %1 ; ???
dw (%3 & 1Fh) | ((%4 << 8) & 0FF00h) ; ??
dw ((%2 >> 16) & 0FFFFh) ; ??2
%endmacro ; ? 8 ??
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
excuse me~
  friends please explan its meaning~

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Seek Help~ - -(about a macro explanation)~
« Reply #1 on: April 22, 2010, 11:51:53 PM »
Looks like it shuffles the bits of your parameters into their correct positions in a gate descriptor.

http://www.osdever.net/tutorials/descriptors.php

Best,
Frank


Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Seek Help~ - -(about a macro explanation)~
« Reply #2 on: April 23, 2010, 01:36:44 AM »
??1 = Offset 1
??? = Selector
?? = Property
??2 = Offset 2

 :D

Offline Hack004

  • Jr. Member
  • *
  • Posts: 5
Re: Seek Help~ - -(about a macro explanation)~
« Reply #3 on: April 23, 2010, 05:55:29 AM »
thank your ,upstairs of brothers~