rol.s 475 B

123456789101112131415161718192021222324252627282930313233343536
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define .rol
  4. ! #bytes in ax
  5. .rol:
  6. pop dx ! return address
  7. cmp ax,2
  8. jne 1f
  9. pop ax
  10. pop cx
  11. rol ax,cl
  12. push ax
  13. jmp dx
  14. 1:
  15. cmp ax,4
  16. jne 9f
  17. pop cx
  18. jcxz 2f
  19. pop ax
  20. pop bx
  21. 3:
  22. sal ax,1
  23. rcl bx,1
  24. adc ax,0
  25. loop 3b
  26. push bx
  27. push ax
  28. 2:
  29. jmp dx
  30. 9:
  31. .extern EODDZ
  32. .extern .trp
  33. mov ax,EODDZ
  34. push dx
  35. jmp .trp