Data section

As there is no specific order of sections in the source file, we will begin with a quick look at the data section in order to better comprehend the code. The data section or, to be more precise, the arrangement of data in a data section, is quite self-explanatory. The emphasis was made on data alignment, allowing faster access with aligned SSE instructions:

section '.data' data readable writeable
; Current date and birth date
; The dates are arranged in a way most suitable
; for use with XMM registers
cday dd 9 ; Current day of the month
cyear dd 2017 ; Current year
bday dd 16 ; Birth date day of the month
byear dd 1979 ; Birth year

cmonth dd 5 ; 1-based number of current month
dd 0
bmonth dd 1 ; 1-based number of birth month
dd 0


; These values are used for calculation of days
; in both current and birth dates
dpy dd 1.0
dd 365.25

; This table specifies number of days since the new year
; till the first day of specified month.
; Table's indices are zero based
monthtab:
dd 0 ; January
dd 31 ; February
dd 59 ; March
dd 90 ; April
dd 120 ; May
dd 151 ; June
dd 181 ; July
dd 212 ; August
dd 243 ; September
dd 273 ; October
dd 304 ; November
dd 334 ; December

align 16
; Biorhythmic periods
T dd 23.0 ; Physical
dd 28.0 ; Emotional
dd 33.0 ; Intellectual

pi_2 dd 6.28318 ; 2xPI - used in formula

align 16
; Result storage
; Arranged as table:
; Physical : Emotional : Intellectual : padding
output rd 20 * 4

; '.idata' section: contains import information,
; is readable, is writeable
section '.idata' import data readable writeable

; 'library' macro from 'win32a.inc' creates
; proper entry for importing
; functions from a dynamic link library.
; For now it is only 'kernel32.dll'.
library kernel, 'kernel32.dll'

; 'import' macro creates the actual entries
; for functions we want to import from a dynamic link library
import kernel,
exitProcess, 'ExitProcess'
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset