home *** CD-ROM | disk | FTP | other *** search
/ Falcon 030 Power 2 / F030_POWER2.iso / ST_STE / MAGS / ICTARI09.ARJ / ictari.09 / ASSEMBLY / COOKFIND / COOKFIND.S next >
Text File  |  1993-11-30  |  1KB  |  50 lines

  1.     include macro_v1.i
  2.     
  3.     Prog_shrink 1024    ;shrink program and setup 1K stack
  4.  
  5.     Cconout    #27        ;clear screen
  6.     Cconout    #VT_CLS
  7.     
  8.     move.l    Basepage,a0
  9.     bsr    Read_cmdlin    ;get cookie required from command line
  10.     move.l    (a0),cookie
  11.     move.l    (a0),d0
  12.     bsr    Get_cookie
  13.     tst.w    d0        ;0 if successful
  14.     beq.s    passed        ;else print "cookie not found"
  15.     Cconws    #fail_str
  16.     bra    end
  17.     
  18. passed    move.l    d1,cookval    ;safe from OS calls
  19.     move.l    cookie,title_str+22
  20.     Cconws    #title_str
  21.     move.l    cookval,d0
  22.     move.w    #32,d1            ;bits to convert
  23.     move.l    #title1_str+17,a0
  24.     bsr    Bin_str            ;long to binary string 
  25.     Cconws    #title1_str
  26.     move.l    cookval,d0
  27.     move.w    #4,d1            ;bytes to convert
  28.     move.l    #title2_str+17,a0
  29.     bsr    Hex_str
  30.     Cconws    #title2_str
  31.     Cconout    #CR
  32.     Cconout    #LF
  33. end    Cconin
  34.     Prog_exit
  35.     
  36.     include    g_cookie.s
  37.     include read_cmd.s    
  38.     include bin_str.s
  39.     include    hex_str.s
  40.     
  41.         DATA
  42. fail_str    dc.b    "Cookie not found!",13,10,0
  43. title_str    dc.b    13,10,"Looking for Cookie: XXXX",0
  44. title1_str    dc.b    13,10," Binary Value: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",0
  45. title2_str    dc.b    13,10,"    Hex Value: XXXXXXXX",0
  46.         
  47.         BSS
  48. cookie        ds.l    1    ;cookie looking for
  49. cookval        ds.l    1    ;value of cookie
  50.