lar4.s 571 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define .lar4
  4. .lar4:
  5. ! ebx, descriptor address
  6. ! eax, index
  7. sub eax,(ebx)
  8. mov ecx,8(ebx)
  9. imul ecx
  10. pop ebx
  11. pop edx ! base address
  12. add edx,eax
  13. sar ecx,1
  14. jnb 1f
  15. xor eax,eax
  16. movb al,(edx)
  17. push eax
  18. jmp ebx
  19. 1:
  20. sar ecx,1
  21. jnb 1f
  22. xor eax,eax
  23. o16 mov ax,(edx)
  24. push eax
  25. jmp ebx
  26. 1:
  27. xchg edx,esi ! saved esi
  28. mov eax,ecx
  29. sal eax,2
  30. sub esp,eax
  31. mov eax,edi ! save edi
  32. mov edi,esp
  33. rep movs
  34. mov edi,eax
  35. mov esi,edx
  36. jmp ebx