Assembly newbie question
Hi im trying to learn assembly.
mov dx,OFFSET FNAME
mov dx,OFFSET START_IMAGE
mov ax,WORD PTR [FSIZE]
add ax,OFFSET ENDPROG - OFFSET PROG
cmp BYTE PTR [START_IMAGE],0E9H
cmp WORD PTR [START_IMAGE+3],4956H
Above lines are intended to assembled with TASM. but im using NASM and when i assemble them with nasm, i get errors for lines with OFFSET, WORD PTR and BYTE PTR. How can fix the code to assemble it with nasm. (when i just delete above statements (eg. mov dx, FNAME) thoes errors dont show up, but is it right to do that?)
OFFSET means "the address of within the current segment". I think you can just remove that all together - it will be obvious if it works or not.
WORD PTR, etc, you need to put the size without ptr inside the , e.g. [word: blah] will access blah as a word.
See the NASM manual: http://nasm.sourceforge.net/doc/nasmdoc0.html