We're looking for your comments on how to best organize the wiki's content.

MUL

From 0x10c Wiki
Jump to: navigation, search

MUL (Multiply) is one of the opcodes in the DCPU-16 specification. It represents a multiplication of two numbers.

Contents

[edit] Usage

 MUL arg1, arg2

MUL multiplies arg1 by arg2 and stores the low 16 bits of the result in arg1. The high 16 bits are stored in the EX register.

[edit] Signing awareness

MUL is only designed to handle unsigned numbers. For signed numbers, use MLI.

[edit] Overflow handling

The higher 16 bits of the result are stored in the EX register.

[edit] Processing

In binary machine code, this Basic opcode's five-bit representation is: 0b0 0100 (0x04)

The instruction has a takes two cycles to execute, plus any additional cycles necessary to evaluate the arguments.

[edit] References

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox