adi.s 416 B

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