csb4.s 488 B

123456789101112131415161718192021222324252627282930313233
  1. .sect .text; .sect .rom; .sect .data; .sect .bss
  2. .define .csb4
  3. .sect .text
  4. .csb4:
  5. !bx: descriptor address
  6. !ax, dx: index
  7. push (bx) ! default
  8. mov cx,2(bx) ! count (ignore high order word, the descriptor
  9. ! would not fit anyway)
  10. 1:
  11. add bx,6
  12. dec cx
  13. jl 4f
  14. cmp ax,(bx)
  15. jne 1b
  16. cmp dx,2(bx)
  17. jne 1b
  18. pop bx
  19. mov bx,4(bx)
  20. 2:
  21. test bx,bx
  22. jnz 3f
  23. .extern ECASE
  24. .extern .fat
  25. mov ax,ECASE
  26. push ax
  27. jmp .fat
  28. 3:
  29. jmp bx
  30. 4:
  31. pop bx
  32. jmp 2b