rules.net 499 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Rules for optimizing BCC assembler output
  2. # Rules for converting short number from host to network order
  3. push word %[#|*]0%1
  4. call __htons
  5. inc sp
  6. inc sp
  7. =
  8. mov ax,#((%1 & $00FF) << 8) + ((%1 & $FF00) >> 8)
  9. mov ax,%[#|*]0%1
  10. push ax
  11. call __htons
  12. inc sp
  13. inc sp
  14. =
  15. mov ax,#((%1 & $00FF) << 8) + ((%1 & $FF00) >> 8)
  16. push %0[%1]
  17. call __htons
  18. inc sp
  19. inc sp
  20. =
  21. mov ax,%0[%1]
  22. xchg al,ah
  23. push ax
  24. call __htons
  25. inc sp
  26. inc sp
  27. =
  28. xchg al,ah
  29. push %[bx|cx|dx]1
  30. call __htons
  31. inc sp
  32. inc sp
  33. =
  34. mov ax,%1
  35. xchg al,ah