I am good with M68000 but X86 is diffficult for me. I am trying to assemble this simple program with MASM
.MODEL SMALL
.data?
ONE dB ?
TWO dB ?
stack db 100 dup(?)
.data
MSG db 13,10, 'Enter deree of polynomials: $'
MSG2 db 13,10, 'Enter coefficient of x^ $'
MSG3 db 13,10, 'The polynomial created is: $'
MSG4 db 13,10, 'The first derivative is: $'
STR1 db 255 DUP('$')
.code
_start:
mov ax, offset MSG
mov ds, ax
end _start
and I keep getting the error Unknown relocation type (1) for symbol MSG. I know what this is (it happens when the displacement is bigger than that allowed by the model or something like this) but I do not know how to solve this error (I know MASM is a 32 bit assembler and I am trying to write a 16 bit code). What I am trying to do is to load the pointer to .data into ds register.
My makeit.bat
generated by the MASM32 IDE is:
@echo off
if exist "derivative 1.obj" del "derivative 1.obj"
if exist "derivative 1.exe" del "derivative 1.exe"
\masm32\bin\ml /c /coff "derivative 1.asm"
if errorlevel 1 goto errasm
\masm32\bin\PoLink /SUBSYSTEM:CONSOLE "derivative 1.obj"
if errorlevel 1 goto errlink dir "derivative 1.*" goto TheEnd
:errlink
echo _
echo Link error
goto TheEnd
:errasm
echo _
echo Assembly Error
goto TheEnd
:TheEnd
pause