( CMPC                                     compare two strings )

: cmpc                            ( addr1 n1 addr2  --- n2 )
  0 rot 0                         ( check n1 bytes)
  do
    drop                          ( discard last result)
    over i + c@                   ( fetch next byte of addr1)
    over i + c@                   ( and next byte of addr2)
    - dup 0= 0=                   ( are these bytes equal?)
    if leave endif                ( no, exit)
  loop                            ( yes, compare next two bytes)
  swap drop swap drop             ( discard addresses)
;
