sbi.s 445 B

123456789101112131415161718192021222324252627282930
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .sect .text
  3. .define .sbi
  4. ! #bytes in cx , top of stack in ax
  5. .sbi:
  6. pop bx ! return subress
  7. cmp cx,2
  8. jne 1f
  9. pop cx
  10. sub ax,cx
  11. neg ax
  12. jmp bx
  13. 1:
  14. cmp cx,4
  15. jne 9f
  16. pop dx
  17. pop cx
  18. sub cx,ax
  19. mov ax,cx
  20. pop cx
  21. sbb cx,dx
  22. push cx
  23. jmp bx
  24. 9:
  25. .extern EODDZ
  26. .extern .trp
  27. mov ax,EODDZ
  28. push bx
  29. jmp .trp