home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / PC Basic / PCBASIC MPW version / BIncludes / PCBASICConst.a next >
Encoding:
Text File  |  1988-11-11  |  10.3 KB  |  339 lines  |  [TEXT/EDIT]

  1. ;
  2. ;     PCBASICconst   11/11/88
  3. ;
  4. ;   PCBASIC run-time variable definitions
  5. ;
  6. ;    by Pterodactyl Software, Copyright © 1985-1988
  7. ;
  8. ;  Environment
  9. ;
  10.     BLANKS  ON
  11.     STRING  ASIS
  12.     PRINT OFF
  13. ;
  14. ;
  15. ;  Variable  Definitions by Offset
  16. ;
  17. ;
  18. str$top        equ    -4            ;        strtop: longint;   { Pointer to end of strings}
  19. str$ptr        equ    str$top-4    ;        strptr: longint;   { Pointer to string-area segment}
  20. heap$len    equ    str$ptr-4    ;        heaplen: longint;  { Length of file-area  segment}
  21. heap$ptr    equ    str$ptr-8    ;        heaptr: longint;   { Pointer to file-area  segment}
  22. scrn$ptr    equ    heap$ptr-4    ;        scrnptr: longint;  { Pointer to screen-area  segment}
  23. trap$ptr    equ    scrn$ptr-4    ;        trapptr : ptr;           { Pointer to trap-area segment}
  24. trap$len    equ    trap$ptr-2    ;        traplen : integer; { Length of trap-area segment}
  25. bor$hand    equ    trap$len-4    ;        border: RgnHandle; { Border region}
  26. line$num    equ    bor$hand-2    ;        line_no: integer;  { BASIC Line Number}
  27. err$num        equ    line$num-2    ;        err_no: integer;   { Error number }
  28. c$ommand    equ    err$num-2    ;        command: integer;  { Pascal routine to execute }
  29. file$buf    equ    c$ommand-258    ;        pad   : integer;   { I/O may overshoot buffer }
  30. ;        file_str: string [255]; {record for I/O}
  31. file$len    equ    file$buf    ;          first byte of string is length
  32. file$str    equ    file$buf+1    ;          then data follows
  33. file$num    equ    file$buf-4    ;        file_num: longint; {reference number for file I/O}
  34. file$ptr    equ    file$num-4    ;        file_ptr: longint; {pointer to file I/O buffer}
  35. ;  conversion parameter
  36. int$x        equ    file$ptr-2    ;        intx  : integer;   { Integer input}
  37. int$y        equ    int$x-2    ;        inty  : integer;   { Integer input}
  38. fp$x        equ    int$y-4    ;        fpx   : real;           { Floating input}
  39. fp$y        equ    fp$x-4    ;        fpy   : real;           { Floating output}
  40. str$x        equ    fp$y-256    ;        strx  : string[255] { String input}
  41. str$y        equ    str$x-30    ;        stry  : string[29] { String output}
  42. ; device parameters
  43. pos$1        equ    str$y-2    ;        pos1  : integer;   { Printer 1 column, 1..132}
  44. wid$1        equ    pos$1-2    ;        wid1  : integer;   { Printer 1 width,  1 .. 255}
  45. pos$2        equ    wid$1-2    ;        pos2  : integer;   { Printer 2 column, 1..132}
  46. wid$2        equ    pos$2-2    ;        wid2  : integer;   { Printer 2 width,  1 .. 255}
  47. pos$3        equ    wid$2-2    ;        pos3  : integer;   { Printer 3 column, 1..132}
  48. wid$3        equ    pos$3-2    ;        wid3  : integer;   { Printer 3 width,  1 .. 255}
  49. ;  screen parameters
  50. pos$0        equ    wid$3-2    ;        pos0  : integer;   { Cursor column, 1..80}
  51. wid$0        equ    pos$0-2    ;        wid0  : integer;   { Screen width, 40 or 80}
  52. csr$lin        equ    wid$0-2    ;        csrlin: integer;   { Cursor line,   1..25}
  53. lp$x        equ    csr$lin-2    ;        lpx   : integer;   { x coörd of last point refereneced }
  54. lp$y        equ    csr$lin-4    ;        lpy   : integer;   { y coörd of last point refereneced }
  55. ap$x        equ    csr$lin-6    ;        apx   : integer;   { x coörd of point A }
  56. ap$y        equ    csr$lin-8    ;        apy   : integer;   { y coörd of point A }
  57. bp$x        equ    csr$lin-10    ;        bpx   : integer;   { x coörd of point B }
  58. bp$y        equ    csr$lin-12    ;        bpy   : integer;   { y coörd of point B }
  59. a$spect        equ    csr$lin-16    ;        aspect: real;           { Circle aspect ratio}
  60. def$asp        equ    a$spect-4    ;        DefAspect :real;   {Default value for aspect}
  61. csr$ptrn    equ    def$asp-68    ;        csrpat: cursor;    { Cursor data,
  62. csr$mask    equ    csr$ptrn+32    ;                      mask,
  63. csr$spot    equ    csr$mask+32    ;                      and hot spot}
  64. edit$rec    equ    csr$ptrn-28    ;        EditRect: rect           { Window data area}
  65. cfig$upd    equ    csr$ptrn-30    ;        CfigUpdate: integer{ Update & buffer options}
  66. vis$pg        equ    csr$ptrn-31    ; byte          visual (top)          page        LSB
  67. act$page    equ    csr$ptrn-32    ; byte          active (output) page        MSB
  68. ;
  69. ;
  70. asm$var        equ    act$page-1200    ;        asmvar: array [1..300] of longint
  71. ;
  72. ;
  73. ; screen ASM values
  74. max$pg        equ    asm$var+18    ; byte         maximum page num in use for seg size
  75. for$col        equ    asm$var+19    ; byte         foreground color or pen pattern
  76. back$col    equ    asm$var+20    ; byte         background color
  77. bor$col        equ    asm$var+21    ; byte         border color or text face
  78. scrn$mode    equ    asm$var+22    ; word         screen mode. >2 -> font(n)
  79. csr$vue        equ    asm$var+24    ; word         0=hide cursor, 1=show, else init
  80. csr$flg        equ    asm$var+26    ; byte         $40 -> Show carret. $80 -> On screen
  81. csr$top        equ    asm$var+28    ; word         first cursor line
  82. csr$bot        equ    asm$var+30    ; word         last cursor scan line
  83. csr$pnt        equ    asm$var+32    ; long         pointer into active page
  84. text$mod    equ    asm$var+36    ; byte         mode for drawing text
  85. text$fac    equ    asm$var+37    ; byte         text face
  86. font$asc    equ    asm$var+38    ; word         text font Ascent
  87. font$des    equ    asm$var+40    ; word         text font Descent
  88. ; zooming values
  89. view$lft    equ    asm$var+44    ; word        clip region & viewport left
  90. view$top    equ    asm$var+46    ; word        clip region & viewport top
  91. view$rt        equ    asm$var+48    ; word        clip region & viewport right
  92. view$bot    equ    asm$var+50    ; word        clip region & viewport bottom
  93. wind$lft    equ    asm$var+52    ; long        window left
  94. wind$top    equ    asm$var+56    ; long        window top
  95. wind$rt        equ    asm$var+60    ; long        window right
  96. wind$bot    equ    asm$var+64    ; long        window bottom
  97. vuoff$x        equ    asm$var+68    ; word        viewport x offset
  98. vuoff$y        equ    asm$var+70    ; word        viewport y offset
  99. wdoff$x        equ    asm$var+72    ; long        window x offset
  100. wdoff$y        equ    asm$var+76    ; long        window y offset
  101. wdmul$x        equ    asm$var+80    ; long        window x multiplier or 0 if no window
  102. wdmul$y        equ    asm$var+84    ; long        window y multiplier or 0 if no window
  103. ;
  104. err$adr        equ    asm$var+92    ; long         address for error retry
  105. file$mode    equ    asm$var+100    ; word          file I/O mode command for open
  106. rec$num        equ    file$mode+2    ; long          record nuimber for get or put
  107. fil$hands    equ    file$mode+6    ; long          file handles available
  108. line$adr    equ    file$mode+10    ; long          line start+4 in case of error
  109. retry$stk    equ    line$adr+4    ; long          restore to A7 on error retry
  110. stack$bot    equ    line$adr+8    ; long          restore to A7 for new program
  111. err$line    equ    line$adr+12    ; long          line start for error retry
  112. err$vect    equ    err$line+4    ; long          error handler address
  113. data$ptr    equ    err$vect+8    ; long          pointer to next DATA statement
  114. inp$retry    equ    err$vect+12    ; long          prompt display for input retry
  115. inp$stack    equ    err$vect+16    ; long          stack point for input retry
  116. seq$flg        equ    err$vect+21    ; byte          Seq disk file compatibility
  117. trac$lin    equ    err$vect+22    ; word          Last line number displayed
  118. opt$base    equ    err$vect+28    ; word          min array number, option base
  119. dflt$flg    equ    opt$base+2    ; byte          $FF -> default device
  120. prec$flg    equ    opt$base+3    ; byte          precision of operation
  121. field$pnt    equ    opt$base+4    ; long          pntr into file buf during FIELD
  122. width$255    equ    opt$base+8    ; long          default width and position
  123. ;
  124. ;  Keyboard and Mouse
  125. ;
  126. keyin$idx    equ    opt$base+18    ;  byte          pointer into key input string
  127. key$in        equ    opt$base+20    ;  long          string for function key input
  128. ; mouse(0) .. mouse(6)              ; 14 bytes  mouse function values
  129. mouse$y        equ    opt$base+28    ;  word           MOUSE(2)
  130. mouse$x        equ    opt$base+30    ;  word           MOUSE(1)
  131. Atr$byte    equ    mouse$y+21    ;  byte           current Screen atribute
  132. Atr$Off        equ    mouse$y+22    ;  word           size of text buffer
  133. Cur$Evt        equ    mouse$y+24    ;  Event record
  134. Cur$What    equ    Cur$Evt    ;  word          Type of Event
  135. Cur$Msg        equ    Cur$Evt+2    ;  long          Info about event
  136. Cur$time    equ    Cur$Evt+6    ;  long          Tick when event occured
  137. Cur$msy        equ    Cur$Evt+10    ;  word           Event mouse y
  138. Cur$msx        equ    Cur$Evt+12    ;  word           Event mouse x
  139. Cur$Mod        equ    Cur$Evt+14    ;  word          Event case keys
  140. ;
  141. ;  Register Storage
  142. ;
  143. pas$reg        equ    Cur$Evt+72    ; 36 bytes    Pascal registers while in ASM
  144. asm$reg        equ    pas$reg+52    ; 40 bytes    ASM registers while in Pascal
  145. ;                              A0 has return address
  146. ;  LFN pointer table
  147. ;
  148. lfn$ptr        equ    asm$reg+44    ; 520 bytes   LFN Pointers to file buffers
  149. ;
  150. ;  Vector into generated code
  151. ;
  152. code$start    equ    lfn$ptr+772    ; long              Start of current program
  153. ;
  154. ; entries to BASIC run-time code
  155.     IMPORT    Menu$Num
  156.     IMPORT    Wind$Num
  157.     IMPORT    l$$ea
  158.     IMPORT    dia$log
  159.     IMPORT    err$or
  160.     IMPORT    p$ause
  161.     IMPORT    r$esume
  162.     IMPORT    r$eturn
  163.     IMPORT    new$lin
  164.     IMPORT    new$pro
  165.     IMPORT    ret$pro
  166.     IMPORT    int$chk
  167.     IMPORT    trap$enab
  168.     IMPORT    key$on
  169.     IMPORT    key$off
  170.     IMPORT    key$list
  171.     IMPORT    key$set
  172.     IMPORT    heap$chk
  173.     IMPORT    pack$str
  174.     IMPORT    pack$ra
  175.     IMPORT    pack$sra
  176.     IMPORT    code$bot
  177.     IMPORT    e$nd
  178.     IMPORT    dim$pro
  179.     IMPORT    dim$fin
  180.     IMPORT    dim$chk
  181.     IMPORT    dim$val
  182.     IMPORT    add$str
  183.     IMPORT    r$4sng
  184.     IMPORT    r$4int
  185.     IMPORT    data$in
  186.     IMPORT    data$par
  187.     IMPORT    r$estore    ; 2/3/85
  188.     IMPORT    dyn$mode
  189.     IMPORT    c$lear
  190.     IMPORT    set$file
  191.     IMPORT    open$file
  192.     IMPORT    c$lose
  193.     IMPORT    cl$all
  194.     IMPORT    inp$beg
  195.     IMPORT    inp$int
  196.     IMPORT    inp$sng
  197.     IMPORT    inp$dbl
  198.     IMPORT    inp$str
  199.     IMPORT    inp$lin
  200.     IMPORT    init$prus
  201.     IMPORT    pr$comma
  202.     IMPORT    pr$cr
  203.     IMPORT    pr$qm
  204.     IMPORT    pr$sng
  205.     IMPORT    pr$dbl
  206.     IMPORT    pr$int
  207.     IMPORT    pr$str
  208.     IMPORT    pr$tab
  209.     IMPORT    pr$htab
  210.     IMPORT    pr$spac
  211.     IMPORT    pr$btl
  212.     IMPORT    prus$int
  213.     IMPORT    prus$str
  214.     IMPORT    prus$sng
  215.     IMPORT    prus$dbl
  216.     IMPORT    prus$end
  217.     IMPORT    wr$cr
  218.     IMPORT    wr$int
  219.     IMPORT    wr$str
  220.     IMPORT    wr$sng
  221.     IMPORT    wr$dbl
  222.     IMPORT    l$oc
  223.     IMPORT    l$of
  224.     IMPORT    e$of
  225.     IMPORT    l$pos
  226.     IMPORT    wid$num
  227.     IMPORT    wid$str
  228.     IMPORT    e$ject
  229.     IMPORT    get$rec
  230.     IMPORT    put$rec
  231.     IMPORT    next$rec
  232.     IMPORT    k$ill
  233.     IMPORT    f$iles
  234.     IMPORT    ch$dir
  235.     IMPORT    re$name
  236.     IMPORT    c$hain
  237.     IMPORT    d$raw
  238.     IMPORT    c$ircle
  239.     IMPORT    l$ine
  240.     IMPORT    b$ox
  241.     IMPORT    box$fill
  242.     IMPORT    clr$scrn
  243.     IMPORT    clr$view
  244.     IMPORT    view$scrn
  245.     IMPORT    view$set
  246.     IMPORT    clr$wind
  247.     IMPORT    wind$scrn
  248.     IMPORT    wind$set
  249.     IMPORT    get$graph
  250.     IMPORT    put$graph
  251.     IMPORT    c$olor
  252.     IMPORT    l$ocate
  253.     IMPORT    csr$pat
  254.     IMPORT    scrn$pro
  255.     IMPORT    scrn$num
  256.     IMPORT    poin$num
  257.     IMPORT    poin$cor
  258.     IMPORT    plot$pro
  259.     IMPORT    p$map
  260.     IMPORT    p$lay
  261.     IMPORT    s$ound
  262.     IMPORT    m$ouse
  263.     IMPORT    t$imer
  264.     IMPORT    time$pro
  265.     IMPORT    time$str
  266.     IMPORT    date$pro
  267.     IMPORT    date$str
  268.     IMPORT    pen$num
  269.     IMPORT    str$dbl
  270.     IMPORT    sng$dbl
  271.     IMPORT    val$num
  272.     IMPORT    str$int
  273.     IMPORT    int$dlr
  274.     IMPORT    sng$dlr
  275.     IMPORT    dbl$dlr
  276.     IMPORT    sng$fix
  277.     IMPORT    sng$int
  278.     IMPORT    dbl$fix
  279.     IMPORT    dbl$int
  280.     IMPORT    re$long
  281.     IMPORT    re$cint
  282.     IMPORT    dbl$cint
  283.     IMPORT    dbl$sng
  284.     IMPORT    cv$i
  285.     IMPORT    cv$s
  286.     IMPORT    cv$d
  287.     IMPORT    mk$i
  288.     IMPORT    mk$s
  289.     IMPORT    mk$d
  290.     IMPORT    oct$str
  291.     IMPORT    hex$str
  292.     IMPORT    in$key
  293.     IMPORT    in$str
  294.     IMPORT    in$putstr
  295.     IMPORT    copy$heap
  296.     IMPORT    lit$str
  297.     IMPORT    l$set
  298.     IMPORT    r$set
  299.     IMPORT    mid$pro
  300.     IMPORT    stri$str
  301.     IMPORT    cmp$str
  302.     IMPORT    r$andom
  303.     IMPORT    sng$ipwr
  304.     IMPORT    dbl$ipwr
  305.     IMPORT    exp$sng
  306.     IMPORT    cmp$sing
  307.     IMPORT    dbl$sqrt
  308.     IMPORT    dbl$cos
  309.     IMPORT    dbl$sin
  310.     IMPORT    dbl$exp
  311.     IMPORT    tan$dbl
  312.     IMPORT    exp$dbl
  313.     IMPORT    dbl$atan
  314.     IMPORT    dbl$ln
  315.     IMPORT    add$dbl
  316.     IMPORT    div$dbl
  317.     IMPORT    mul$dbl
  318.     IMPORT    cmp$dbl
  319.     IMPORT    sub$dbl
  320. ; iosfplib links
  321.     IMPORT    add$sing    ; sing add
  322.     IMPORT    sub$sing    ; sing subtract
  323.     IMPORT    mul$sing    ; sing multiply
  324.     IMPORT    div$sing    ; sing divide
  325.     IMPORT    sng$sin    ; sing sine
  326.     IMPORT    sng$cos    ; sing cosine
  327.     IMPORT    tan$sng    ; sing tangent
  328.     IMPORT    sng$flt    ; longint to sing
  329.     IMPORT    sng$exp    ; sing e ** x
  330.     IMPORT    sng$ln    ; sing nat log
  331.     IMPORT    sng$sqrt    ; sing square root
  332.     IMPORT    sng$atan    ; sing arctangent
  333. ;
  334. ;
  335. ;
  336.  
  337.  
  338.  
  339.