home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / POWERMAG / POWER051.MSA / PD_ASSEMBLY_DATA.S < prev    next >
Text File  |  1993-02-24  |  17KB  |  728 lines

  1.  
  2.     include    'biosmac.i'
  3.     include    'xbiosmac.i'
  4.     include    'gmdosmac.i'
  5. screen_width    equ    80
  6. screen_height    equ    24
  7. max_item    equ    70
  8. max_num_items    equ    10
  9. max_entries    equ    200    maximum no. of records, alter if you need more
  10.  
  11. *************************
  12. *To set up your own records, replace the following
  13. *with the name and size (eg 20 characters) of your own fields.
  14. *change num_fields and len_entry appropriately. 
  15. *An example of address records is included. Delete the
  16. *asterisks and replace them in front of the book record fields.
  17. *You will need to alter the data at the following labels found below:-
  18. *title_ref
  19. *reference_list
  20. *fields
  21. *input_strings
  22.  
  23.  
  24. len_book_title    equ    30    1st field is 30 characters
  25. len_author    equ    20    2nd field is 20 characters
  26. len_ISBN    equ    15    3rd field is 15 characters
  27. len_cost    equ    8    4th field is 8 characters
  28. num_fields    equ    4    The number of fields
  29. len_entry    equ    len_book_title+len_author+len_ISBN+len_cost+num_fields
  30. *len_entry = sum of field labels +num_fields
  31. *don't forget to include num_fields in len_entry total
  32.  
  33. *len_name_string    equ    20
  34. *len_address_string    equ    20    we use three of these
  35. *len_postcode_string    equ    10
  36. *len_phone_string    equ    20
  37. *num_fields    equ    6
  38. *len_entry    equ    len_name_string+len_address_string*3+len_postcode_string+len_phone_string+num_fields
  39. *************************
  40. len_file_buff    equ    256
  41. keyboard    equ    2
  42. stacksize    equ    1000
  43.     move.l    4(a7),a3
  44.     move.l    #ourstack+(stacksize*2),a7    
  45.     bsr    initialise_program    
  46.     Getrez
  47.     move.w    d0,our_res
  48.     bsr    set_adjustments        routine that adjusts for current
  49.                     *screen resolution
  50.     bsr    find_file        routine sets zero flag if
  51.                     *new file
  52.     beq    close_file        if zero flag set, no records to load
  53.     bsr    load_records        else load records from file
  54. close_file
  55.     Fclose    file_handle        Macro to close file opened in find_file
  56. main_loop
  57.     Cconws    #cursor_off        Macro to print a null terminated 
  58.                     *string - see cursor_off in the data
  59.                     *section for examples of these strings
  60.     move.l    #menu_items,a0
  61.     move.b    #-1,d0
  62.     bsr    menu            routine to draw menus - see menu_items
  63.                     *in the data section
  64.     move.b    #0+32,x
  65.     move.b    #1+32,y
  66.     Cconws    #position_cursor
  67.     Cconws    #pick_a_num        print more strings
  68. another_key
  69.     Bconin    #2            Macro - waits for a keypress
  70.     cmpi.w    #'1',d0            d0 contains ASCII code of key pressed
  71.     bne    try_2    
  72.     bsr    add_a_record
  73.     bra    main_loop        jump back to main loop
  74. try_2    cmpi.w    #'2',d0
  75.     bne    try_3
  76.     bsr    show_records
  77.     bra    main_loop
  78. try_3    cmpi.w    #'3',d0
  79.     bne    another_key
  80.     bsr    ask_save
  81.     bsr    save_these_records
  82.     Pterm    #0
  83.     
  84. find_file
  85.     Fopen    #0,#filename    We need to open our file
  86.     move.w    d0,file_handle    and save the file handle
  87.     cmpi.w    #0,d0        was there an error
  88.     bpl    .opened_ok    
  89.     Cconws    #no_file    yes, print no_file message
  90.     Bconin    #2        wait for keypress
  91.     andi.w    #%1011111,d0    convert to upper case
  92.     cmpi.w    #'Y',d0
  93.     beq    .create_file    try creating a file
  94.     Pterm    #0
  95. .create_file
  96.     Fcreate    #0,#filename
  97.     move.w    d0,file_handle
  98.     cmpi.w    #0,d0
  99.     bmi    .not_created
  100.     move.w    #0,file_record_count
  101.     Fwrite    #file_record_count,#2,file_handle    start of with 
  102.                             *a count of zero
  103.     bra    .opened_ok
  104. .not_created
  105.     move.l    #file_error,a1
  106.     bra    print_error
  107.  
  108. .opened_ok
  109.     Fread    #file_record_count,#2,file_handle    read in number of 
  110.                             *records
  111.     move.w    file_record_count,d0        check if there are any
  112.     rts
  113.     
  114. load_records
  115.     move.w    d0,last_record    
  116.     Fread    #file_buffer,#len_file_buff,file_handle    *Read from our file
  117.     cmp.w    #len_file_buff,d0    d0 contains len_file_buff (see equ's)
  118.                     *if end of file not yet reached
  119.     beq    .keep_going
  120.     move.b    #1,last_time
  121. .keep_going
  122.     move.l    #file_buffer,a6
  123.     move.l    d0,d3
  124.     move.w    #0,d4
  125. .next_record
  126.     move.w    d4,loading_this_record
  127.     cmp.w    last_record,d4
  128.     beq    .done
  129.     mulu.w    #len_entry,d4
  130.     move.l    #main_storage,a1
  131.     move.l    #reference_list,a4
  132.     move.w    #num_fields-1,d7
  133. .move_next
  134.     move.b    (a4)+,d5
  135.     add.w    d5,d4    
  136.     lea    0(a1,d4),a3
  137.     sub.w    d5,d4    restore it's old value    
  138.     move.l    a3,a5
  139. .find_zero
  140.     subq.w    #1,d3    do we need to load more from the file?
  141.     bne    .more_buffer    no
  142.     cmp.b    #1,last_time
  143.     beq    .done
  144.     Fread    #file_buffer,#len_file_buff,file_handle
  145.     move.l    #file_buffer,a6
  146.     
  147. .more_buffer
  148.     move.b    (a6)+,(a3)+
  149.     bne    .find_zero
  150.     dbra    d7,.move_next
  151.     move.w    loading_this_record,d4
  152.     addq.w    #1,d4
  153.     bra    .next_record
  154. .done
  155.     move.b    #0,(a3)    
  156.     rts
  157.  
  158. add_a_record
  159.     move.w    last_record,d2
  160.     cmpi.w    #max_entries,d2        room for another?
  161.     bne    .add_another            yes
  162.     move.b    #0+32,x                else display message
  163.     move.b    #0+32,y
  164.     Cconws    #position_cursor
  165.     Cconws    #no_more_room
  166.     Bconin    #2
  167.     rts                    and return
  168. .add_another
  169.     Cconws    #cls
  170.     move.l    #fields,a0
  171.     
  172. left_margin    equ    8
  173.     move.w    #left_margin,d0
  174.     ext.l    d0
  175.     divu.w    x_adjust,d0
  176.     bsr    menu
  177.     move.w    #left_margin,d4
  178.     ext.l    d0
  179.     divu.w    x_adjust,d4
  180.     add.w    d0,d4
  181.     move.w    d6,d5    y_coordinate as returned by menu
  182.     subi.w    #32,d5
  183.     move.w    d7,d3    no. of strings, as returned by menu
  184.     move.l    #input_strings,a3
  185.     Cconws    #cursor_on
  186.     bsr    input_str
  187.     move.l    #input_strings,a0
  188.     bsr    was_there_an_entry
  189.     beq    .done
  190.     bsr    store_entry
  191. .done
  192.     rts
  193.     
  194. was_there_an_entry
  195. *    Routine to check if any data was input
  196. *    a0 contains array of TOS Cconin call style strings
  197.     movem.l    d1-3/a0,-(sp)
  198.     clr.l    d2
  199.     move.w    d7,d3
  200.     subq.w    #1,d3
  201. .try_next
  202.     lea    (a0,d2),a0
  203.     move.b    (a0),d2
  204.     addq.w    #2,d2        ignore the 1st 2 bytes of each string
  205.     move.b    1(a0),d1
  206.     dbne    d3,.try_next
  207.     movem.l    (sp)+,d1-3/a0
  208.     rts
  209.  
  210. store_entry
  211.     movem.l    d0-1/d3/a0-4,-(sp)
  212.     move.w    d7,d3
  213.     subq.w    #1,d3
  214.     move.l    #input_strings,a0
  215.     move.w    last_record,d0
  216.     mulu.w    #len_entry,d0
  217.     move.l    #main_storage,a1
  218.     move.l    #reference_list,a4
  219. .move_next
  220.     move.b    (a4)+,d1    move the rs directive (stored at reference_list)
  221.     add.w    d1,d0        add it to number of new entry
  222.     lea    0(a1,d0),a3    load it into a3
  223.     sub.w    d1,d0    restore it's old value    
  224.     bsr    move_entry
  225.     dbra    d3,.move_next
  226.  
  227.     move.w    last_record,d0
  228.     addq.w    #1,d0            update count of records
  229.     move.w    d0,last_record
  230.     movem.l    (sp)+,d0-1/d3/a0-4
  231.  
  232.     rts
  233.     
  234. move_entry
  235.     move.l    a0,a2
  236.     addq.l    #1,a2
  237.     move.b    (a2)+,d1
  238.     beq    .no_entry
  239.     ext.w    d1    just in case
  240.     subq.w    #1,d1
  241. .move_name
  242.     move.b    (a2)+,(a3)+
  243.     dbra    d1,.move_name
  244. .no_entry
  245.     move.b    #0,(a3)    null terminate it
  246.     clr.l    d1
  247.     move.b    (a0),d1
  248.     add.l    d1,a0
  249.     addq.l    #2,a0
  250.  
  251.     rts
  252.  
  253. show_records
  254.     move.w    #0,this_record    *display first record
  255.     move.w    last_record,d1    sets the zero flag if no records entered yet
  256.     bne    display_next        display them if zero clear
  257.     move.b    #1+32,x            else display message
  258.     move.b    #1+32,y
  259.     Cconws    #position_cursor
  260.     Cconws    #no_records
  261.     Bconin    #2
  262.     rts
  263.  
  264. display_next
  265. *    displays the record number stored in this_record
  266. *    this record number must exist or unpredictable
  267. *    results will occur
  268.     move.w    this_record,d0
  269.     bsr    move_record
  270.     bsr    display_record
  271.     Bconin    #2    
  272.     swap.w    d0    this swaps the high and low word of d0
  273.     move.b    d0,d1
  274.     swap.w    d0
  275.     cmpi.b    #$31,d1            was <n> pressed?
  276.     bne    .not_alternate_n        no
  277.     cmpi.b    #0,d0            yes - was it alternate n
  278.     bne    .not_alternate_n
  279.     move.w    this_record,d0
  280.     addq.w    #1,d0            next record number
  281.     move.w    last_record,d1
  282.     cmp.w    d1,d0            any more records?
  283.     beq    .no_more        no - stay with this one
  284.     move.w    d0,this_record
  285. .no_more
  286.     bra    display_next
  287. .not_alternate_n
  288.     cmpi.b    #$19,d1            was <p> pressed?
  289.     bne    .not_alternate_p        no
  290.     cmpi.b    #0,d0            yes - was it alternate p
  291.     bne    .not_alternate_p
  292.     move.w    this_record,d0
  293.     beq    .dont_move_back
  294.     subq.w    #1,d0
  295.     move.w    d0,this_record
  296. .dont_move_back    
  297.     bra    display_next
  298. .not_alternate_p
  299.     cmpi.w    #$1b,d0            was Esc pressed?
  300.     bne    display_next            no - next key press
  301.     rts                    yes - back to menu
  302.     
  303. display_record
  304.     move.l    #display_strings,a0
  305.     move.b    #-1,d0
  306.     bsr    menu
  307.     move.b    #0+32,x
  308.     move.b    #0+32,y
  309.     Cconws    #position_cursor
  310.     Cconws    #display_key1
  311.     move.b    #1+32,y
  312.     Cconws    #position_cursor
  313.     Cconws    #display_key2
  314.     move.b    #2+32,y
  315.     Cconws    #position_cursor
  316.     Cconws    #display_key3
  317. rts
  318.  
  319. move_record
  320. *    displays the record number found in d0
  321. *    this record number must exist
  322.     movem.l    d0-2/a0-3,-(sp)
  323.     mulu.w    #len_entry,d0
  324.     move.l    #main_storage,a0
  325.     add.w    d0,a0
  326.     move.l    a0,a3
  327.     move.l    #display_strings,a1
  328.     move.w    #num_fields-1,d1
  329.     clr.l    d2
  330.     move.l    #reference_list,a2
  331. .move_next
  332.     move.b    (a2)+,d2
  333.     lea    0(a3,d2),a0
  334.     move.b    (a0),d0        check that there is a string
  335.     beq    .no_string
  336. .move_it
  337.     move.b    (a0)+,(a1)+
  338.     bne    .move_it
  339. .no_string
  340.     dbra    d1,.move_next
  341.     move.b    #0,(a1)        add the final zero
  342.     moveq.b    #1,d0        clear the zero flag
  343. .done    
  344.     movem.l    (sp)+,d0-2/a0-3
  345.     rts
  346.  
  347. ask_save
  348.     move.b    #0+32,x
  349.     move.b    #0+32,y
  350. .unknown_key
  351.     Cconws    #position_cursor
  352.     Cconws    #wanna_save
  353.     Bconin    #2
  354.     andi.w    #%1011111,d0    convert to upper case
  355.     cmpi.w    #'Y',d0
  356.     beq    .save_first
  357.     cmpi.w    #'N',d0
  358.     bne    .unknown_key
  359.     Pterm    #0    
  360. .save_first    
  361.     rts
  362.  
  363. save_these_records
  364.     Fopen    #1,#filename
  365.     move.w    d0,file_handle
  366.     cmpi.w    #0,d0
  367.     bpl    .opened_ok
  368.     Cconws    #no_file
  369.     Bconin    #2
  370.     andi.w    #%1011111,d0    convert to upper case
  371.     cmpi.w    #'Y',d0
  372.     beq    .create_file
  373.     rts
  374. .create_file
  375.     Fcreate    #0,#filename
  376.     move.w    d0,file_handle
  377.     cmpi.w    #0,d0
  378.     bpl    .opened_ok
  379.     Cconws    #cls
  380.     Cconws    #file_error
  381.     Bconin    #2
  382.     rts
  383. .opened_ok
  384.     Fwrite    #last_record,#2,file_handle    save number of records
  385.     move.w    last_record,d3
  386.     subq.w    #1,d3    for dbra
  387.     move.w    #0,d4
  388. .next_record
  389.     move.w    d4,saving_this_record
  390.     cmp.w    last_record,d4
  391.     beq    .done
  392.     mulu.w    #len_entry,d4
  393.     move.l    #main_storage,a1
  394.     move.l    #reference_list,a4
  395.     move.w    #num_fields-1,d7
  396. .move_next
  397.     move.b    (a4)+,d5
  398.     add.w    d5,d4    
  399.     lea    0(a1,d4),a3
  400.     move.l    a3,a5
  401.     sub.w    d5,d4    restore it's old value    
  402.     clr.w    d6    count the characters in each field
  403. .find_zero
  404.     addq.w    #1,d6
  405.     move.b    (a3)+,d5
  406.     bne    .find_zero
  407.     Fwrite    a5,d6,file_handle    save a field
  408.     dbra    d7,.move_next
  409.     move.w    saving_this_record,d4
  410.     addq.w    #1,d4
  411.     bra    .next_record
  412.  
  413.     
  414. .done    
  415.     Fclose    file_handle
  416.     rts
  417.  
  418. initialise_program    
  419.     move.l    $c(a3),d0    *length of text
  420.     add.l    $14(a3),d0    *length of data
  421.     add.l    $1c(a3),d0    *length of BSS
  422.     add.l    #$100,d0    *length of basepage
  423.     Mshrink    d0,a3        *Macro to return unwanted memory
  424.     rts
  425. menu
  426. *    on entry
  427. *    a0.l    address of 1st string array
  428. *    d0.b    -1 to centre menu
  429. *        or x coordinate for menu
  430. *
  431. *    returns    d0.w=length in characters of longest menu item
  432. *    returns    d6.w= y-coordinate+32 of 1st menu entry
  433. *    returns    d7.w= number of menu items 
  434.     addi.b    #32,d0
  435.     move.b    d0,x
  436.     movem.l    d1-5/a1/a3,-(sp)
  437.     bsr    .calc_left_margin
  438.     cmp.b    #31,x
  439.     bne    .not_centered
  440.     move.b    d0,x    
  441. .not_centered
  442.     move.l    a0,a3
  443.     move.w    #screen_height,d3
  444.     sub.w    d5,d3
  445.     ext.l    d0
  446.     divu    #2,d3
  447.     addi.b    #32,d3    for 27+Y
  448.     move.w    d3,d6
  449.     clr.w    d7    count number of menu items
  450.     Cconws    #cls
  451. .print_item
  452.     addq.w    #1,d7
  453.     move.b    d3,y
  454.     Cconws    #position_cursor
  455.     Cconws    a3
  456. .find_string
  457.     move.b    (a3)+,d2
  458.     bne    .find_string
  459.     addq.w    #1,d3
  460.     move.b    (a3),d2
  461.     bne    .print_item
  462.     move.w    d4,d0    return the longest string output
  463.     movem.l    (sp)+,d1-5/a1/a3
  464.     rts
  465.  
  466. .calc_left_margin    
  467.     move.l    a0,a1
  468.     move.w    #max_item,d1
  469.     ext.l    d0
  470.     divu.w    x_adjust,d1
  471.     move.w    d1,d2
  472.     move.w    d1,d3
  473.     clr.w    d4
  474.     clr.w    d5
  475. .find_zero
  476.     move.b    (a1)+,d0
  477.     dbeq    d1,.find_zero
  478.     cmpi.w    #0,d1
  479.     bge    .got_it
  480.     move.l    #menu_sz_error,a1
  481.     bra    print_error
  482. .got_it    sub.w    d1,d3    length of string
  483.     cmp.w    d3,d4    which is max
  484.     bhi    .next_item
  485.     move.w    d3,d4
  486. .next_item    
  487.     addq.w    #1,d5    count no. of menu items
  488.  
  489.     move.b    (a1),d0    double null term?
  490.     beq    .all_done
  491.     move.w    d2,d3
  492.     move.w    d2,d1
  493.     bra    .find_zero
  494. .all_done
  495.     move.w    #screen_width,d0
  496.     ext.l    d0
  497.     divu    x_adjust,d0
  498.     sub.w    d4,d0
  499.     divu    #2,d0
  500.     addi.w    #32,d0    VT52 cursor position has 32,32 as top left
  501.     rts
  502.     
  503.     
  504.     
  505.     
  506. ***************************************
  507. *
  508. *    routine to return a series
  509. *    of user input strings
  510. *    on entry
  511. *    d3.w    contains no. of strings
  512. *    d4.b    contains x coordinate to echo 1st string
  513. *    d5.b    contains y coordinate to echo strings
  514. *    a3      contains address of consecutive buffers
  515. *        for the strings
  516. *
  517. *    the buffers for the strings should be as for TOS Cconin call
  518. *
  519. ******************************************
  520. input_str    
  521.     subq.w    #1,d3
  522.     move.l    a4,-(sp)
  523.     addi.b    #32,d4
  524.     move.b    d4,x
  525.     addi.b    #32,d5
  526. .next_string
  527.     move.b    d5,y
  528.     lea    2(a3),a4
  529.     move.b    (a3),d4    get max length of input string
  530.     clr.b    d6
  531.     Cconws    #position_cursor
  532.  
  533. .get_key_loop
  534.     Bconin    #2
  535.     cmpi.w    #32,d0
  536.     bge    .store_it
  537.     cmpi.w    #8,d0    *was it a backspace
  538.     bne    .carriage_return    No,try a CR
  539.     cmpi.b    #0,d6        is this the first character?
  540.     beq    .carriage_return    yes, ignore it
  541.     Bconout    #8,#2    otherwise print a backspace
  542.     Bconout    #32,#2    print a space
  543.     Bconout    #8,#2    followed by a backspace
  544.     subq.l    #1,a4    
  545.     subq.b    #1,d6    
  546.     bra    .carriage_return
  547.             
  548. .store_it
  549.     cmp.b    d6,d4    have we had maximum characters
  550.     beq    .carriage_return    unless it's a CR,ignore it
  551.     addq.b    #1,d6    count how many characters
  552.     move.b    d0,(a4)+
  553. .print_it
  554.     Bconout    d0,#2
  555. .carriage_return
  556.     cmpi.w    #13,d0
  557.     bne    .get_key_loop
  558.     move.b    d6,1(a3)    save actual length input
  559.     addq.b    #1,d5    next y position
  560.     move.b    (a3),d4
  561.     ext.w    d4
  562.     lea    2(a3,d4),a3
  563.     dbra    d3,.next_string
  564.     
  565.     move.l    (sp)+,a4
  566.     rts
  567.     
  568.     
  569.  
  570. set_adjustments
  571.     cmpi.w    #2,d0
  572.     bne    med_res
  573.     move.w    #1,x_adjust    
  574.     move.w    #1,y_adjust    
  575.     rts
  576. med_res    cmpi.w    #1,d0
  577.     bne    lo_res
  578.     move.w    #1,x_adjust    
  579.     move.w    #2,y_adjust    
  580.     rts
  581. lo_res    cmpi.w    #0,d0
  582.     bne    what_res
  583.     move.w    #2,x_adjust    
  584.     move.w    #2,y_adjust    
  585.     rts
  586. what_res
  587.     move.l    #res_error,a1        
  588.     bra    print_error
  589.     rts
  590.  
  591. print_error
  592.     move.w    d0,error_number
  593.     Cconws    a1        
  594.     Bconin    #keyboard    
  595.     Pterm    error_number    
  596.  
  597.  
  598.  
  599.  
  600.  
  601.     data
  602.     
  603.     even
  604. *********************************
  605. *memory to store data when input
  606. *replace when setting up your own fields, an example is given
  607. *for address fields
  608. input_strings    
  609. title    dc.b    len_book_title,0
  610.     dcb.b    len_book_title        *declares a block of data len_book_title bytes long
  611. author    dc.b    len_author,0
  612.     dcb.b    len_author
  613. ISBN    dc.b    len_ISBN,0
  614.     dcb.b    len_ISBN
  615. cost    dc.b    len_cost,0
  616.     dcb.b    len_cost
  617.  
  618. *name    dc.b    len_name_string,0
  619. *    dcb.b    len_name_string
  620. *address1    dc.b    len_address_string,0
  621. *    dcb.b    len_address_string
  622. *address2    dc.b    len_address_string,0
  623. *    dcb.b    len_address_string
  624. *address3    dc.b    len_address_string,0
  625. *    dcb.b    len_address_string
  626. *post_code    dc.b    len_postcode_string,0
  627. *    dcb.b    len_postcode_string
  628. *telephone    dc.b    len_phone_string,0
  629. *    dcb.b    len_phone_string
  630.  
  631. cls    dc.b    27,'E',0
  632.  
  633. *******These must stay together
  634. position_cursor    dc.b    27,'Y'
  635. y    dc.b    ' '
  636. x    dc.b    ' ',0
  637. *******************************
  638. cursor_on    dc.b    27,'e',0
  639. cursor_off    dc.b    27,'f',0
  640. menu_items
  641.     dc.b    '1..Add An Entry',0
  642.     dc.b    '2..Display Entries',0
  643.     dc.b    '3..Quit',0
  644.     dc.b    0    Make sure this line is always present at the end
  645.  
  646.  
  647. *add your own fields here, examples below for address records
  648. fields
  649.     dc.b    'Title........',0
  650.     dc.b    'Author.......',0
  651.     dc.b    'ISBN.........',0
  652.     dc.b    'Cost.........',0
  653.     dc.b    0    Make sure this line is always present at the end
  654.  
  655. *    dc.b    'Name.........',0
  656. *    dc.b    'Address......',0
  657. *    dc.b    '       ......',0
  658. *    dc.b    '       ......',0
  659. *    dc.b    'Post Code....',0
  660. *    dc.b    'Telephone....',0
  661. *    dc.b    0    Make sure this line is always present at the end
  662.  
  663. res_error    dc.b    'I dont know that resolution',0
  664. menu_sz_error    dc.b    'Menu too large for this resolution',0
  665. no_file        dc.b    'Could not open data.dbf',13,10
  666.         dc.b    'OK to create a file   y/n',0
  667. file_error    dc.b    'Could not create/open file',0
  668. display_key1    dc.b    'alternate n - next record',0
  669. display_key2    dc.b    'alternate p - previous record',0
  670. display_key3    dc.b    'Esc to return to main menu',0
  671. wanna_save    dc.b    'Save this file? y/n',0
  672. no_records    dc.b    'No records to find',0
  673. pick_a_num    dc.b    'Pick a Number',0
  674. no_more_room    dc.b    'Sorry, too many records',13,11
  675.         dc.b    'Press any key',0
  676. filename    dc.b    'data.dbf',0
  677.  
  678. *********************************    
  679. *This is our reference list for the rs section
  680. *alter this if you alter the fields
  681. *example for the address book is included in comments
  682.  
  683. reference_list    dc.b    title_ref,author_ref,ISBN_ref,cost_ref
  684. *reference_list    dc.b    name_ref,address1_ref,address2_ref,address3_ref,post_code_ref,phone_ref
  685. *****************************
  686.     bss
  687.  
  688. *********************************    
  689. *This is our rs section for our fields
  690. *alter this if you alter the fields
  691. *examples for the address book are included in comments
  692.     even
  693.     rsreset
  694.  
  695.  
  696. title_ref    rs.b    len_book_title+1
  697. author_ref    rs.b    len_author+1
  698. ISBN_ref    rs.b    len_ISBN+1
  699. cost_ref    rs.b    len_cost+1
  700.  
  701. *name_ref    rs.b    len_name_string+1
  702. *address1_ref    rs.b    len_address_string+1
  703. *address2_ref    rs.b    len_address_string+1
  704. *address3_ref    rs.b    len_address_string+1
  705. *post_code_ref    rs.b    len_postcode_string+1
  706. *phone_ref    rs.b    len_phone_string+1
  707. *****************************
  708.  
  709.  
  710.     even
  711. saving_this_record    ds.w    1
  712. loading_this_record    ds.w    1
  713. file_handle    ds.w    1
  714. file_record_count    ds.w    1
  715. last_record    ds.w    1
  716. this_record    ds.w    1
  717. x_adjust    ds.w    1
  718. y_adjust    ds.w    1
  719. our_res    ds.w    1
  720. error_number    ds.w    1
  721. ourstack    ds.w    stacksize
  722. file_buffer    ds.b    len_file_buff
  723. last_time    ds.b    1
  724.     even
  725. main_storage    ds.b    max_entries*len_entry
  726.     even
  727. display_strings    ds.b    len_entry+1    *+1 for final null term
  728.