Page 1 of 1

Beginner Help

Posted: Fri Dec 01, 2023 1:57 am
by coco2
I don't know a lot about ASM and have started to learn out of curiosity. Why does this work:

Code: Select all

x.q = 10
n.q = 2
d.q = 0
! MOV rax, [v_x]
! MOV rcx, [v_n]
! CQO
! IDIV rcx
! MOV [v_d], rax
Debug d
But this does not:

Code: Select all

x.q = 10
n.q = 2
d.q = 0
EnableASM
  MOV rax, [v_x]
  MOV rcx, [v_n]
  CQO
  IDIV rcx
  MOV [v_d], rax
DisableASM
Debug d

Re: Beginner Help

Posted: Fri Dec 01, 2023 2:23 am
by normeus
just add an exclamation in front !


Code: Select all

x.q = 10
n.q = 2
d.q = 0
EnableASM
  MOV rax, [v_x]
  MOV rcx, [v_n]
  !CQO
  IDIV rcx
  MOV [v_d], rax
DisableASM
Debug d
It has to do with it being a newer opcode, as explained by Luis here:

viewtopic.php?p=532368#p532368

Norm.

Re: Beginner Help

Posted: Fri Dec 01, 2023 6:19 am
by coco2
Thank you, it makes sense

Re: Beginner Help

Posted: Fri Dec 01, 2023 9:31 pm
by juergenkulow