News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Probably a dumb question ?

Started by K_F, October 18, 2016, 04:55:10 AM

Previous topic - Next topic

K_F

Can I still use ASSUME in 64bit to access structures

Assume rbx:Ptr Elf32_Ehdr
.
.
Mov [Rbx].e_ident, Rax ;
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

hutch--

Van,

Not in ML64, you use the other notation and it works OK. It may work OK in one of the Watcom forks.

K_F

Thanks .. thought as much
Starting on my first serious 64 bit proggy... .. more reading to do.. :t
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

hutch--

Van,

This format works in ML64.

    mov eax, lpRct

    mov (RECT PTR [eax]).left,   10
    mov (RECT PTR [eax]).top,    12
    mov (RECT PTR [eax]).right,  14
    mov (RECT PTR [eax]).bottom, 16

One of the Watcom folks should be able to help you with any of the forks.

jj2007

include \Masm32\MasmBasic\Res\JBasic.inc      ; ## builds in 32- or 64-bit mode with ML, AsmC, JWasm, HJWasm ##
m2m equ xmov
.code
MyTest proc <cb> uses rsi rLeft, rTop, rRight, rBottom      ; requires MasmBasic
Local rc0:RECT
  rc equ <[rsi.RECT]>
  lea rsi, rc0

  m2m rc.left, rLeft                ; the most elegant solution, works
  m2m rc.top, rTop                  ; for both ML and Watcom forks

  m2m [rsi.RECT.right], rRight      ; works for both, too

  ifidni @AsmUsed$(0), <ml64>
      m2m [rsi.RECT.bottom], rBottom
  else
      Assume rsi:PTR RECT           ; old and clumsy syntax but the Watcom forks can handle that
      m2m [rsi].bottom, 1004        ; rBottom
  endif

  Print Str$("Left/Top/Right/Bottom: %i/%i/%i/%i\n\n", rc.left, rc.top, rc.right, rc.bottom)
  ret
MyTest endp
Init
  PrintLine Chr$("This code was assembled with ", @AsmUsed$(), " in ", jbit$, "-bit format", 13, 10)
  jinvoke MyTest, 101, 102, 103, 104
  Inkey "-- hit any key --"
EndOfCode

OPT_64      1      ; put 0 for 32 bit, 1 for 64 bit assembly
OPT_Assembler      ML
OxPT_Assembler      AsmC      ; remove the x to activate the
OxPT_Assembler      JWasm      ; option; the last one counts


This code was assembled with ml64 in 64-bit format

Left/Top/Right/Bottom: 101/102/103/104


Always willing to help with assembler-related questions ;)

K_F

'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

rrr314159

Quote from: K_F on October 18, 2016, 04:55:10 AM
Can I still use ASSUME in 64bit to access structures

I've mentioned before that the straw that broke the camel's back - made me, finally, reject ML64 in favor of HJWasm - was ASSUME. Microsoft took it out for no good reason, and I find it very convenient.

But one thing puzzles me - what the h*ll does this have to do with the ANC, and SA race problems?
I am NaN ;)

K_F

Where do you get that from ?.. we're talking 64 bit here  ;)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

rrr314159

True ... ANC is only about 8 bit, or perhaps 7 ...
I am NaN ;)