Retrieving an Element of an Array: Difference between revisions

From Rosetta Code
Content added Content deleted
(Add Common Lisp)
No edit summary
Line 12: Line 12:
(aref array index))
(aref array index))


==x86 assembly==
'''Assembler:''' nasm
mov esi, array_offset
mov ebx, 2
mov eax, [esi+ebx*4]


{{array operation}}
{{array operation}}

Revision as of 19:47, 21 January 2007

Task
Retrieving an Element of an Array
You are encouraged to solve this task according to the task description, using any language you may know.

In this task, the goal is to retrieve an element of an array.

mIRC

Interpeter: mIRC Script Editor Library: mArray Snippet

 alias readmyarray { echo -a $array_read(MyArray, 2, 3) }

Common Lisp

  (defun array-value (array index)
    (aref array index))

x86 assembly

Assembler: nasm

mov esi, array_offset
mov ebx, 2
mov eax, [esi+ebx*4]

Template:Array operation