Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: new_apostrophe.asm1 0000 OUTPUT "new_apostrophe.bin"2 00003 0000 ; test new \0 escape for double quotes4 0000 00 db "\0"5 00016 0001 ; test new stricter rules for not-escaping apostrophe strings7 0001 5C 45 5C 5C db '\E', '\\' ; test (4 bytes)8 0005 5C 45 5C 5C db "\\E", "\\\\" ; expected (emulating expected result in quotes)new_apostrophe.asm(9): warning: Empty string: ''9 0009 27 27 5C 00 db '''''', '\', 0, '' ; test (4 bytes) + warning10 000D 27 27 5C 00 db "''", "\\", 0 ; expected (emulating expected result in quotes)11 001112 0011 ; more tricky ones (putting stress also on line parsers and buffer readers)13 0011 2F 2A 2A 2F db '/**/''/**/''\n\\''\"'''13 0015 27 2F 2A 2A13 0019 2F 27 5C 6E13 001D 5C 5C 27 5C13 0021 22 2714 0023 2F 2A 2A 2F db "/**/'/**/'\\n\\\\'\\\"'" ; expected14 0027 27 2F 2A 2A14 002B 2F 27 5C 6E14 002F 5C 5C 27 5C14 0033 22 2715 003516 0035 22 db "\""16 0036 00 db 017 0037 5C db '\'17 0038 01 db 118 0039 5C 5C db '\\'18 003B 02 db 2new_apostrophe.asm(19): warning: Empty string: ''new_apostrophe.asm(19): error: no arguments19 003C db ''19 003C 03 db 3 ; warning empty string + error no arguments20 003D 27 db ''''20 003E 04 db 421 003Fnew_apostrophe.asm(22): warning: value 0x41424344 is truncated to 16bit value: 0x4344new_apostrophe.asm(22): warning: String literal truncated to 0x47485858: 'ABCDEFGHXX'new_apostrophe.asm(22): warning: value 0x47485858 is truncated to 16bit value: 0x585822 003F 44 43 58 58 dw 'ABCD', 'ABCDEFGHXX'; regular value check warnings + string literal overflownew_apostrophe.asm(23): warning: value 0x41424344 is truncated to 16bit value: 0x4344new_apostrophe.asm(23): warning: String literal truncated to 0x47485858: "ABCDEFGHXX"new_apostrophe.asm(23): warning: value 0x47485858 is truncated to 16bit value: 0x585823 0043 44 43 58 58 dw "ABCD", "ABCDEFGHXX"; regular value check warnings + string literal overflow24 004725 0047 ;; exercise remaining escape sequences inside apostrophes (shouldn't be escaped)26 0047 5C 41 5C 42 db '\A', '\B', '\D', '\E' ; verify nothing leaks into comments26 004B 5C 44 5C 4527 004F 5C 46 5C 4E db '\F', '\N', '\R', '\T' ; verify nothing leaks into comments27 0053 5C 52 5C 5428 0057 5C 5C 5C 22 db '\\', '\"', '\?', '"\' ; verify nothing leaks into comments28 005B 5C 3F 22 5C29 005F 5C 30 5C 27 db '\0', '\''' ; verify nothing leaks into comments30 0063 0A db "\n"31 006432 0064 ;; Example about string literals from documentation33 0064 73 74 72 69 BYTE "stringconstant\n" ; escape sequence assembles to newline33 0068 6E 67 63 6F33 006C 6E 73 74 6133 0070 6E 74 0A34 0073 73 74 72 69 BYTE 'stringconstant\n' ; \n assembles literally as two bytes: '\', 'n'34 0077 6E 67 63 6F34 007B 6E 73 74 6134 007F 6E 74 5C 6E35 0083 21 6C 68 LD HL,'hl' ; hl = 0x686C = 'l', 'h'36 0086 21 6C 68 LD HL,"hl" ; hl = 0x686C = 'l', 'h'37 0089 3E 37 LD A,"7" ; not recommended (but works)38 008B 3E 38 LD A,'8' ; recommendednew_apostrophe.asm(39): warning: value 0x5C45 is truncated to 8bit value: 0x4539 008D 3E 45 LD A,'\E' ; warning + truncating value to 'E' (0x45)40 008F 3E 22 LD A,'"' ; A = 0x2241 0091 3E 27 LD A,"'" ; A = 0x2742 0093 3E 27 LD A,'''' ; A = 0x27 ; since v1.1143 0095# file closed: new_apostrophe.asmValue Label------ - -----------------------------------------------------------