News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM struct bit fields?

Started by dajudge, January 31, 2005, 03:53:42 PM

Previous topic - Next topic

dajudge

Hi all, I am currently porting a ASM file written with a non-MASM32 assembler and have problems with bitfields (at least I believe they are). How would the equivalent code be in MASM32?


struc JITC
clientPages resd 1

tlb_code_0_eff resd TLB_ENTRIES
tlb_data_0_eff resd TLB_ENTRIES
tlb_data_8_eff resd TLB_ENTRIES
tlb_code_0_phys resd TLB_ENTRIES
tlb_data_0_phys resd TLB_ENTRIES
tlb_data_8_phys resd TLB_ENTRIES
resd 1
tlb_code_0_hits resq 1
tlb_data_0_hits resq 1
tlb_data_8_hits resq 1
tlb_code_0_misses resq 1
tlb_data_0_misses resq 1
tlb_data_8_misses resq 1

nativeReg resd 8        ; FIXME: resb?

nativeRegState resd 8   ; FIXME: resb?

nativeFlags resd 1

nativeFlagsState resd 1
nativeCarryState resd 1

clientReg resd 600

nativeRegsList resd 8

LRUreg resd 1
MRUreg resd 1

LRUpage resd 1
MRUpage resd 1

freeFragmentsList resd 1

freeClientPages resd 1

translationCache resd 1
endstruc


Thanks,
Alex

raymond

I would "guess" that
resd may stand for "reserve dword" and
resq may stand for "reserve qword".
Then the number following those would be the quantity to reserve.
The TLB_ENTRIES may be an equate.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

thomasantony

Hi,
     For resd, in MASM u use for eg.

clientPages dd 0

for resd 1 and

tlb_code_0_eff dd TLB_ENTRIES dup (0)
; or
tlb_code_0_eff dd TLB_ENTRIES dup (?)

for multiple dwords. I believe the  code you gave is NASM or FASM format

Thomas Antony :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

MichaelW

From the NASM 0.98.35 documentation:
Quote
3.2 Pseudo−Instructions
Pseudo−instructions are things which, though not real x86 machine instructions, are used in the
instruction field anyway because that's the most convenient place to put them. The current
pseudo−instructions are DB, DW, DD, DQ and DT, their uninitialised counterparts RESB, RESW,
RESD, RESQ and REST, the INCBIN command, the EQU command, and the TIMES prefix.
So if the sample code is in fact for NASM, the MASM equivalents would be:

"resd" -> "DWORD ?" or "DD ?"
"resq" -> "QWORD ?" or "DQ ?"
etc


eschew obfuscation

Kestrel


thomasantony

Sorry abt the mistake!!  :snooty: :( :snooty:

Thomas Antony :boohoo:
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

P1

Welcome Alex,    :U

You will find some the best people in the world, come here to get answers, as well as give them.

If you like getting and giving help in Assembler, this is the place for you!!    :clap:

Look forward to you participating with us.    :thumbu

Is this the original code?
http://cvs.sf.net/viewcvs.py/pearpc/pearpc/src/cpu_jitc_x86/Attic/jitc_mmu.asm?rev=1.11
This part of the PearPC on SourceForge.

It would have been nice, to tell us a little bit more about it and yourself.

We are here for you, in developing the Windows version of PearPC.

Regards,  P1  :8)