i need help translating a masm program to fasm.
how would you translate the following lines.
excerpt from 'calc387' by Craig Hessel http://www.geocities.com/craig_hessel/
(scroll to bottom of web page).


POSDIFF = OFFSET PosNum - OFFSET RndNum

where PosNum and RndNum are program labels and POSDIFF is an entry of a table.

-------------------------------------------------
mov bx,OFFSET UnryTbl; Table offset
add ax,OFFSET RndNum ; Point AX to *Num
mov al,PrecVals[bx] ; Get precedence 0 to 3
-------------------------------------------------

;-------------------------------------------------------------
; Constant data. Dual use overwrites some data when no longer
; needed. Code/data were tightened to keep COM small but with
; reasonable syntax. Function list omitted from syntax, but
; can view list at COM tail.
;-------------------------------------------------------------
UnryTbl DB POSDIFF, NEGDIFF, ABSDIFF
DB SQRDIFF, ATANDIFF,ACOSDIFF
Ten DB ASINDIFF,RNDDIFF, SIGNDIFF
DB INTDIFF, TANDIFF, COSDIFF
QMark DB SINDIFF, LGDIFF, LNDIFF
DB LOGDIFF, MEMDIFF, PIDIFF, EDIFF

BnryTbl DB EXPDIFF, MODDIFF, DIVDIFF
DB MULDIFF, SUBDIFF, ADDDIFF

PrecVals DB 0,3,2,2,2,1 ; Includes following 1

UnryList DB 1,"E", 2,"PI", 3,"MEM", 3,"LOG"
DB 2,"LN", 2,"LG", 3,"SIN", 3,"COS"
DB 3,"TAN", 3,"INT", 4,"SIGN",3,"RND"
DB 4,"ASIN",4,"ACOS",4,"ATAN",3,"SQR",3,"ABS"
DB 1,"-"-16,1 ; Includes following '+'

BnryList DB "+"-16,"-"-16,"*"-16,"/"-16,"%"-16,"^"

Syntax = $ ; Also FPU state
Mem = $ + 14 ; ST from prior run
TempBCD = $ + 24 ; Temp BCD storage
TempBuf = $ + 34 ; Temp use buffer

Posted on 2003-05-26 02:10:22 by jack