Difference between revisions of "PM Opc MUL"

From SublabWiki
Jump to: navigation, search
m (Conditions)
m (Sortable list)
Line 1: Line 1:
 
== MUL = Multiply ==
 
== MUL = Multiply ==
  
{| border="1" style="text-align:left"
+
{| border="1" style="text-align:left" class="sortable"
 
!Hex
 
!Hex
 
!Mnemonic
 
!Mnemonic
Line 23: Line 23:
 
=== Description ===
 
=== Description ===
  
8-Bits Register L multiply by 8-Bits Register A, 16-Bits result is placed on 16-Bits Register HL.
+
"8-Bits Register L" multiply by "8-Bits Register A", 16-Bits result is placed on "16-Bits Register HL".
  
 
=== Conditions ===
 
=== Conditions ===
Line 33: Line 33:
 
Overflow: Always Clear
 
Overflow: Always Clear
  
Sign: Set when 15th bit of the result is 1
+
Sign: Set when bit 15 of the result is 1
  
 
=== Examples ===
 
=== Examples ===
Line 42: Line 42:
 
  ; A = 0x03
 
  ; A = 0x03
 
  ; HL = 0x0009 (0x03 * 0x03 = 0x0009)
 
  ; HL = 0x0009 (0x03 * 0x03 = 0x0009)
  ; F = (Zero = 0):(Carry = 0):(Overflow=0):(Sign=0)
+
  ; F = (Zero=0):(Carry=0):(Overflow=0):(Sign=0)
  
 
  ; A = 0x00
 
  ; A = 0x00
Line 49: Line 49:
 
  ; A = 0x00
 
  ; A = 0x00
 
  ; HL = 0x0000 (0x03 * 0x00 = 0x0000)
 
  ; HL = 0x0000 (0x03 * 0x00 = 0x0000)
  ; F = (Zero = 1):(Carry = 0):(Overflow=0):(Sign=0)
+
  ; F = (Zero=1):(Carry=0):(Overflow=0):(Sign=0)
  
 
  ; A = 0xFF
 
  ; A = 0xFF
Line 56: Line 56:
 
  ; A = 0xFF
 
  ; A = 0xFF
 
  ; HL = 0xFE01 (0xFF * 0xFF = 0xFE01)
 
  ; HL = 0xFE01 (0xFF * 0xFF = 0xFE01)
  ; F = (Zero = 0):(Carry = 0):(Overflow=0):(Sign=1)
+
  ; F = (Zero=0):(Carry=0):(Overflow=0):(Sign=1)
  
 
[[PM_InstructionList|'''« Back to Instruction set''']]
 
[[PM_InstructionList|'''« Back to Instruction set''']]

Revision as of 03:00, 19 April 2009

MUL = Multiply

Hex Mnemonic Cycles
CE D8 MUL L, A 48

Execute

; MUL L, A
;
; L is the Factor/Multiplicand
; A is the Multiplier
; HL will be the Product

HL = L x A

Description

"8-Bits Register L" multiply by "8-Bits Register A", 16-Bits result is placed on "16-Bits Register HL".

Conditions

Zero: Set when result is 0

Carry: Always Clear

Overflow: Always Clear

Sign: Set when bit 15 of the result is 1

Examples

; A = 0x03
; L = 0x03
MUL L, A
; A = 0x03
; HL = 0x0009 (0x03 * 0x03 = 0x0009)
; F = (Zero=0):(Carry=0):(Overflow=0):(Sign=0)
; A = 0x00
; L = 0x03
MUL L, A
; A = 0x00
; HL = 0x0000 (0x03 * 0x00 = 0x0000)
; F = (Zero=1):(Carry=0):(Overflow=0):(Sign=0)
; A = 0xFF
; L = 0xFF
MUL L, A
; A = 0xFF
; HL = 0xFE01 (0xFF * 0xFF = 0xFE01)
; F = (Zero=0):(Carry=0):(Overflow=0):(Sign=1)

« Back to Instruction set