Author Topic: Probably a dumb question ?  (Read 4941 times)

K_F

  • Member
  • *****
  • Posts: 1771
  • Anybody out there?
Probably a dumb question ?
« on: October 18, 2016, 04:55:10 AM »
Can I still use ASSUME in 64bit to access structures

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

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Probably a dumb question ?
« Reply #1 on: October 18, 2016, 07:59:47 AM »
Van,

Not in ML64, you use the other notation and it works OK. It may work OK in one of the Watcom forks.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

K_F

  • Member
  • *****
  • Posts: 1771
  • Anybody out there?
Re: Probably a dumb question ?
« Reply #2 on: October 18, 2016, 08:08:36 AM »
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--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Probably a dumb question ?
« Reply #3 on: October 18, 2016, 08:40:42 AM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 13957
  • Assembly is fun ;-)
    • MasmBasic
Re: Probably a dumb question ?
« Reply #4 on: October 18, 2016, 09:10:58 AM »
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


Code: [Select]
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

  • Member
  • *****
  • Posts: 1771
  • Anybody out there?
Re: Probably a dumb question ?
« Reply #5 on: October 19, 2016, 05:14:29 AM »
Thank you gentlemen.. :biggrin:
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

rrr314159

  • Member
  • *****
  • Posts: 1378
Re: Probably a dumb question ?
« Reply #6 on: October 19, 2016, 12:15:14 PM »
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

  • Member
  • *****
  • Posts: 1771
  • Anybody out there?
Re: Probably a dumb question ?
« Reply #7 on: October 20, 2016, 03:32:24 AM »
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

  • Member
  • *****
  • Posts: 1378
Re: Probably a dumb question ?
« Reply #8 on: October 20, 2016, 04:33:25 AM »
True ... ANC is only about 8 bit, or perhaps 7 ...
I am NaN ;)