From 7287863073ed543d25558ee50d004f018bbaec8d Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 1 Jan 2018 14:07:34 +0100 Subject: [PATCH] Updated DIV instruction description --- Instruction-Set.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Instruction-Set.md b/Instruction-Set.md index bf75aee..625fd97 100644 --- a/Instruction-Set.md +++ b/Instruction-Set.md @@ -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.