flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tomasz Grysztar 01 Oct 2018, 09:00
The initial value of EDX is then taken both as divisor and as the upper part of dividend. You are going to get exception 0, because (edx shl 32 +eax)/edx >= 1 shl 32 so the result cannot fit in 32 bits.
|
|||
![]() |
|
Furs 01 Oct 2018, 16:43
Tomasz Grysztar wrote: The initial value of EDX is then taken both as divisor and as the upper part of dividend. You are going to get exception 0, because (edx shl 32 +eax)/edx >= 1 shl 32 so the result cannot fit in 32 bits. ![]() |
|||
![]() |
|
revolution 01 Oct 2018, 17:53
Furs wrote:
|
|||
![]() |
|
DimonSoft 01 Oct 2018, 19:47
Ben321 wrote:
revolution wrote: UD2 Which stands for “U Divide by 2” ![]() |
|||
![]() |
|
Furs 02 Oct 2018, 15:06
revolution wrote:
You can use them as some sort of internal opcode too (i.e. exception handler performs differently with 'div edx' than with 'ud2' or others, though 1-byte invalid opcodes for userspace like 'hlt' can encode an arbitrary second byte without being larger...) But anyway ud2 is boring. ![]() |
|||
![]() |
|
revolution 02 Oct 2018, 15:55
Furs wrote: But anyway ud2 is boring. There are lots of ways to cause exceptions in user mode. IN, OUT, INT3, INT 3, HLT, UD2, DIV EDX, MOV CR0,EAX, MOV DR0,EAX, etc. Each can be set to perform a different action in the exception handler. It would make the code harder to debug and reverse engineer. |
|||
![]() |
|
Furs 02 Oct 2018, 16:48
revolution wrote: The CPU doesn't care. ![]() |
|||
![]() |
|
revolution 03 Oct 2018, 03:10
Furs wrote: If it's your code shouldn't be harder to debug, since you can just use macros. |
|||
![]() |
|
Furs 04 Oct 2018, 18:47
revolution wrote:
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.