flat assembler
Message board for the users of flat assembler.

Index > Main > [solved] program hangs for a second and crashes

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
macomics



Joined: 26 Jan 2021
Posts: 723
Location: Russia
macomics 17 Apr 2022, 19:08
Code:
  mov rax, [operand1]
  mov rcx, [operand2]
  cqo
  jrcxz @f
  idiv rcx
  jmp div_ok
 @@:
  fastcall [printf], "Div by 0\n"
  fastcall [getch]
  jmp start
 div_ok:
  mov rbx, rdx
  fastcall [printf], "%d", rax
  fastcall [printf], ", remainder is %s", rbx
  fastcall [getch] ; not call [getch]
  jmp start    
Post 17 Apr 2022, 19:08
View user's profile Send private message Reply with quote
retro



Joined: 12 Oct 2021
Posts: 47
retro 17 Apr 2022, 19:26
does that "e" mean "extended"?
Post 17 Apr 2022, 19:26
View user's profile Send private message Reply with quote
retro



Joined: 12 Oct 2021
Posts: 47
retro 17 Apr 2022, 19:27
i mean, the "e" from "cdqe".
Post 17 Apr 2022, 19:27
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 723
Location: Russia
macomics 17 Apr 2022, 19:39
retro wrote:
does that "e" mean "extended"?
That's about the logic that constantly captivates me. I always either forget "e" or vice versa.
Post 17 Apr 2022, 19:39
View user's profile Send private message Reply with quote
retro



Joined: 12 Oct 2021
Posts: 47
retro 17 Apr 2022, 20:28
i fixed it, now it works like a charm, thank you guys!
now i'm gonna read a bit more about x64 assembly and in the future i'm gonna improve this calculator!
Post 17 Apr 2022, 20:28
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.