-
Assembly newbie question
Code:
....
mov dx,OFFSET FNAME
mov ax,3D02H
int 21H
jc FOK_NZEND
mov bx,ax
push bx
mov cx,5
mov dx,OFFSET START_IMAGE
mov ah,3FH
int 21H
pop bx
mov ah,3EH
int 21H
mov ax,WORD PTR [FSIZE]
add ax,OFFSET ENDPROG - OFFSET PROG
jc FOK_NZEND
cmp BYTE PTR [START_IMAGE],0E9H
jnz FOK_ZEND
cmp WORD PTR [START_IMAGE+3],4956H
jnz FOK_ZEND
....
Hi im trying to learn assembly.
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?)
thanx.
-
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
--
Mats
-