RL>I'm fairly new to assembler (not quite a year), and up to now, i've only
RL>used it with the turbo languages (inline asm). Now I have written a
program
RL>entirely in assembler, but within Turbo Pascal. It goes like this:
RL>program Doofus;
RL>begin
RL>asm;
RL>...
RL>end;
RL>end.
RL>What do I have to change to turn my tp-inline program into a standalone
SM
RL>file that would compile with TASM or MASM ?
with TASM you could do something like this:
******
IDEAL ; use TASM's "ideal" mode - somewhat different syntax for operators and
; for directives
SMART ; let TASM handle PUSHing/POPping multiple constants on one line, and
; automatic macros to emulate higher-processor instructions
MODEL LARGE, PASCAL ; let it automatically take care of the segments and the
; stack frame
STACK 1024 ; allocate a stack with plenty of room for interrupts
; personally I'd recommend against making a stack too small, but that's up to
; you.
CODESEG
P286 ; tell it to compile in 286 mode
STARTUPCODE ; TASM built-in macro to prepare the data, stack, and code
; segments for the appropriate model
; then here goes the assembly code, minus the delimiters pascal need
EXITCODE ; TASM built-in macro to appropriately exit the program, with exit
; code in AX.
END
******
RL>BTW the program is a speedy version of the Munching Squares ( Y = X xor T
).
RL>Uses 2 bytes of stack space (push 0a000h, pop es) that could easily be
RL>removed. No variables, no memory allocation. It's as plain as you can
get.
* OLX 2.2 * There are no skeptics in hell.
--- PCBoard (R) v15.3/M 10
---------------
* Origin: Next time, Dial The Wrong Number! (209) 943-1880 (1:208/205)
|