home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / _msgcheck / !MsgCheck / MakeCode (.txt) < prev    next >
Encoding:
RISC OS BBC BASIC V Source  |  1993-07-19  |  879 b   |  37 lines

  1.  >MakeCode
  2.  code% 512, buff1% 20, buff2% 20
  3. cr=&0D
  4.  r1=ptr to one string   = B%
  5.  r2=ptr to other string = C%
  6.  Will return 1 IF SAME
  7.              0 if different
  8. pass%=0 
  9. P%=code%
  10. [OPT pass%
  11.    STMFD r13!,{r1-r4,r14}
  12.    MOV   r0,#1
  13.     .loop
  14.    LDRB  r3,[r1],#1
  15.    LDRB  r4,[r2],#1
  16.    CMP   r3,#cr
  17.    BEQ   checkcr
  18.    CMP   r4,#cr
  19. M   BEQ   set          ; to have got this far, r3<>cr. Therefore different
  20.    CMP   r3,r4
  21.    BNE   set
  22.    B     loop
  23. .checkcr
  24.    CMP   r4,#cr
  25.    BNE   set
  26.    B     exit
  27.    MOV   r0,#0
  28.     .exit
  29.    LDMFD r13!,{r1-r4,r15}
  30. "3$buff1%="JESUS COLLEGE":$buff2%="JESUS COLLAGE"
  31. B%=buff1%:C%=buff2%
  32. "0 if different"'"1 if same"
  33. $buff1%'$buff2%
  34. code%
  35.  OSCLI"SAVE Code "+STR$~code%+" "+STR$~P%
  36.  OSCLI"SetType Code Data"
  37.