print print "short[2] = %04x" % nk.ba_get_short(ba, 2), print "short[4] = %04x" % nk.ba_get_short(ba, 4), print "long[2] = %08x" % nk.ba_get_long(ba, 2), print "long[5] = %s\n" % nk.ba_get_long(ba, 5) a = 5 b = 6 print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)) a = 0xffff0000 b = 0xfffeffff # b < a print "a=%x, b=%x, a+b= %x" % (a, b, nk.seq_add(a, b)) print "a=%x, b=%x, a-b= %x\n" % (a, b, nk.seq_sub(a, b)) print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)) b = 0xffff0001 # b > a print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)) b = a print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b))
ba = bytearray.fromhex(u"1002 2004 3005 4006") for b in ba: print "%02x " % b, print print "short[2] = %04x" % nk.ba_get_short(ba,2), print "short[4] = %04x" % nk.ba_get_short(ba,4), print "long[2] = %08x" % nk.ba_get_long(ba,2), print "long[5] = %s\n" % nk.ba_get_long(ba,5) a=5; b=6 print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b)) a = 0xffff0000; b = 0xfffeffff # b < a print "a=%x, b=%x, a+b= %x" % (a, b, nk.seq_add(a,b)) print "a=%x, b=%x, a-b= %x\n" % (a, b, nk.seq_sub(a,b)) print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b)) b = 0xffff0001 # b > a print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)) print "a=%x, b=%x, a<b = %s\n" % (a,b, nk.seq_lt(a,b)) b = a print "a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)) print "a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)) print "a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b))
test_print('', get_tag()) test_print("short[2] = %04x " % nk.ba_get_short(ba, 2)) test_print("short[4] = %04x " % nk.ba_get_short(ba, 4)) test_print("long[2] = %08x " % nk.ba_get_long(ba, 2)) test_println("long[5] = %s\n" % nk.ba_get_long(ba, 5)) a = 5 b = 6 test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)), get_tag()) a = 0xffff0000 b = 0xfffeffff # b < a test_println("a=%x, b=%x, a+b= %x" % (a, b, nk.seq_add(a, b)), get_tag()) test_println("a=%x, b=%x, a-b= %x\n" % (a, b, nk.seq_sub(a, b)), get_tag()) test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)), get_tag()) b = 0xffff0001 # b > a test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)), get_tag()) b = a test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a, b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a, b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a, b)), get_tag())
for b in ba: test_print("%02x " % b) test_println('') test_print('', get_tag()) test_print("short[2] = %04x " % nk.ba_get_short(ba,2)) test_print("short[4] = %04x " % nk.ba_get_short(ba,4)) test_print("long[2] = %08x " % nk.ba_get_long(ba,2)) test_println("long[5] = %s\n" % nk.ba_get_long(ba,5)) a=5; b=6 test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b)), get_tag()) a = 0xffff0000; b = 0xfffeffff # b < a test_println("a=%x, b=%x, a+b= %x" % (a, b, nk.seq_add(a,b)), get_tag()) test_println("a=%x, b=%x, a-b= %x\n" % (a, b, nk.seq_sub(a,b)), get_tag()) test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b)), get_tag()) b = 0xffff0001 # b > a test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a,b, nk.seq_lt(a,b)), get_tag()) b = a test_println("a=%x, b=%x, a>b = %s" % (a, b, nk.seq_gt(a,b)), get_tag()) test_println("a=%x, b=%x, a>=b = %s" % (a, b, nk.seq_ge(a,b)), get_tag()) test_println("a=%x, b=%x, a<b = %s\n" % (a, b, nk.seq_lt(a,b)), get_tag())