utf.asm 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ;Testname=test; Arguments=-fbin -outf.bin; Files=stdout stderr utf.bin
  2. ;Testname=error; Arguments=-fbin -outf.bin -DERROR; Files=stdout stderr utf.bin
  3. %define u(x) __utf16__(x)
  4. %define w(x) __utf32__(x)
  5. %define ul(x) __utf16le__(x)
  6. %define wl(x) __utf32le__(x)
  7. %define ub(x) __utf16be__(x)
  8. %define wb(x) __utf32be__(x)
  9. db `Test \u306a\U0001abcd\n`
  10. dw u(`Test \u306a\U0001abcd\n`)
  11. dd w(`Test \u306a\U0001abcd\n`)
  12. db `\u306a`
  13. db `\xe3\x81\xaa`
  14. dw __utf16__ "Hello, World!"
  15. nop
  16. mov ax,u(`a`)
  17. mov bx,u(`\u306a`)
  18. mov cx,u(`\xe3\x81\xaa`)
  19. mov eax,u(`ab`)
  20. mov ebx,u(`\U0001abcd`)
  21. mov ecx,w(`\U0001abcd`)
  22. db `Test \u306a\U0001abcd\n`
  23. dw ul(`Test \u306a\U0001abcd\n`)
  24. dd wl(`Test \u306a\U0001abcd\n`)
  25. db `\u306a`
  26. db `\xe3\x81\xaa`
  27. dw __utf16le__ "Hello, World!"
  28. nop
  29. mov ax,ul(`a`)
  30. mov bx,ul(`\u306a`)
  31. mov cx,ul(`\xe3\x81\xaa`)
  32. mov eax,ul(`ab`)
  33. mov ebx,ul(`\U0001abcd`)
  34. mov ecx,wl(`\U0001abcd`)
  35. db `Test \u306a\U0001abcd\n`
  36. dw ub(`Test \u306a\U0001abcd\n`)
  37. dd wb(`Test \u306a\U0001abcd\n`)
  38. db `\u306a`
  39. db `\xe3\x81\xaa`
  40. dw __utf16be__ "Hello, World!"
  41. nop
  42. mov ax,ub(`a`)
  43. mov bx,ub(`\u306a`)
  44. mov cx,ub(`\xe3\x81\xaa`)
  45. mov eax,ub(`ab`)
  46. mov ebx,ub(`\U0001abcd`)
  47. mov ecx,wb(`\U0001abcd`)
  48. %ifdef ERROR
  49. dw __utf16__ 33
  50. dw __utf16__, 46
  51. dw __utf16__("Hello, World!",16)
  52. dw __utf16__("Hello, World!",16
  53. dw u(`\xff`)
  54. dw __utf16le__ 33
  55. dw __utf16le__, 46
  56. dw __utf16le__("Hello, World!",16)
  57. dw __utf16le__("Hello, World!",16
  58. dw ul(`\xff`)
  59. dw __utf16be__ 33
  60. dw __utf16be__, 46
  61. dw __utf16be__("Hello, World!",16)
  62. dw __utf16be__("Hello, World!",16
  63. dw ub(`\xff`)
  64. %endif