English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 26 April 2021, 10:36   #1
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
DIVS overflow question...

If I have something like:

move.l #$00800000,d0
divs d1,d0



if for example, d1 was 3, then an overflow would be detected (as the result does not fit in a word size), and the V flag is set.

According to the docs i have read, it says that on overflow, the operands remain unchanged... so can I assume that d0 still contains #$00800000 after the overflow ? Or are there any cases where d0 might change even if an overflow happens ?
DanScott is offline  
Old 26 April 2021, 10:51   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,215
Quote:
Originally Posted by DanScott View Post
According to the docs i have read, it says that on overflow, the operands remain unchanged... so can I assume that d0 still contains #$00800000 after the overflow ?

Correct, yes.
Thomas Richter is offline  
Old 26 April 2021, 12:29   #3
DanScott
Lemon. / Core Design
 
DanScott's Avatar
 
Join Date: Mar 2016
Location: Tier 5
Posts: 1,211
Ah cool.. handy to know, and in this case, the low word will remain zero which is the desired outcome of an overflow anyway, so no need to handle overflow case
DanScott is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overflow: Pipemania Clone BippyM Coders. Asm / Hardware 37 20 February 2022 23:08
Math [divs] LeCaravage Coders. Asm / Hardware 3 23 October 2020 08:39
Pull overflow with DirectX 11 on WinUAE 4.3+ Leandro Jardim support.WinUAE 2 04 April 2020 12:40
SysEx buffer overflow Ducktale support.WinUAE 1 30 August 2007 12:20

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09148 seconds with 13 queries