iaar.s 311 B

123456789101112131415161718
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define .iaar
  4. .iaar:
  5. pop ecx
  6. pop edx
  7. cmp edx,4
  8. .extern .unknown
  9. jne .unknown
  10. pop ebx ! descriptor address
  11. pop eax ! index
  12. sub eax,(ebx)
  13. mul 8(ebx)
  14. pop ebx ! array base
  15. add ebx,eax
  16. push ecx
  17. ret