I can define a new variable like so msg db 'Hello, world!$', or another way msg2 db 'Hello, world!', 0
I know that the end of a string is determined using value 0 in memory. What is symbol $ standing for then?
How does a program determine the end of a string?
280 views Asked by alexander.sivak At
1
There are 1 answers
Related Questions in STRING
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- JSON Body is Not Passing Certain Strings
- Regex to match repeated substring in Google Sheets
- Find the sum of the numbers in the sequence
- Hello, how can I use a block parameter of withstyle parameter when we create a annotated string in jetpackpack compose
- How to convert an HTML string to an escaped one?
- Quintic Number Number Counting Hash Function
- From Buffer("string", "hex) to string JS
- Calling ToString with a nominated format returns Char rather than String
- How to update an already existing array by accessing it by a variable with the exact same name assigned to it
- Why does \b not interpreted as backslash in this regular expression
- Python: why aren’t strings being internalized if they are received from ints by using str()?
- If the element(s) in the first list equal element(s) of the second list, replace with element(s) of the third list
- About Suffix Trees features
Related Questions in ASSEMBLY
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- How to call a C language function from x86 assembly code?
- Binary Bomb Phase 2 - Decoding Assembly
- AVR Assembly Clock Cycle
- Understanding the differences between mov and lea instructions in x86 assembly
- ARM Assembly code is not executing in Vitis IDE
- Which version of ARM does the M1 chip run on?
- Why would %rbp not be equal to the value of %rsp, which is 0x28?
- Move immediate 8-bit value into RSI, RDI, RSP or RBP
- Unable to run get .exe file from assembly NASM
- DOSbox automatically freezes and crashes without any prompt warnings
- Load function written in amd64 assembly into memory and call it
- link.exe unresolved external symbol _mainCRTStartup
- x86 Wrote a boot loader that prints a message to the screen but the characters are completely different to what I expected
- running an imf file using dosbox in parallel to a game
Related Questions in MASM
- VS2019 won't build .asm file even with masm.props build customization enabled?
- Convert binary to hexadecimal using MASM32
- How to install and setup Irvine library in vs code 2019 for assembly language
- Access violation writing location 0x00465004
- Why doesn't my MASM32 x86 Assembly selection sort code sort properly?
- where could there be a mistake in my assembly language code
- Dot-product groups of 4 bytes against 4 small constants, over an array of bytes (efficiently using SIMD)?
- Issue with Writing to File in x64 Assembly using MASM on Windows
- "Symbol not defined : @STACK " error in ASM code for 8086. Compiled using DOSBOX ,MASM
- Cant understand why this code output in a result:ERROR
- Converting from MASM to NASM
- How to display correct values for Min, Max, Sum, and Average of negative integers
- In MASM what is array[4]
- linking .s files in windows x86_64 C++
- Intercept 15H/4FH to use a hotkey
Related Questions in C-STRINGS
- I need to create a malloc array of strings and print those strings out
- Is there a worked example of using CStrBufT with a CString?
- Function is returning null instead of array in C
- Nested strtok() calls to tokenize given string does not work as expected
- Looping through an array which contains a string with spaces
- Word Count in C
- Last character index of inverted string in C being the whole uninverted original string
- sprintf blocks stm32 program
- Calling SHGetKnownFolderPath from Python?
- Invalid Initialization of Non-Const Reference Error in C++
- Is this a legal C strdup function?
- TextBox String to open file
- How to pass a string to a function and return the same string changed in C?
- How to shift chars in a character array without a temp?
- How do I convert a long string into a smaller abbreviation consisting of the first character, last character and number of chars in between?
Related Questions in NULL-TERMINATED
- How do I pass a string to a function requiring BYTE*?
- Does a const char* literal string persistently exist as long as the process alive?
- What is the difference between '\0' and "\0" in C++ string
- C++ std::istringstream how to not terminate at '\0'
- Newlines and null-terminated string in assembly
- The emulator process for AVD Pixel_3a_API_33 has terminated
- Why in C++ are some characters in a multibyte UTF-8 string represented by negative numbers?
- How to construct a `std::string` from a buffer that may or may not contain a null?
- sizeof('\0') null terminator as literal is four bytes but how come in string of characters it takes only one byte?
- How does a String terminate in C?
- parse a char vector to different strings
- include_str for null terminated string
- How does realloc treat null bytes in strings?
- In this solution, if *inputString is a memory address (and the input is a char type) then does *inputString qualify as an array?
- Append a null terminator to a C++ string
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
It depends on the program. A good program would do something like (NASM syntax):
..and would keep track of string length/s during any modifications (append, truncate, concatenate, etc) so that it always knows the length of strings with almost no overhead at all.
A "less good" program might put the string's length at the beginning of the string. This is something that was done by some old programming languages (e.g. Pascal). This causes problems when you want to work with overlapping strings (e.g. if
string2is the last half ofstring1then you can't save memory by making the strings overlap in memory because you'd have to insert a length at the start ofstring2that would corrupt the middle ofstring1).A "less good" program might also waste CPU time searching the string looking for some kind of terminator (where how bad it is depends on how long the string is - extremely bad for extremely long strings). For MS-DOS that terminator is a
'$'character (which makes it extra silly/annoying if you want to have a'$'character in the middle of the string), and for most other cases (e.g. C programming) it's a zero (null character).Of course for assembly language you can mostly do whatever you like (and can write a good program); until you have to use code that someone else wrote (e.g. MS-DOS API, or code written in some other language).