| Index | Manual | Download | Source | Macros | Embedded word Case ins.
Sitemap | Links | Forum | Tests | Projects

# Test t1715: Literals BYTE and UNICHAR with string and character constants

Description
  Automatic NUL termination of BYTE and UNICHAR string literals which begins and ends with a quote.
Tested procedures
  SymCreateLiteral ExpParseData ExpEvalData

Source & expected listing t1715.htm.lst
  `| | EUROASM LIST=ON,DUMPWIDTH=27,AUTOSEGMENT=ON | |t1715 PROGRAM FORMAT=BIN,MODEL=TINY,WIDTH=16, \ | | LISTMAP=OFF,LISTGLOBALS=OFF,LISTLITERALS=ON, |[CODE] ::::Section changed. |0000:B83100 | MOV AX,"1" ; Immediate char.constant 0x0031. |0003:B83132 | MOV AX,"12" ; Immediate char.constant 0x3231. |0006:B8[0000] | MOV AX,=B"1" ; Address of ASCIIZ byte string "1",0. |0009:B8[0200] | MOV AX,=B"12" ; Address of ASCIIZ byte string "12",0. |000C:B8[0500] | MOV AX,=B"123" ; Address of ASCIIZ byte string "123",0. |000F:B8[0000] | MOV AX,=B"1"+0 ; Address of char.constant 0x31. |0012:B8[0900] | MOV AX,=B"1"+'2' ; Address of ASCIIZ byte string "c",0. |0015:B8[0000] | MOV AX,=U"1" ; Address of ASCIIZ unichar string "1",0. |0018:B8[0400] | MOV AX,=U"12" ; Address of ASCIIZ unichar string "12",0. |001B:B8[0A00] | MOV AX,=U"123" ; Address of ASCIIZ unichar string "123",0. |001E:B8[0000] | MOV AX,=U"1"+0 ; Address of char.constant 0x0031. |0021:B8[1200] | MOV AX,=U"1"+'2' ; Address of ASCIIZ unichar string "c",0. |0024:B8[0000] | MOV AX,=W"1" ; Address of char.constant 0x0031. |0027:B8[1600] | MOV AX,=W"12" ; Address of char.constant 0x3231. |002A:B8[0000] | MOV AX,=W"1"+0 ; Address of char.constant 0x0031. |002D:B8[0000] | MOV AX,=D"1" ; Address of char.constant 0x0000_0031. |0030:B8[0400] | MOV AX,=D"12" ; Address of char.constant 0x0000_3231. |0033:B8[0800] | MOV AX,=D"123" ; Address of char.constant 0x0033_3231. |0036:B8[0000] | MOV AX,=D"1"+0 ; Address of char.constant 0x0000_0031. |0039:B8[0C00] | MOV AX,=D"1"+'2' ; Address of char.constant 0x0000_0063. | | EUROASM UNICODE=NO ; Treat ="string" as =B"string". |003C:B8[0500] | MOV AX,="123" ; Address of ASCIIZ byte string "123",0. | | EUROASM UNICODE=YES ; Treat ="string" as =U"string". |003F:B8[0A00] | MOV AX,="123" ; Address of ASCIIZ unichar string "123",0. |0042:8D06[0C00] | LEA AX,[="123"+2] ; Address of ASCIIZ unichar string "23",0. |[@LT4] ====ListLiterals in section [@LT4]. |0000:31000000 =D"1" |0000:31000000 =D"1"+0 |0004:31320000 =D"12" |0008:31323300 =D"123" |000C:63000000 =D"1"+'2' |[@LT2] ====ListLiterals in section [@LT2]. |0000:31000000 =U"1" |0000:3100 =W"1" |0000:3100 =U"1"+0 |0000:3100 =W"1"+0 |0004:310032000000 =U"12" |000A:3100320033000000 =U"123" |0012:63000000 =U"1"+'2' |0016:3132 =W"12" |[@LT1] ====ListLiterals in section [@LT1]. |0000:3100 =B"1" |0000:31 =B"1"+0 |0002:313200 =B"12" |0005:31323300 =B"123" |0009:6300 =B"1"+'2' | |ENDPROGRAM t1715`

Expected messages t1715.out
  `I0180 Assembling source file "t1715.htm". I0270 Assembling source "t1715". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t1715". "t1715.htm"{58} I0510 Assembling program pass 1. "t1715.htm"{58} I0510 Assembling program pass 2. "t1715.htm"{58} I0530 Assembling program pass 3 - final. "t1715.htm"{58} I0660 16bit TINY BIN file "t1715.bin" created, size=131. "t1715.htm"{107} I0650 Program "t1715" assembled in 3 passes with errorlevel 0. "t1715.htm"{107} I0750 Source "t1715" (139 lines) assembled in 2 passes with errorlevel 0. I0860 Listing file "t1715.htm.lst" created, size=3337. I0990 EuroAssembler terminated with errorlevel 0.`

Expected output file t1715. bin

      0000: B8 31 00 B8 31 32 B8 78 00 B8 7A 00 B8 7D 00 B8  ¤1°¤12¤x°¤z°¤}°¤
      0010: 78 00 B8 81 00 B8 60 00 B8 64 00 B8 6A 00 B8 60  x°¤¤°¤`°¤d°¤j°¤`
      0020: 00 B8 72 00 B8 60 00 B8 76 00 B8 60 00 B8 50 00  °¤r°¤`°¤v°¤`°¤P°
      0030: B8 54 00 B8 58 00 B8 50 00 B8 5C 00 B8 7D 00 B8  ¤T°¤X°¤P°¤\°¤}°¤
      0040: 6A 00 8D 06 6C 00 00 00 00 00 00 00 00 00 00 00  j°¤·l°°°°°°°°°°°
      0050: 31 00 00 00 31 32 00 00 31 32 33 00 63 00 00 00  1°°°12°°123°c°°°
      0060: 31 00 00 00 31 00 32 00 00 00 31 00 32 00 33 00  1°°°1°2°°°1°2°3°
      0070: 00 00 63 00 00 00 31 32 31 00 31 32 00 31 32 33  °°c°°°121°12°123
      0080: 00 63 00                                         °c°

▲Back to the top▲