Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
ArtistA beautiful purple-haired ragdoll wearing a long purple velvet ankle-length dress with flouncy sleeves and purple suede high heels. She is pointing to one of a row of bunnies.
// Here we have the scalar version of the subscript operator.
// For now, we show 16bit code (Near) only.
// Far (32bit) will follow later, as will vector subscripts.
// ES points to the page frame, EBX points to the Buf, and DX contains the (scalar) subscript.
{_ // Begin ASM block
FCHOOSE: _PROC
_ASSERT ES:EBX,$EB // Debug check
_MOV AL, ES:[EBX.bufflags]; // Test near or far (far not yet implemented)
_OR AL,AL
_JS LFAR0C; // Not yet implemented
_MOV AX,DX; // Get subscript
_XOR DX,DX; // Clear remainder register
_DIV ES:[EBX.veclen16]; // Modulo by length
// Now we use the remainder DX to select the appropriate dope vector
_LEA EAX, ES:EBX.#NearBufHdr; // Point to start of dope vector -- TODO: check length doesn't exceed maxbuflen :)
_ADD EAX,DX; // Point to the dope vector for this entry
_MOVZX ECX, ES:[EAX+length16]; // Return the selected length
_MOVZX EAX, ES:[EAX+offset16]; // Return a pointer to the selected element
_RET
_} // End ASM block
// *** This code is in progress of a rewrite! ***