mirror of
				https://github.com/simon987/Much-Assembly-Required.git
				synced 2025-11-04 01:56:53 +00:00 
			
		
		
		
	Updated DIV instruction description
							parent
							
								
									c718a582aa
								
							
						
					
					
						commit
						7287863073
					
				@ -484,7 +484,9 @@ A = (result & 0x00ff)
 | 
			
		||||
| `DIV source`    | `0x18` |  `source` : `mem` / `reg` / `imm` |  `-`  |  `-` |  `-` |    `-`   |  `X`  |
 | 
			
		||||
 | 
			
		||||
#### Description
 | 
			
		||||
`DIV` performs unsigned division on `A` with `source` as divisor and stores the result into `A` and the remainder in `Y`.
 | 
			
		||||
`DIV` performs unsigned division on `Y:A` with `source` as divisor and stores the result into `A` and the remainder in `Y`.
 | 
			
		||||
 | 
			
		||||
> NOTE: `DIV` operates on a 32 bit integer composed of `Y:A`. So multiple `DIV` instructions without setting Y to what you want will result into weird results
 | 
			
		||||
 | 
			
		||||
Note that a division by 0 will set the (undocumented) error flag and the break flag. This will halt execution.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user