In my assembly language class, our first assignment was to write a program to print out a simple dollar-terminated string in DOS. It looked something like this:
BITS 32
global _main
section .data
msg db "Hello, world!", 13, 10, ’$’
section .text
_main:
mov ah, 9
mov edx, msg
int 21h
ret
As I understand it, the $ sign serves to terminate the sting like null does in C. But what do I do if I want to put a dollar sign in the string (like I want to print out "it costs $30")? This seems like a simple question, but my professor didn't know the answer and I don't seem to find it using a google search.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…