## Beginner Help

Bare metal programming in PureBasic, for experienced users
coco2
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

### Beginner Help

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
normeus
Enthusiast
Posts: 415
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

### Re: Beginner Help

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.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
coco2
Enthusiast
Posts: 368
Joined: Mon Nov 25, 2013 5:38 am
Location: Australia

### Re: Beginner Help

Thank you, it makes sense
juergenkulow
Enthusiast
Posts: 556
Joined: Wed Sep 25, 2019 10:18 am

### Re: Beginner Help

Please ask your questions, because switch on the cognition apparatus decides on the only known life in the universe.Wersten :DDüsseldorf NRW Germany Europe Earth Solar System Flake Bubble Orionarm
Milky Way Local_Group Virgo Supercluster Laniakea Universe