sys.s 677 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define sysal, sysn, sysnl, sysnx, sysc, syse, cerror, _errno
  3. .sect .bss
  4. .comm _errno, 2
  5. .sect .text
  6. sysal:
  7. push bp
  8. mov bp,sp
  9. push di
  10. push si
  11. mov di,10(bp)
  12. mov si,8(bp)
  13. mov cx,6(bp)
  14. mov bx,4(bp)
  15. call syscal
  16. mov dx,bx
  17. pop si
  18. pop di
  19. pop bp
  20. jb cerror
  21. ret
  22. syse:
  23. mov bx,sp
  24. add bx,2
  25. call syscal
  26. cerror:
  27. mov (_errno),ax
  28. mov ax,-1
  29. cwd
  30. ret
  31. sysn:
  32. mov bx,sp
  33. add bx,2
  34. call syscal
  35. jb cerror
  36. ret
  37. sysnl:
  38. mov bx,sp
  39. add bx,2
  40. call syscal
  41. jb cerror
  42. mov dx,bx
  43. ret
  44. sysnx:
  45. mov bx,sp
  46. add bx,2
  47. call syscal
  48. jb cerror
  49. xchg bx,ax
  50. ret
  51. sysc:
  52. mov bx,sp
  53. add bx,2
  54. call syscal
  55. jb cerror
  56. xor ax,ax
  57. cbw
  58. ret