home *** CD-ROM | disk | FTP | other *** search
/ Amiga GigaPD 3 / Amiga_GigaPD_v3_3of3.iso / fred_fish / fish_601-650_unpacked / 629 / srcanalyzer / chart.s < prev    next >
Text File  |  1993-06-25  |  14KB  |  595 lines

  1. *****************************************************************************
  2. *
  3. * Barchart plotter     V0.91 (7-8/10/89)    ⌐ L. VanhelsuwΘ
  4. *
  5. * This program takes a filename as argument.    (1> CHART file)
  6. * It loads the ASCII file in and converts it to the internal representation
  7. * of the barchart data structure.
  8. * The ASCII file is constructed from 1..N (N <50) lines structured as follows:
  9. *  |<decimal number 0..65535> <column label>|
  10. *
  11. * The main feature of the program is the scalability of the chart via the
  12. * intuition sizing gadget.
  13. *
  14. * 27/10/90 Cleaned up program to use EXEC,DOS,INTUI macros...
  15. *       Changed Chart display so that bar labels are printed just below
  16. *       bar bases.
  17. * 15/03/91 Changed maximum window size to 8192,8192 for Workbench 2.0 etc...
  18. *       Made argument decoding more robust (i.e. handle A-Shell !)
  19. *
  20. *
  21. *    **!! WARNING: This program is not generic. It is currently suited
  22. *    **!!        only to display output from SrcAnalyzer
  23. *    **!!    Find comments marked **!! for areas which need generalizing!
  24. *
  25. ******************************************************************************
  26.  
  27.         INCLUDE    std
  28.  
  29. TOP_CLEARANCE    equ    65    ;dragbar,labels
  30. LABELS        equ    52    ;enough for "MOVE.L"        **!!
  31. BOT_CLEARANCE    equ    2+LABELS ;
  32.  
  33. WINDOW_WIDTH    equ    480
  34. WINDOW_LINES    equ    150
  35.  
  36. WINDOW_IDCMP    equ    REFRESHWINDOW+NEWSIZE+CLOSEWINDOW
  37.  
  38. STD_FLAGS    equ    WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+WINDOWSIZING
  39. WINDOW_FLAGS    equ    STD_FLAGS+SIMPLE_REFRESH+ACTIVATE
  40.  
  41.  
  42. GFXR        MACRO
  43.         move.l    rastport,a1
  44.         GFX    \1
  45.         ENDM
  46.  
  47. ;---------------------------------------
  48. START:        move.l    SP,top_level    ;save initial for SP for break-outs
  49.  
  50.         bsr    process_args    ;check arguments out
  51.  
  52.         bsr    open_libraries    ;DOS, stdout
  53.  
  54.         move.l    DOS_LIB_PTR,a6
  55.         move.l    args_ptr,d1
  56.         move.l    #MODE_OLDFILE,d2
  57.         DOS    Open        ;open ASCII data file
  58.         move.l    d0,in_fhandle
  59.         bne    got_datafile
  60.         moveq    #-2,d7
  61.         jmp    error
  62.         
  63. got_datafile    move.l    args_ptr,a0        ;add data filename to
  64.         lea    window_title,a1    ;window name string
  65. copy_filename    move.b    (a0)+,(a1)+
  66.         bne.s    copy_filename
  67.  
  68.         move.l    INTUI_LIB_PTR,a6
  69.         lea    chart_windowdef,a0
  70.         INTUI    OpenWindow        ;open window in Workbench
  71.         move.l    d0,window
  72.         bne    got_window
  73.         moveq    #-1,d7
  74.         jmp    error
  75.  
  76. got_window    move.w    #WINDOW_WIDTH,w_width
  77.         move.w    #WINDOW_LINES,w_lines
  78.         move.l    d0,a0
  79.         move.l    wd_RPort(a0),rastport    ;for later graphics calls
  80.         move.l    wd_UserPort(a0),msgport    ;for receiving IDCMP msgs
  81.  
  82.         bsr    read_data        ;read in ASCII data file
  83.         bsr    gen_chart_struct    ;cvt data to internal form
  84.         bsr    refresh_window        ;repaint barchart
  85.  
  86. MAIN:        bsr    test_IDCMP        ;act on close/refresh msgs
  87.  
  88.         move.l    DOS_LIB_PTR,a6
  89.         move.l    #25,d1
  90.         DOS    Delay        ;sleep for 1/2 sec
  91.         bra    MAIN
  92. ;---------------------------------------
  93. test_IDCMP    move.l    4.w,a6
  94.         move.l    msgport,a0
  95.         EXEC    GetMsg            ;see if Intuition sent us
  96.         tst.l    d0            ;an IntuiMsg
  97.         beq    dummy
  98.  
  99.         move.l    d0,a1
  100.         move.l    im_Class(a1),imsg_class        ;copy relevant info
  101.         move.w    im_Code(a1),imsg_code
  102.         move.l    im_IAddress(a1),imsg_addr
  103.         move.l    im_MouseX(a1),imsg_ratcords
  104.         EXEC    ReplyMsg            ;and return msg
  105.  
  106.         move.l    imsg_class,d0    ;find our handler for
  107.         lea    event_routines,a0    ;this event
  108.         bra.s    scan_types
  109. possible_event    move.l    (a0)+,a1
  110.         cmp.l    d0,d1
  111.         bne.s    scan_types
  112.         jmp    (a1)            ;execute event handler
  113.  
  114. scan_types    move.l    (a0)+,d1
  115.         bpl.s    possible_event
  116.         rts
  117.  
  118. event_routines    dc.l    REFRESHWINDOW,refresh_window
  119.         dc.l    CLOSEWINDOW,quit_me
  120.         dc.l    NEWSIZE,size_chart
  121.         dc.l    -1
  122.  
  123. *        dc.l    VANILLAKEY,keypress
  124. *        dc.l    RAWKEY,keypress
  125. *        dc.l    GADGETUP,intui_gadget
  126. *        dc.l    MOUSEBUTTONS,gadget_press
  127. ;---------------------------------------
  128. size_chart    move.l    window,a0        ;only if the window
  129.         move.w    wd_Width(a0),d0        ;really changed dimension,
  130.         move.w    wd_Height(a0),d1
  131.         cmp.w    w_width,d0
  132.         bne    real_change
  133.         cmp.w    w_lines,d1
  134.         beq    dummy
  135.  
  136. real_change    move.w    d0,w_width        ;should you update vars &
  137.         move.w    d1,w_lines
  138.         bsr    refresh_window        ;redraw the lot
  139.  
  140.         bset    #0,flags        ;swallow next refresh msg !
  141.         rts
  142. ;---------------------------------------
  143. quit_me        moveq    #0,d7            ;normal exit code..
  144.         jmp    error
  145. ;---------------------------------------
  146. refresh_window    bclr    #0,flags        ;don't refresh twice after a size refr.
  147.         rne
  148.  
  149.         move.l    GFX_LIB_PTR,a6
  150.  
  151.         moveq    #0,d0            ;clear window pane to BG color
  152.         GFXR    SetAPen
  153.  
  154.         moveq    #4,d0            ;get Window dimensions
  155.         moveq    #10,d1
  156.         move.w    d0,d2
  157.         move.w    d1,d3
  158.         add.w    w_width,d2
  159.         add.w    w_lines,d3
  160.         sub.w    #23,d2
  161.         sub.w    #13,d3
  162.         GFXR    RectFill
  163.         
  164.         lea    chart_data,a4
  165.         bsr    draw_barchart        ;and draw new one.
  166.         rts
  167. ;---------------------------------------
  168. ; Draw entire BarChart in window.
  169. ;
  170. ; A4 -> chart structure
  171.  
  172. draw_barchart    move.l    a4,a3
  173.         bsr    find_max        ;find highest column
  174.         bsr    find_factor        ;calc zoom/shrink factor
  175.         bsr    draw_intervals        ;dividing lines & Y scale
  176.  
  177.         moveq    #0,d4
  178.         move.w    w_width,d4
  179.         sub.w    #50,d4            ;usable width of window
  180.         move.w    num_values,d7
  181.         divu    d7,d4            ;d4=adjusted width for bars
  182.         moveq    #40,d5            ;starting X coord
  183.         subq.w    #1,d7
  184.  
  185. draw_columns    move.w    (a4)+,d0        ;get absolute height
  186.         move.l    (a4)+,a3        ;get string ptr
  187.         mulu    factor,d0        ;size column
  188.         lsr.l    #8,d0            ;256 = 1.0
  189.         move.w    d4,d1
  190.         subq.w    #4,d1            ;leave gaps between columns
  191.         bsr    draw_column
  192.         bsr    print_label        ;print associated label
  193.         add.w    d4,d5            ;goto next bar (inc XCO)
  194.         dbra    d7,draw_columns        ;all columns done ?
  195.         rts
  196. ;---------------------------------------
  197. ; D0/D1 = height/width    D4=column spacing    D5= X coord    D7=column #
  198.  
  199. draw_column    move.l    GFX_LIB_PTR,a6    ;use GRAPHICS library
  200.  
  201.         tst.w    -6(a4)            ;if real height is zero
  202.         beq    dummy            ;don't draw anything
  203.  
  204.         tst.w    d0            ;if drawn height is zero
  205.         bne.s    not_neglectable
  206.         move.w    d0,-(SP)
  207.         move.w    d1,-(SP)
  208.         moveq    #2,d0            ;then draw strip in
  209.         GFXR    SetAPen
  210.         move.w    (SP)+,d1
  211.         move.w    (SP)+,d0
  212.  
  213. not_neglectable    move.w    d5,d2            ;max x = X + width
  214.         add.w    d1,d2
  215.         move.w    w_lines,d3        ;max y = lines -n
  216.         sub.w    #BOT_CLEARANCE,d3
  217.         move.w    d3,d1            ;min y = lines -n -height
  218.         sub.w    d0,d1
  219.         move.w    d5,d0            ;min x = X
  220.         GFXR    RectFill        ;fill rectangle
  221.  
  222.         moveq    #1,d0            ;use normal filling
  223.         GFXR    SetAPen
  224.         rts
  225. ;---------------------------------------
  226. ; A3 -> C-string    D5= column X
  227.  
  228. print_label    move.l    GFX_LIB_PTR,a6
  229.  
  230.         moveq    #RP_JAM2,d0        ;2-color chars
  231.         GFXR    SetDrMd
  232.  
  233.         moveq    #3,d0            ;1 pixels : pen 3
  234.         GFXR    SetAPen
  235.         moveq    #2,d0            ;0 pixels : pen 2
  236.         GFXR    SetBPen
  237.  
  238.         move.w    w_lines,d2
  239.         sub.w    #BOT_CLEARANCE-9,d2    ;starting Y
  240.         bra.s    wh_chars        ;(just under chart bars)
  241.  
  242. plot_char    move.w    d2,d1            ;base Y of char
  243.         move.w    d5,d0            ;same X as column
  244.         GFXR    Move            ;position pen
  245.  
  246.         moveq    #1,d0            ;1 char to plot
  247.         move.l    a3,a0            ;address from char
  248.         GFXR    Text
  249.  
  250.         addq.w    #1,a3            ;advance char ptr
  251.         add.w    #8,d2            ;move down vertically
  252.  
  253. wh_chars    tst.b    (a3)            ;EOS ?
  254.         bne.s    plot_char
  255.         rts
  256. ;---------------------------------------
  257. draw_intervals    move.l    GFX_LIB_PTR,a6
  258.  
  259.         moveq    #5-1,d7            ;5 divisions
  260.         moveq    #0,d6
  261.         move.w    axis_max,d6        ;divide 100% up into 20%
  262.         divu    #5,d6            ;interval size
  263.         move.w    d6,d5            ;1st height
  264.  
  265. print_heights    moveq    #2,d0            ;switch pen back to normal
  266.         GFXR    SetAPen
  267.  
  268.         move.w    w_lines,d1        ;calc Y-coordinate for next
  269.         sub.w    #BOT_CLEARANCE,d1    ;gradient (bottom-to-top)
  270.         move.w    d5,d0
  271.         mulu    factor,d0
  272.         lsr.l    #8,d0
  273.         sub.w    d0,d1
  274.         move.w    d1,d3            ;cache current working Y
  275.  
  276.         moveq    #40,d0            ;X1 = 40
  277.         GFXR    Move
  278.  
  279.         move.w    d3,d1            ;Y coord
  280.         move.w    w_width,d0
  281.         sub.w    #20,d0            ;horizontal line across window
  282.         GFXR    Draw            ;(30,y)-(w-40,y)
  283.  
  284.         moveq    #0,d0            ;now print height
  285.         move.w    d5,d0            ;textually
  286.         moveq    #4,d1            ;e.g. '0080'
  287.         lea    dec_out,a0
  288.         bsr    bin_to_dec        ;make ASCII axis label
  289.  
  290.         moveq    #4,d0            ;crsr_X for text = 4
  291.         move.w    d3,d1            ;Y coord
  292.         addq.w    #5,d1            ;label slightly lower
  293.         GFXR    Move            ;goto printing position
  294.  
  295.         moveq    #3,d0            ;labels printed in diff color
  296.         GFXR    SetAPen
  297.  
  298.         lea    dec_out,a0        ;-> label to print
  299.         moveq    #4,d0            ;4 chars long
  300.         GFXR    Text        ;print it (next to line)
  301.  
  302.         add.w    d6,d5            ;go up in steps of 20%
  303.         dbra    d7,print_heights
  304.         rts
  305. ;---------------------------------------
  306. ; A3 -> new chart structure
  307. find_max    moveq    #0,d0            ;# of items
  308.         moveq    #0,d1            ;maximum height so far
  309.         moveq    #-1,d7            ;max 64k values
  310.         bra    wh_values
  311.  
  312. scan_chart    addq.w    #1,d0            ;inc # of items
  313.         cmp.w    d1,d2
  314.         bcs    wh_values        ;is this value > max
  315.         move.w    d2,d1            ;update max
  316. wh_values    move.w    (a3)+,d2
  317.         tst.l    (a3)+
  318.         dbeq    d7,scan_chart
  319.  
  320.         move.w    d0,num_values
  321.         move.w    d1,max_value
  322.         rts
  323. ;---------------------------------------
  324. ; find optimal sizing factor to fit barchart in 
  325.  
  326. find_factor    move.w    #256,d0            ;sample sizing factor = 1.0
  327.         move.w    #100,d2            ;'100' = 100 %
  328.         move.w    max_value,d1
  329.         cmp.w    #100,d1            ;best fit in 100 lines (100%)
  330.         bgt    halve_max
  331.  
  332. double_max    add.w    d0,d0            ;sample factor *2
  333.         lsr.w    #1,d2            ;100 -> 50
  334.         add.w    d1,d1            ;max *2
  335.         cmp.w    #100,d1
  336.         blt    double_max
  337.  
  338.         lsr.w    #1,d0            ;undo overshooting
  339.         add.w    d2,d2
  340.         lsr.w    #1,d1
  341.         bra    window_factor
  342. ;- - - - - - - -
  343. halve_max    lsr.w    #1,d0            ;factor <- factor/2
  344.         add.w    d2,d2            ;100 -> 200
  345.         lsr.w    #1,d1            ;max <- max/2
  346.         cmp.w    #100,d1
  347.         bgt    halve_max
  348.  
  349. window_factor    move.w    d2,axis_max
  350.  
  351.         move.w    w_lines,d1
  352.         sub.w    #TOP_CLEARANCE,d1    ;-dragbar/borders/labels
  353.         mulu    d1,d0
  354.         divu    #100,d0
  355.         move.w    d0,factor
  356.         rts
  357. ;---------------------------------------
  358. read_data    move.l    4.w,a6
  359.         move.l    #50000,d0        ;allocate memory to read **!!
  360.         moveq    #0,d1            ;entire file
  361.         EXEC    AllocMem
  362.         move.l    d0,file_buffer
  363.         beq    error
  364.  
  365.         move.l    DOS_LIB_PTR,a6
  366.         move.l    in_fhandle,d1
  367.         move.l    file_buffer,d2
  368.         move.l    #50000,d3        ;**!! should find out how big
  369.         DOS    Read            ;file is **!!
  370.  
  371.         add.l    file_buffer,d0
  372.         move.l    d0,file_end        ;calc addr of end of buffer
  373.         rts
  374. ;---------------------------------------
  375. gen_chart_struct
  376.         move.l    file_buffer,a0    ;ASCII source file
  377.         lea    chart_data,a5    ;destination chart structure
  378.  
  379. convert_file    bsr    get_decimal        ;get height value (0..64K)
  380.         move.w    d0,(a5)+        ;save value
  381.         move.l    a0,(a5)+        ;save label pointer
  382.  
  383. find_eos    move.b    (a0)+,d0        ;find end of label
  384.         cmp.b    #LF,d0            ;1st space or LF
  385.         beq    mark_eos
  386.         cmp.b    #SPC,d0
  387.         bne.s    find_eos
  388.         clr.b    -1(a0)
  389.  
  390. find_eol    cmp.b    #LF,(a0)+
  391.         bne    find_eol
  392.         bra    check_done
  393.  
  394. mark_eos    clr.b    -1(a0)            ;then change into C-string
  395.  
  396. check_done    cmp.l    file_end,a0        ;all lines done ?
  397.         bne.s    convert_file
  398.  
  399.         move.w    #-1,(a5)+        ;mark end of list
  400.         clr.l    (a5)+
  401.         rts
  402. ;---------------------------------------
  403. ; A0 -> start of argument line        **!!
  404. ; D0 = # of args chars
  405.  
  406. process_args    cmp.b    #' ',(a0)+    ;skip any leading spaces
  407.         beq.s    process_args
  408.         subq.w    #1,a0
  409.         move.l    a0,args_ptr    ;save addr of argument to prg
  410.  
  411. find_eo_fname    cmp.b    #LF,(a0)+    ;scan to first LF or SPC
  412.         beq.s    mark_eofn
  413.         cmp.b    #' ',-1(a0)
  414.         bne.s    find_eo_fname
  415.  
  416. mark_eofn    clr.b    -1(a0)        ;change LF to NULL (C-string)
  417.         rts
  418. ;---------------------------------------
  419. ; A0 -> string dest
  420. ; D0 = # to be cvtd (LONG)
  421. ; D1 = # of chars wanted            USES: D0/D1/D2 A0/A1
  422.  
  423. bin_to_dec    subq.w    #8,d1
  424.         neg.w    d1
  425.         add.w    d1,d1
  426.         add.w    d1,d1
  427.         lea    powers(PC,d1),a1
  428.  
  429. next_pow    move.l    (a1)+,d1
  430.         moveq    #0,d2
  431. weigh        sub.l    d1,d0
  432.         bcs.s    gotya
  433.         addq.w    #1,d2
  434.         bra.s    weigh
  435. gotya        add.l    d1,d0
  436.         add.b    #'0',d2
  437.         move.b    d2,(a0)+
  438.         subq.l    #1,d1
  439.         bne.s    next_pow
  440.         rts
  441.  
  442. powers        dc.l    10000000    7
  443.         dc.l    1000000        6
  444.         dc.l    100000        5
  445.         dc.l    10000        4
  446.         dc.l    1000        3
  447.         dc.l    100        2
  448.         dc.l    10        1
  449.         dc.l    1        0
  450. ;---------------------------------------
  451. ; A0 -> decimal string 
  452. ; RETURNS D0.W = number (0..65535)        **!!
  453. ;    A0-> first non-numeric char
  454.  
  455. get_decimal    moveq    #0,d0        ;clear Accum.
  456.         moveq    #0,d1        ;clear LONG reception reg
  457.         bra    wh_decimal
  458.  
  459. accum_digit    mulu    #10,d0        ;shift curr value
  460.         add.w    d1,d0        ;OR new digit
  461.  
  462. wh_decimal    move.b    (a0)+,d1    ;get char
  463.         sub.b    #'0',d1        ;must be digit
  464.         bcs    not_digit
  465.         cmp.b    #10,d1
  466.         bcs    accum_digit
  467.  
  468. not_digit    subq.w    #1,a0        ;backtrack over offending char
  469.  
  470. skip_spaces    cmp.b    #' ',(a0)+
  471.         beq.s    skip_spaces
  472.  
  473.         subq.w    #1,a0        ;backtrack over 1st non-num/spc
  474.         rts
  475. ;---------------------------------------
  476. open_libraries    move.l    4.w,a6
  477.         lea    dos_name,a1
  478.         moveq    #0,d0
  479.         EXEC    OpenLibrary        ;open DOS
  480.         move.l    d0,DOS_LIB_PTR
  481.         bne    got_dos
  482.         moveq    #-1,d7
  483.         jmp    error
  484.  
  485. got_dos        lea    gfx_name,a1
  486.         moveq    #0,d0
  487.         EXEC    OpenLibrary        ;open GFX
  488.         move.l    d0,GFX_LIB_PTR
  489.         bne    got_gfx
  490.         moveq    #-1,d7
  491.         jmp    error
  492.  
  493. got_gfx        lea    intui_name,a1
  494.         moveq    #0,d0
  495.         EXEC    OpenLibrary        ;open Intuition
  496.         move.l    d0,INTUI_LIB_PTR
  497.         bne    got_intui
  498.         moveq    #-1,d7
  499.         jmp    error
  500.  
  501. got_intui    rts
  502. ;---------------------------------------
  503. error        move.l    top_level,SP
  504.  
  505.         move.l    DOS_LIB_PTR,d0    ;did we ever get DOS ?
  506.         beq    no_dos
  507.         move.l    d0,a6
  508.         move.l    in_fhandle,d1    ;yes, then maybe the file
  509.         beq    no_file
  510.         DOS    Close            ;yes: close
  511.  
  512. no_file        move.l    4.w,a6
  513.         move.l    DOS_LIB_PTR,a1    ;& close DOS
  514.         EXEC    CloseLibrary
  515.  
  516. no_dos        move.l    GFX_LIB_PTR,a1
  517.         EXEC    CloseLibrary    ;close GFX
  518.  
  519.         move.l    INTUI_LIB_PTR,d0    ;did we ever get Intuition?
  520.         beq    no_intuition        ;yes,
  521.         move.l    d0,a6
  522.         move.l    window,d0
  523.         beq    no_window
  524.         move.l    d0,a0            ;maybe the window too?
  525.         INTUI    CloseWindow        ;yes: close
  526.  
  527. no_window    move.l    a6,a1            ;& close Intuition
  528.         move.l    4.w,a6
  529.         EXEC    CloseLibrary
  530.  
  531. no_intuition    move.l    4.w,a6            ;free file buffer
  532.         move.l    file_buffer,d1
  533.         beq    exit            ;if ever gotten !
  534.         move.l    #50000,d0
  535.         move.l    d1,a1
  536.         EXEC    FreeMem
  537.  
  538. exit        move.l    d7,d0
  539.  
  540. dummy        rts
  541. ;---------------------------------------
  542. chart_windowdef    dc.w    320-WINDOW_WIDTH/2,32        ;origin
  543.         dc.w    WINDOW_WIDTH,WINDOW_LINES    ;dimensions
  544.         dc.b    0,1
  545.         dc.l    WINDOW_IDCMP
  546.         dc.l    WINDOW_FLAGS
  547.         dc.l    0        ;no gadgets
  548.         dc.l    0        ;std checkmark
  549.         dc.l    window_name
  550.         dc.l    0,0        ;Workbench screen, no custom Bitmap
  551.         dc.w    300,110        ;min W,H
  552.         dc.w    8192,8192    ;max W,H
  553.         dc.w    WBENCHSCREEN
  554.  
  555. window_name    dc.b    'Barchart V0.91 ⌐LVA 9/10/89       file:'
  556. window_title    ds.b    256
  557. ;---------------------------------------
  558. chart_data    ds.w    50*(1+2)    ;**!! should allocate depending on
  559.         dc.w    -1,0,0        ;# of input file entries **!!
  560. ;---------------------------------------
  561. dec_out        ds.b    6
  562. ;---------------------------------------
  563.  
  564. dos_name    DOSNAME
  565. gfx_name    GRAFNAME
  566. intui_name    INTNAME
  567.  
  568. DOS_LIB_PTR    ds.l    1
  569. GFX_LIB_PTR    ds.l    1
  570. INTUI_LIB_PTR    ds.l    1
  571.  
  572. top_level    ds.l    1        ;for SP
  573. args_ptr    ds.l    1        ;for CLI args
  574. file_buffer    ds.l    1
  575. file_end    ds.l    1
  576. in_fhandle    ds.l    1
  577. window        ds.l    1
  578. rastport    ds.l    1
  579. msgport        ds.l    1
  580. imsg_class    ds.l    1
  581. imsg_code    ds.w    1
  582. imsg_addr    ds.l    1
  583. imsg_ratcords    ds.l    1
  584.  
  585. w_width        ds.w    1        ;window width in pixels
  586. w_lines        ds.w    1        ;window lines
  587. num_values    ds.w    1
  588. max_value    ds.w    1
  589. factor        ds.w    1
  590. axis_max    ds.w    1
  591.  
  592. flags        ds.b    1
  593.  
  594.         END
  595.