Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. RSEG PRG
  2. RSEG SCL_HDR:DATA
  3. PUBLIC SCL_SIG
  4. DIR_ENTRY_SIZE equ DIR_ENTRY_END-DIR_ENTRY_BEGIN
  5. DIR_SIZE equ DIR_END-DIR_BEGIN
  6. PRG_NSEC equ (SIZEOF PRG + 255) >> 8
  7. #define if_then_else(a, b, c) ((a)*(b)+!(a)*(c))
  8.  
  9. SCL_SIG: defm 'SINCLAIR'
  10. SCL_NBLK: defb DIR_SIZE/DIR_ENTRY_SIZE
  11.  
  12. DIR_BEGIN:
  13. DIR_ENTRY_BEGIN:
  14. SCL_FN: defm 'prg B'
  15. SCL_START: defw LDR_SIZE-4
  16. SCL_LENGTH: defw LDR_SIZE-4
  17. SCL_NSEC: defb if_then_else(PRG_NSEC > 1*255, 255, PRG_NSEC & 0xFF)
  18. DIR_ENTRY_END:
  19.  
  20. DIR_CODE_ENTRY macro
  21. local c2
  22. defm 'prg '
  23. defb '0'+\1
  24. defw 0
  25. defw 0
  26. c2 equ if_then_else(PRG_NSEC > (\1)*255, (PRG_NSEC - (\1)*255) & 0xFF, 0)
  27. defb if_then_else(PRG_NSEC > (\1+1)*255, 255, c2)
  28. endm
  29.  
  30. li defl 1
  31. rept 9
  32. DIR_CODE_ENTRY li
  33. li defl li + 1
  34. endr
  35. DIR_END:
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement