Skip to content

Add a separate instruction for storing/loading data from stack #25

@HyperWinX

Description

@HyperWinX

Due to the restrictions of the instruction encoding method, HyperCPU ISA allows max 256 offset. Using a separate register for extracting variables is really expensive, because you'll need at most two instructions to load something from the stack.

I propose two new instructions called LODSB - LOad Data from Stack, relative to xBp, and STDSB - STore Data to Stack, relative to xBp. Syntax of the instructions as follows:

lodsb <r/rm>, <sint>;
stdsb <r/rm>, <sint>;

LODSB - First operand specifies the destination to load data, second operand - offset from XBP register, without inverting the sign, so if you pass 4 - address will be xbp + 4.
STDSB - First operand specifies the source register (...yeah), second operand - offset from XBP register without inverting the sign.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions