モジュール
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef KZ3MOD_STRCMP_AS #define KZ3MOD_STRCMP_AS #module "kz3mod_strcmp_as" #deffunc strcmp val , val mref s1 , 24 mref s2 , 25 mref ret , 64 repeat await 0 peek c1 , s1 , cnt peek c2 , s2 , cnt if (c1 = $00) | (c2 = $00) | (c1 ! c2) : ret = c1 - c2 : break loop return #global #endif
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "kz3mod/strcmp.as" s1 = "A" : s2 = "Z" strcmp s1 , s2 mes stat s1 = "あ" : s2 = "あ" strcmp s1 , s2 mes stat s1 = "A" : s2 = "B" strcmp s1 , s2 mes stat s1 = "赤" : s2 = "青" strcmp s1 , s2 mes stat stop
1