BBS: Inland Empire Archive Date: 02-14-93 (17:43) Number: 163 From: DAVIDSON CORRY Refer#: NONE To: MIKE KOST Recvd: NO Subj: 2 Questions Conf: (1) 80xxx
MK: What is the $ for? i've seen it used, and since i've learned by example :, without a good beginning tutor book, i never found out. In many assemblers (particularly 80x86 assemblers, especially those whose syntax derives from the Intel/MASM antecedents) the built-in symbol $ represents the current location counter. That is, in JMP $+3 the $ represents the offset of the JMP opcode. In MASM-compatible assemblers, a symbol has not only offset information associated with it, but also type information. $ is equivalent to THIS LABEL. THIS is a keyword meaning "at the current offset within the current segment", and it takes a type argument: BYTE, WORD, DWORD... for data types, or LABEL for code targets. For simplicity's sake, many of us read $ as the word "here". Thus we'd pronounce JMP $+3 as "jump here plus three" -- JMP to the location three bytes beyond the offset of the JMP opcode. --- Maximus 2.01wb * Origin: Cornerstone C,C++,Assy,Windows (206)362-4283 (1:343/22)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET