ror.s 488 B

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