1998-05-10 21:14:44 +02:00
|
|
|
; X-Assembler
|
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
EXE = 1
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
IDEAL
|
|
|
|
P386
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
MODEL SMALL
|
|
|
|
ELSE
|
1998-05-10 21:14:44 +02:00
|
|
|
MODEL TINY
|
2002-04-06 20:51:52 +02:00
|
|
|
ENDIF
|
1998-05-10 21:14:44 +02:00
|
|
|
CODESEG
|
|
|
|
|
2000-08-05 23:12:46 +02:00
|
|
|
; comment out to disable
|
2002-04-07 16:02:26 +02:00
|
|
|
; SET_WIN_TITLE = 1
|
2000-05-24 10:07:34 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
; compak = 1d00h
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
l_icl = 1024
|
|
|
|
l_org = 4096
|
2002-04-20 18:41:42 +02:00
|
|
|
l_def = 1024
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
2002-04-20 18:41:42 +02:00
|
|
|
l_lab = 53000
|
2002-04-06 20:51:52 +02:00
|
|
|
ELSE
|
1999-03-04 14:04:42 +01:00
|
|
|
l_lab = 48000
|
2002-04-06 20:51:52 +02:00
|
|
|
ENDIF
|
1998-05-22 18:27:22 +02:00
|
|
|
|
|
|
|
STRUC com
|
1999-03-04 14:04:42 +01:00
|
|
|
c_code db ?
|
1999-08-20 19:15:06 +02:00
|
|
|
c_flag db ?
|
1999-03-04 14:04:42 +01:00
|
|
|
c_name db ?,?,?
|
|
|
|
c_vec dw ?
|
1998-05-22 18:27:22 +02:00
|
|
|
ENDS
|
|
|
|
|
|
|
|
STRUC icl
|
|
|
|
prev dw ?
|
|
|
|
handle dw ?
|
|
|
|
line dd ?
|
1999-03-04 14:04:42 +01:00
|
|
|
flags db ?
|
|
|
|
m_eofl = 1
|
1998-05-22 18:27:22 +02:00
|
|
|
nam db ?
|
|
|
|
ENDS
|
|
|
|
|
|
|
|
STRUC lab
|
1999-03-04 14:04:42 +01:00
|
|
|
l_val dw ?
|
1998-09-14 11:48:16 +02:00
|
|
|
flags db ?
|
|
|
|
b_sign = 7
|
|
|
|
m_sign = 80h
|
|
|
|
m_lnus = 40h
|
|
|
|
m_ukp1 = 20h
|
1998-09-16 20:44:16 +02:00
|
|
|
len db ?
|
1998-05-22 18:27:22 +02:00
|
|
|
nam db ?
|
|
|
|
ENDS
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
STRUC movt
|
2001-04-12 22:58:12 +02:00
|
|
|
m_lcod db ?
|
|
|
|
m_lvec dw ?
|
|
|
|
m_scod db ?
|
|
|
|
m_svec dw ?
|
|
|
|
m_inc db ?
|
|
|
|
m_dec db ?
|
1998-09-06 18:05:14 +02:00
|
|
|
ENDS
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
;[flags]
|
|
|
|
m_pass = 1
|
2000-05-24 10:07:34 +02:00
|
|
|
m_norg = 2
|
|
|
|
m_rorg = 4
|
|
|
|
m_rqff = 8
|
|
|
|
b_hdr = 4
|
|
|
|
m_hdr = 10h
|
|
|
|
m_pair = 20h
|
|
|
|
m_repa = 40h
|
|
|
|
b_skit = 7
|
|
|
|
m_skit = 80h
|
|
|
|
b_enve = 8
|
|
|
|
m_enve = 100h
|
|
|
|
m_wobj = 200h
|
2000-08-05 23:12:46 +02:00
|
|
|
m_times = 400h
|
|
|
|
m_first = 800h
|
|
|
|
b_skif = 12
|
|
|
|
m_skif = 1000h
|
|
|
|
b_repl = 13
|
|
|
|
m_repl = 2000h
|
2001-04-07 11:03:20 +02:00
|
|
|
b_ski2 = 14
|
|
|
|
m_ski2 = 4000h
|
2002-04-20 18:41:42 +02:00
|
|
|
b_def = 15
|
|
|
|
m_def = 8000h
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
;[swits]
|
|
|
|
m_swc = 1
|
2002-04-20 18:41:42 +02:00
|
|
|
m_swd = 2
|
|
|
|
m_swe = 4
|
|
|
|
m_swi = 8
|
|
|
|
m_swl = 10h
|
|
|
|
b_swn = 5
|
|
|
|
m_swn = 20h
|
|
|
|
m_swo = 40h
|
|
|
|
m_swp = 80h
|
|
|
|
m_swq = 100h
|
|
|
|
m_sws = 200h
|
|
|
|
m_swt = 400h
|
|
|
|
m_swu = 800h
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
;[flist]
|
2002-04-20 18:41:42 +02:00
|
|
|
m_lsti = 8
|
|
|
|
m_lstl = 10h
|
|
|
|
m_lsto = 20h
|
1998-09-23 16:48:58 +02:00
|
|
|
m_lsts = m_lsto+m_lstl+m_lsti
|
|
|
|
|
|
|
|
nhand = -1 ;null handle
|
2002-04-07 16:02:26 +02:00
|
|
|
STDERR = 2
|
2000-05-24 10:07:34 +02:00
|
|
|
cr equ 13
|
1998-05-10 21:14:44 +02:00
|
|
|
eol equ 13,10
|
|
|
|
eot equ 13,10,'$'
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
MACRO lda _rg ;shorter than 'mov (e)ax, _rg'
|
|
|
|
_rge SUBSTR <_rg>, 1, 1
|
|
|
|
IFIDNI _rge, <e>
|
|
|
|
xchg eax, _rg
|
|
|
|
ELSE
|
|
|
|
xchg ax, _rg
|
|
|
|
ENDIF
|
1998-09-06 18:05:14 +02:00
|
|
|
ENDM
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
MACRO sta _rg ;shorter than 'mov _rg, (e)ax'
|
|
|
|
_rge SUBSTR <_rg>, 1, 1
|
|
|
|
IFIDNI _rge, <e>
|
|
|
|
xchg _rg, eax
|
|
|
|
ELSE
|
|
|
|
xchg _rg, ax
|
|
|
|
ENDIF
|
1998-05-10 21:14:44 +02:00
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO dos _func
|
1998-09-06 18:05:14 +02:00
|
|
|
IFNB <_func>
|
|
|
|
IF _func and 0ff00h
|
1998-05-10 21:14:44 +02:00
|
|
|
mov ax, _func
|
1998-09-06 18:05:14 +02:00
|
|
|
ELSE
|
1998-05-10 21:14:44 +02:00
|
|
|
mov ah, _func
|
1998-09-06 18:05:14 +02:00
|
|
|
ENDIF
|
|
|
|
ENDIF
|
1998-05-10 21:14:44 +02:00
|
|
|
int 21h
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO file _func, _errtx
|
1998-09-23 16:48:58 +02:00
|
|
|
IFNB <_errtx>
|
1999-03-04 14:04:42 +01:00
|
|
|
mov [errmsg], offset _errtx
|
1998-09-23 16:48:58 +02:00
|
|
|
ENDIF
|
1998-09-06 18:05:14 +02:00
|
|
|
IF _func and 0ff00h
|
1998-05-10 21:14:44 +02:00
|
|
|
mov ax, _func
|
1998-09-06 18:05:14 +02:00
|
|
|
ELSE
|
1998-05-10 21:14:44 +02:00
|
|
|
mov ah, _func
|
1998-09-06 18:05:14 +02:00
|
|
|
ENDIF
|
1998-05-10 21:14:44 +02:00
|
|
|
call xdisk
|
|
|
|
ENDM
|
|
|
|
|
1999-08-29 13:43:20 +02:00
|
|
|
MACRO jfile _func, _errtx
|
|
|
|
IFNB <_errtx>
|
|
|
|
mov [errmsg], offset _errtx
|
|
|
|
ENDIF
|
|
|
|
IF _func and 0ff00h
|
|
|
|
mov ax, _func
|
|
|
|
ELSE
|
|
|
|
mov ah, _func
|
|
|
|
ENDIF
|
|
|
|
jmp xdisk
|
|
|
|
ENDM
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
MACRO print _text
|
1998-09-06 18:05:14 +02:00
|
|
|
IFNB <_text>
|
1998-05-10 21:14:44 +02:00
|
|
|
mov dx, offset _text
|
1998-09-06 18:05:14 +02:00
|
|
|
ENDIF
|
1998-05-10 21:14:44 +02:00
|
|
|
dos 9
|
|
|
|
ENDM
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
MACRO error _err
|
|
|
|
push offset _err
|
|
|
|
jmp errln
|
|
|
|
ENDM
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
MACRO testfl _mask
|
|
|
|
testflag [flags], _mask
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO resfl _mask
|
|
|
|
maskflag [flags], not (_mask)
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO setfl _mask
|
|
|
|
setflag [flags], _mask
|
|
|
|
ENDM
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
MACRO testsw _mask
|
|
|
|
testflag [swits], _mask
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO setsw _mask
|
|
|
|
setflag [swits], _mask
|
1999-08-20 19:15:06 +02:00
|
|
|
ENDM
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
MACRO jpass1 _dest
|
2000-05-24 10:07:34 +02:00
|
|
|
testflag [flags], m_pass
|
1998-09-06 18:05:14 +02:00
|
|
|
jz _dest
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO jpass2 _dest
|
2000-05-24 10:07:34 +02:00
|
|
|
testflag [flags], m_pass
|
1998-09-06 18:05:14 +02:00
|
|
|
jnz _dest
|
|
|
|
ENDM
|
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
MACRO jopcod _dest
|
1999-03-04 14:04:42 +01:00
|
|
|
cmp bp, offset var
|
|
|
|
jne _dest
|
|
|
|
ENDM
|
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
MACRO jnopcod _dest
|
1999-03-04 14:04:42 +01:00
|
|
|
cmp bp, offset var
|
|
|
|
je _dest
|
|
|
|
ENDM
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
MACRO cmd _oper
|
1999-08-20 19:15:06 +02:00
|
|
|
_tp SUBSTR <_oper>, 4, 4
|
1998-05-10 21:14:44 +02:00
|
|
|
_tp CATSTR <0>, &_tp, <h>
|
1999-08-20 19:15:06 +02:00
|
|
|
dw _tp
|
1998-08-31 13:00:16 +02:00
|
|
|
IRP _ct,<3,2,1>
|
|
|
|
_tp SUBSTR <_oper>, _ct, 1
|
|
|
|
% db '&_tp'
|
|
|
|
ENDM
|
1999-08-20 19:15:06 +02:00
|
|
|
_tp SUBSTR <_oper>, 8
|
1998-05-10 21:14:44 +02:00
|
|
|
dw _tp
|
|
|
|
ENDM
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
MACRO opr _oper
|
|
|
|
_tp SUBSTR <_oper>, 1, 1
|
|
|
|
db _tp
|
|
|
|
_tp SUBSTR <_oper>, 2
|
|
|
|
_tp CATSTR <v_>, _tp
|
|
|
|
dw _tp
|
|
|
|
ENDM
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
MACRO undata
|
|
|
|
db 6 dup(?)
|
|
|
|
lstnum db 5 dup(?)
|
|
|
|
lstspa db ?
|
|
|
|
lstorg db 26 dup(?)
|
|
|
|
line db 258 dup(?)
|
|
|
|
tlabel db 256 dup(?)
|
1999-08-20 19:15:06 +02:00
|
|
|
obuf db 128 dup(?)
|
2002-04-06 20:51:52 +02:00
|
|
|
obufen = $
|
1998-09-23 16:48:58 +02:00
|
|
|
objnam db 128 dup(?)
|
|
|
|
lstnam db 128 dup(?)
|
|
|
|
tabnam db 128 dup(?)
|
|
|
|
t_icl db l_icl dup(?)
|
|
|
|
t_org db l_org dup(?)
|
2002-04-20 18:41:42 +02:00
|
|
|
t_def db l_def dup(?)
|
1998-09-23 16:48:58 +02:00
|
|
|
ENDM
|
|
|
|
|
1998-08-31 13:00:16 +02:00
|
|
|
;*****************************
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
IFNDEF EXE
|
1998-09-23 16:48:58 +02:00
|
|
|
zero db 100h dup(?)
|
2002-04-06 20:51:52 +02:00
|
|
|
ENDIF
|
1998-09-23 16:48:58 +02:00
|
|
|
start:
|
|
|
|
IFDEF compak
|
|
|
|
undata
|
|
|
|
db compak+start-$ dup(?)
|
|
|
|
ENDIF
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
mov dx, @data
|
|
|
|
mov es, dx
|
|
|
|
mov ss, dx
|
|
|
|
mov sp, offset staken
|
|
|
|
mov di, offset tlabel
|
|
|
|
mov ax, [16h]
|
|
|
|
stosw
|
|
|
|
mov si, 81h
|
|
|
|
movzx cx, [byte si-1]
|
|
|
|
inc cx
|
|
|
|
rep movsb
|
|
|
|
mov ds, dx
|
|
|
|
ENDIF
|
2000-05-24 10:07:34 +02:00
|
|
|
ifdef SET_WIN_TITLE
|
|
|
|
mov di, offset hello
|
|
|
|
mov ax, 168eh
|
|
|
|
xor dx, dx
|
|
|
|
int 2fh
|
|
|
|
mov [titfin], ' '
|
|
|
|
endif
|
2002-04-07 16:02:26 +02:00
|
|
|
; print hello
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
mov si, offset tlabel+3
|
|
|
|
ELSE
|
|
|
|
mov si, 82h
|
|
|
|
ENDIF
|
|
|
|
mov [objnam], 0
|
|
|
|
mov [lstnam], 0
|
|
|
|
mov [tabnam], 0
|
|
|
|
mov [(icl t_icl).nam], 0 ; pusta nazwa zrodla
|
|
|
|
|
|
|
|
; parsuj argumenty
|
|
|
|
parg0: dec si
|
|
|
|
parg1: lodsb
|
|
|
|
cmp al, ' '
|
|
|
|
je parg1
|
|
|
|
cmp al, 9
|
|
|
|
je parg1
|
|
|
|
cmp al, 0dh
|
|
|
|
je pargx
|
|
|
|
cmp al, '/'
|
|
|
|
je popt1
|
|
|
|
mov di, offset (icl t_icl).nam
|
|
|
|
cmp [byte di], 0
|
|
|
|
jnz usg ; juz byla nazwa zrodla
|
|
|
|
mov dx, di
|
|
|
|
call clfname
|
|
|
|
call adasx
|
|
|
|
mov [fslen], di
|
|
|
|
jmp parg0
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-07 16:02:26 +02:00
|
|
|
usg: print hello ; usage - instrukcja
|
1999-03-04 14:04:42 +01:00
|
|
|
dos 4c03h
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
popt1: lodsb
|
|
|
|
and al, 0dfh ; mala litera -> duza
|
1998-09-23 16:48:58 +02:00
|
|
|
mov di, offset swilet
|
2002-04-20 18:41:42 +02:00
|
|
|
mov cx, 12
|
1998-09-23 16:48:58 +02:00
|
|
|
repne scasb
|
2002-04-06 20:51:52 +02:00
|
|
|
jne usg ; nie ma takiego switcha
|
2000-05-24 10:07:34 +02:00
|
|
|
bts [swits], cx ; sprawdz bit i ustaw
|
2002-04-20 18:41:42 +02:00
|
|
|
jnc popt2
|
|
|
|
cmp al, 'D' ; tylko /d dozwolone kilka razy
|
|
|
|
jne usg
|
|
|
|
popt2: mov di, offset lstnam
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp al, 'L'
|
2002-04-20 18:41:42 +02:00
|
|
|
je popt4
|
1998-09-23 16:48:58 +02:00
|
|
|
mov di, offset tabnam
|
|
|
|
cmp al, 'T'
|
2002-04-20 18:41:42 +02:00
|
|
|
je popt4
|
|
|
|
mov di, offset objnam
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp al, 'O'
|
2002-04-20 18:41:42 +02:00
|
|
|
je popt3
|
|
|
|
cmp al, 'D'
|
|
|
|
jne parg1
|
|
|
|
mov di, [defen]
|
|
|
|
popt3: cmp [byte si], ':' ; /O i /D wymagaja ':'
|
2002-04-06 20:51:52 +02:00
|
|
|
jne usg
|
2002-04-20 18:41:42 +02:00
|
|
|
popt4: mov ah, al
|
|
|
|
lodsb
|
1999-03-04 14:04:42 +01:00
|
|
|
cmp al, ':'
|
2002-04-06 20:51:52 +02:00
|
|
|
jne parg0
|
|
|
|
call clfna ; pobierz nazwe
|
2002-04-20 18:41:42 +02:00
|
|
|
cmp ah, 'D'
|
|
|
|
jne parg0
|
|
|
|
; mov [byte di], 0
|
|
|
|
lea cx, [di-3]
|
|
|
|
sub cx, [defen]
|
|
|
|
jbe usg
|
|
|
|
xchg di, [defen]
|
|
|
|
inc di
|
|
|
|
mov al, '='
|
|
|
|
repne scasb
|
|
|
|
jne usg
|
2002-04-06 20:51:52 +02:00
|
|
|
jmp parg0
|
|
|
|
|
|
|
|
pargx:
|
|
|
|
cmp [(icl t_icl).nam], 0 ; czy jest nazwa?
|
|
|
|
je usg
|
2002-04-07 16:02:26 +02:00
|
|
|
testsw m_swq
|
|
|
|
jnz nohelo
|
|
|
|
mov [usgtxt], '$'
|
|
|
|
print hello
|
|
|
|
nohelo: mov di, offset lstnam
|
2002-04-06 20:51:52 +02:00
|
|
|
mov eax, 'TSL'
|
|
|
|
call defnam
|
|
|
|
mov di, offset objnam
|
|
|
|
mov eax, 'XBO'
|
|
|
|
call defnam
|
|
|
|
|
|
|
|
mov al, [byte swits]
|
2000-05-24 10:07:34 +02:00
|
|
|
and al, m_lstl
|
|
|
|
xor al, m_lstl+m_lsto
|
1998-09-23 16:48:58 +02:00
|
|
|
mov [flist], al
|
1999-08-20 19:15:06 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
testsw m_swe
|
1999-08-20 19:15:06 +02:00
|
|
|
jz noswe
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
mov ax, [word tlabel]
|
|
|
|
jmp prpsp1
|
|
|
|
ENDIF
|
1999-08-20 19:15:06 +02:00
|
|
|
prpsp: mov ax, [16h]
|
2002-04-06 20:51:52 +02:00
|
|
|
prpsp1: mov ds, ax
|
1999-08-20 19:15:06 +02:00
|
|
|
cmp ax, [16h]
|
|
|
|
jne prpsp
|
|
|
|
|
|
|
|
mov ax, [2ch]
|
|
|
|
test ax, ax
|
|
|
|
jz enver
|
|
|
|
dec ax
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
mov [ss:envseg], ax
|
|
|
|
ELSE
|
1999-08-20 19:15:06 +02:00
|
|
|
mov [cs:envseg], ax
|
2002-04-06 20:51:52 +02:00
|
|
|
ENDIF
|
1999-08-20 19:15:06 +02:00
|
|
|
mov ds, ax
|
|
|
|
mov es, ax
|
|
|
|
mov si, 10h
|
|
|
|
mov di, si
|
|
|
|
xor al, al
|
|
|
|
|
|
|
|
renv1: cmp al, [si]
|
|
|
|
jz renvx
|
|
|
|
cmp [word si], 'RE'
|
|
|
|
jne renv2
|
|
|
|
cmp [byte si+2], 'R'
|
|
|
|
jne renv2
|
|
|
|
cmp [byte si+7], '='
|
|
|
|
jne renv2
|
|
|
|
cmp [dword si+3], 'ELIF'
|
|
|
|
je renv3
|
|
|
|
cmp [dword si+3], 'ENIL'
|
|
|
|
je renv3
|
|
|
|
renv2: movsb
|
|
|
|
cmp al, [si-1]
|
|
|
|
jnz renv2
|
|
|
|
jmp renv1
|
|
|
|
renv3: lodsb
|
|
|
|
test al, al
|
|
|
|
jnz renv3
|
|
|
|
jmp renv1
|
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
enver:
|
|
|
|
IFDEF EXE
|
|
|
|
push ss
|
|
|
|
ELSE
|
|
|
|
push cs
|
|
|
|
ENDIF
|
1999-08-20 19:15:06 +02:00
|
|
|
pop ds
|
2002-04-07 16:02:26 +02:00
|
|
|
call prenvt
|
1999-08-20 19:15:06 +02:00
|
|
|
dos 4c02h
|
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
renvx:
|
|
|
|
IFDEF EXE
|
|
|
|
push ss
|
|
|
|
ELSE
|
|
|
|
push cs
|
|
|
|
ENDIF
|
1999-08-20 19:15:06 +02:00
|
|
|
pop ds
|
|
|
|
mov [envofs], di
|
|
|
|
stosb
|
|
|
|
push ds
|
|
|
|
pop es
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
noswe: btr [swits], b_swn
|
1999-08-20 19:15:06 +02:00
|
|
|
jnc noswn
|
|
|
|
|
|
|
|
mov dx, offset objnam ; sprawdz czas modyfikacji object'a
|
|
|
|
dos 3d00h
|
|
|
|
jc noswn ; pewnie nie istnieje
|
|
|
|
sta bx ; handle -> bx
|
|
|
|
dos 5700h
|
|
|
|
mov [word objmod], cx ; zapisz czas
|
|
|
|
mov [word high objmod], dx ; zapisz date
|
|
|
|
dos 3eh
|
2000-05-24 10:07:34 +02:00
|
|
|
setsw m_swn ; sprawdzimy czas modyfikacji source'a
|
1999-08-20 19:15:06 +02:00
|
|
|
|
|
|
|
noswn: mov bp, offset var
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
npass: mov [orgvec], offset t_org-2
|
2002-04-20 18:41:42 +02:00
|
|
|
mov [defvec], offset t_def
|
1998-09-23 16:48:58 +02:00
|
|
|
mov di, [fslen]
|
1998-05-22 18:27:22 +02:00
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
opfile: call fopen
|
2000-05-24 10:07:34 +02:00
|
|
|
btr [swits], b_swn
|
1999-08-20 19:15:06 +02:00
|
|
|
jnc main
|
|
|
|
sta bx
|
|
|
|
dos 5700h ; sprawdz czas modyfikacji
|
|
|
|
push dx
|
|
|
|
push cx
|
|
|
|
pop eax
|
|
|
|
cmp eax, [objmod]
|
|
|
|
ja main
|
2002-04-07 16:02:26 +02:00
|
|
|
mov si, offset oldtxt
|
|
|
|
call prline
|
1999-08-20 19:15:06 +02:00
|
|
|
dos 4c00h
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-20 18:41:42 +02:00
|
|
|
main: mov di, offset line
|
|
|
|
mov si, [defvec]
|
|
|
|
cmp si, [defen]
|
|
|
|
jae nodef
|
|
|
|
mdef1: movsb
|
|
|
|
cmp [byte si], '='
|
|
|
|
jne mdef1
|
|
|
|
inc si
|
|
|
|
mov eax, 'uqe '
|
|
|
|
stosd
|
|
|
|
stosb
|
|
|
|
mdef2: movsb
|
|
|
|
cmp [byte si], 0
|
|
|
|
jne mdef2
|
|
|
|
inc si
|
|
|
|
mov [defvec], si
|
|
|
|
setfl m_def
|
|
|
|
inc [(icl t_icl).line]
|
|
|
|
jmp syntax
|
|
|
|
nodef:
|
|
|
|
btr [flags], b_def
|
|
|
|
jnc ndef1
|
|
|
|
mov [(icl t_icl).line], 0
|
|
|
|
mov [srcen], 0
|
|
|
|
ndef1: mov bx, [iclen]
|
1999-03-04 14:04:42 +01:00
|
|
|
mov bx, [(icl bx).prev]
|
|
|
|
test [(icl bx).flags], m_eofl
|
|
|
|
jnz filend ; czy byl juz koniec pliku ?
|
2002-04-20 18:41:42 +02:00
|
|
|
; ... nie - omin ewentualny LF
|
1999-03-04 14:04:42 +01:00
|
|
|
call fread1
|
|
|
|
jz filend
|
|
|
|
cmp [line], 0ah
|
|
|
|
je skiplf
|
|
|
|
inc di
|
|
|
|
skiplf:
|
1998-05-22 18:27:22 +02:00
|
|
|
mov bx, [iclen]
|
|
|
|
mov bx, [(icl bx).prev]
|
1999-03-04 14:04:42 +01:00
|
|
|
inc [(icl bx).line] ; zwieksz nr linii w pliku
|
|
|
|
inc [lines] ; ilosc wszystkich linii
|
2000-05-24 10:07:34 +02:00
|
|
|
testsw m_swi
|
1999-03-04 14:04:42 +01:00
|
|
|
jz gline1 ; czy /I
|
|
|
|
and [flist], not m_lsti ; ... tak
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp bx, offset t_icl
|
1999-03-04 14:04:42 +01:00
|
|
|
jbe gline1 ; czy includowany plik ?
|
|
|
|
or [flist], m_lsti ; ... tak, nie listuj
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
gline1: cmp di, offset line+256
|
1998-05-10 21:14:44 +02:00
|
|
|
jnb linlon
|
1999-03-04 14:04:42 +01:00
|
|
|
call fread1
|
1998-05-10 21:14:44 +02:00
|
|
|
jz eof
|
1999-04-17 12:36:00 +02:00
|
|
|
mov al, [di]
|
|
|
|
cmp al, 0dh ; pc cr
|
1999-08-29 13:43:20 +02:00
|
|
|
je short syntax
|
1999-04-17 12:36:00 +02:00
|
|
|
cmp al, 0ah ; unix lf
|
|
|
|
je syntax
|
|
|
|
cmp al, 9bh ; atari eol
|
|
|
|
je syntax
|
|
|
|
inc di
|
|
|
|
jmp gline1
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-08-29 13:43:20 +02:00
|
|
|
eof: mov bx, [iclen] ; koniec pliku
|
|
|
|
or [(icl bx).flags], m_eofl
|
1998-09-16 10:39:58 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
syntax: mov [byte di], 0dh
|
|
|
|
mov [eolpos], di
|
|
|
|
mov [lstidx], offset lstorg
|
|
|
|
mov [labvec], 0
|
1999-08-29 13:43:20 +02:00
|
|
|
mov si, offset line ; asembluj linie
|
2000-05-24 10:07:34 +02:00
|
|
|
call rlabel
|
|
|
|
jb nolabl
|
|
|
|
cmp [skflag], 0
|
|
|
|
jnz labelx
|
|
|
|
jpass2 deflp2 ; jest etykieta
|
|
|
|
call flab0 ; definicja etykiety w pass 1
|
1998-09-14 11:48:16 +02:00
|
|
|
jnc ltwice
|
1998-05-10 21:14:44 +02:00
|
|
|
mov di, [laben]
|
|
|
|
mov [labvec], di
|
|
|
|
mov ax, [origin]
|
1999-03-04 14:04:42 +01:00
|
|
|
stosw ; domyslnie equ *
|
1998-09-14 11:48:16 +02:00
|
|
|
mov al, m_lnus
|
1998-09-16 20:44:16 +02:00
|
|
|
mov ah, dl
|
|
|
|
stosw
|
1998-05-10 21:14:44 +02:00
|
|
|
mov cx, dx
|
1998-09-16 20:44:16 +02:00
|
|
|
sub cl, 4
|
|
|
|
lda si
|
|
|
|
mov si, offset tlabel
|
1999-03-04 14:04:42 +01:00
|
|
|
rep movsb ; przepisz nazwe
|
1998-09-16 20:44:16 +02:00
|
|
|
sta si
|
|
|
|
mov [laben], di
|
|
|
|
cmp di, offset t_lab+l_lab-4
|
2000-05-24 10:07:34 +02:00
|
|
|
jb labelx
|
1998-09-16 20:44:16 +02:00
|
|
|
error e_tlab
|
1998-09-14 11:48:16 +02:00
|
|
|
|
|
|
|
ltwice: error e_twice
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
deflp2: mov bx, [pslab] ; definicja etykiety w pass 2
|
|
|
|
mov [labvec], bx
|
1999-03-04 14:04:42 +01:00
|
|
|
add [pslab], dx ; oznacz jako minieta
|
2000-05-24 10:07:34 +02:00
|
|
|
test [(lab bx).flags], m_lnus
|
|
|
|
jz labelx
|
|
|
|
testsw m_swu
|
|
|
|
jz labelx
|
|
|
|
push si
|
|
|
|
push offset w_ulab
|
|
|
|
call warln
|
|
|
|
pop si
|
|
|
|
labelx: cmp [byte si], 0dh
|
|
|
|
je lstreo
|
|
|
|
call spaces
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
nolabl: lodsb
|
1998-05-21 15:50:52 +02:00
|
|
|
cmp al, ' '
|
2000-05-24 10:07:34 +02:00
|
|
|
je nolabl
|
1998-05-21 15:50:52 +02:00
|
|
|
cmp al, 9
|
2000-05-24 10:07:34 +02:00
|
|
|
je nolabl
|
|
|
|
cmp al, '*'
|
|
|
|
je lstrem
|
|
|
|
cmp al, ';'
|
|
|
|
je lstrem
|
|
|
|
cmp al, '|'
|
|
|
|
je lstrem
|
1998-05-21 15:50:52 +02:00
|
|
|
cmp al, 0dh
|
2000-05-24 10:07:34 +02:00
|
|
|
je lstrem
|
|
|
|
cmp al, ':'
|
|
|
|
jne s_one
|
|
|
|
call getuns
|
|
|
|
jc unknow
|
|
|
|
sta cx
|
|
|
|
jcxz lstrem
|
|
|
|
call spaces
|
|
|
|
jmp s_cmd
|
|
|
|
|
|
|
|
lstrem: cmp [byte high labvec], 0
|
|
|
|
jz lstre1
|
|
|
|
lstreo: call chorg
|
|
|
|
call phorg
|
|
|
|
|
|
|
|
lstre1: call lstlin
|
|
|
|
jmp main
|
|
|
|
|
|
|
|
skip1: lodsd ; sprawdz komende
|
|
|
|
dec si
|
|
|
|
and eax, 0dfdfdfh
|
|
|
|
mov di, offset cndtxt
|
|
|
|
mov cx, 5
|
|
|
|
repne scasd
|
|
|
|
jne lstcnd
|
|
|
|
call [word di-4+cndvec-cndtxt]
|
|
|
|
cmp [skflag], 0
|
|
|
|
jz lstre1
|
|
|
|
lstcnd: testsw m_swc
|
|
|
|
jnz lstre1
|
|
|
|
jmp main
|
|
|
|
|
|
|
|
s_one: dec si
|
|
|
|
mov cx, 1
|
|
|
|
s_cmd: cmp [skflag], 0
|
|
|
|
jnz skip1
|
|
|
|
mov [times], cx
|
2000-08-05 23:12:46 +02:00
|
|
|
resfl m_times
|
|
|
|
setfl m_first
|
|
|
|
cmp cx, 1
|
|
|
|
je jone
|
|
|
|
setfl m_times
|
|
|
|
jone: testfl m_norg
|
1998-09-23 16:48:58 +02:00
|
|
|
jnz nlorg
|
2000-05-24 10:07:34 +02:00
|
|
|
call phorg
|
|
|
|
nlorg: mov [cmdvec], si
|
1999-03-04 14:04:42 +01:00
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
rdcmd1: resfl m_pair
|
|
|
|
|
|
|
|
rdcmd2: mov [scdvec], 0
|
|
|
|
rdcmd3: lodsw ; wez trzy litery
|
1998-05-22 18:27:22 +02:00
|
|
|
and ax, 0dfdfh
|
1998-08-31 13:00:16 +02:00
|
|
|
xchg al, ah
|
|
|
|
shl eax, 16
|
|
|
|
mov ah, 0dfh
|
|
|
|
and ah, [si]
|
1999-04-17 12:36:00 +02:00
|
|
|
jopcod lbnox ; jezeli nie cytujemy ...
|
1999-08-20 19:15:06 +02:00
|
|
|
mov [obufpt], offset obuf ; (oprozniamy bufor wyjsciowy)
|
|
|
|
testfl m_norg
|
1999-03-04 14:04:42 +01:00
|
|
|
jz lbnox ; ... i nie bylo ORG ...
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp [byte high labvec], 0
|
1999-03-04 14:04:42 +01:00
|
|
|
je lbnox ; ... a jest etykieta ...
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp eax, 'EQU' shl 8
|
1999-08-29 13:43:20 +02:00
|
|
|
call nenorg ; ... to dozwolony jest tylko EQU
|
1999-08-20 19:15:06 +02:00
|
|
|
lbnox: inc si
|
|
|
|
cmp [byte si], ':' ; czy para instrukcji?
|
|
|
|
jne nopair
|
|
|
|
jopcod ntopco
|
|
|
|
inc si
|
|
|
|
mov [scdvec], si
|
|
|
|
call get ; w kolejnych trzech literach nie moze byc EOLa
|
|
|
|
call get
|
|
|
|
call get
|
|
|
|
setfl m_pair
|
|
|
|
nopair: mov di, offset comtab ; przeszukiwanie polowkowe
|
1998-05-22 18:27:22 +02:00
|
|
|
mov bx, 64*size com
|
1999-03-04 14:04:42 +01:00
|
|
|
sfcmd1: mov al, [(com di+bx).c_code]
|
1999-08-20 19:15:06 +02:00
|
|
|
mov [cod], al
|
|
|
|
mov al, [(com di+bx).c_flag]
|
|
|
|
cmp eax, [dword (com di+bx).c_flag]
|
|
|
|
jb sfcmd2
|
|
|
|
je fncmd
|
|
|
|
add di, bx
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp di, offset comend
|
1999-08-20 19:15:06 +02:00
|
|
|
jb sfcmd2
|
1998-05-10 21:14:44 +02:00
|
|
|
sub di, bx
|
1999-08-20 19:15:06 +02:00
|
|
|
sfcmd2: shr bx, 1
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp bl, 3
|
|
|
|
ja sfcmd1
|
|
|
|
mov bl, 0
|
|
|
|
je sfcmd1
|
1998-09-06 18:05:14 +02:00
|
|
|
error e_inst
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
ntrep: error e_crep
|
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
ntopco: error e_opcod
|
1999-03-04 14:04:42 +01:00
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
ntpair: error e_pair
|
|
|
|
|
|
|
|
ntrepa: error e_repa
|
|
|
|
|
|
|
|
fncmd: test al, 80h
|
|
|
|
jz ckcmd1
|
|
|
|
jopcod ntopco ; nie ma opcoda
|
|
|
|
ckcmd1: test al, 40h
|
|
|
|
jz ckcmd2
|
2000-08-05 23:12:46 +02:00
|
|
|
testfl m_times ; nie mozna powtarzac ...
|
|
|
|
jnz ntrep
|
1999-08-20 19:15:06 +02:00
|
|
|
testfl m_pair ; ... ani parowac
|
|
|
|
jnz ntpair
|
2000-08-05 23:12:46 +02:00
|
|
|
ckcmd2: test al, 20h ; dyrektywa?
|
1999-08-20 19:15:06 +02:00
|
|
|
jz ckcmd3
|
|
|
|
test al, 10h ; nie mozna generowac skoku przez dyrektywe
|
2000-08-05 23:12:46 +02:00
|
|
|
jz rncmd3 ; (dyrektywa neutralna)
|
1999-08-20 19:15:06 +02:00
|
|
|
resfl m_repa ; skok zabroniony
|
|
|
|
testfl m_skit
|
2000-08-05 23:12:46 +02:00
|
|
|
jz rncmd3
|
1999-08-20 19:15:06 +02:00
|
|
|
eskit: error e_skit
|
|
|
|
ckcmd3: jopcod ckcmd4
|
2001-04-07 11:03:20 +02:00
|
|
|
btr [flags], b_skit
|
|
|
|
jnc ckcmd4
|
|
|
|
setfl m_ski2
|
1999-08-20 19:15:06 +02:00
|
|
|
inc [curorg]
|
|
|
|
inc [obufpt]
|
2000-08-05 23:12:46 +02:00
|
|
|
mov cx, m_pair+m_times
|
|
|
|
mov dx, offset w_skif
|
|
|
|
call skirew
|
1999-08-20 19:15:06 +02:00
|
|
|
ckcmd4: test al, 08h
|
|
|
|
jz ckcmd5
|
|
|
|
testfl m_repa ; pseudo instrukcja powtarzania
|
|
|
|
jz ntrepa
|
2000-08-05 23:12:46 +02:00
|
|
|
mov cx, m_repl
|
|
|
|
mov dx, offset w_repl
|
|
|
|
call skirew
|
|
|
|
jmp rncmd2
|
1999-08-20 19:15:06 +02:00
|
|
|
|
|
|
|
ckcmd5: setfl m_repa
|
|
|
|
test al, 04h
|
|
|
|
mov ax, [origin]
|
|
|
|
mov [reporg], ax
|
|
|
|
jz rncmd2
|
2001-04-07 11:03:20 +02:00
|
|
|
resfl m_ski2
|
1999-08-20 19:15:06 +02:00
|
|
|
setfl m_skit ; pseudo instrukcja omijania
|
1999-08-29 13:43:20 +02:00
|
|
|
mov [obuf], 2
|
1999-08-20 19:15:06 +02:00
|
|
|
mov al, [(com di+bx).c_code]
|
|
|
|
call savbyt
|
2001-04-07 11:03:20 +02:00
|
|
|
inc [origin] ; robimy miejsce na argument skoku
|
1999-08-20 19:15:06 +02:00
|
|
|
jmp encmd2
|
|
|
|
|
2000-08-05 23:12:46 +02:00
|
|
|
rncmd2: resfl m_repl
|
|
|
|
testfl m_pair+m_times
|
|
|
|
jz rncmd3
|
|
|
|
setfl m_repl ; ustaw repl, jesli koniec linii z para lub licznikiem
|
|
|
|
rncmd3: mov al, [cod]
|
1999-08-20 19:15:06 +02:00
|
|
|
call [(com di+bx).c_vec] ; wywolaj procedure
|
2001-04-07 11:03:20 +02:00
|
|
|
btr [flags], b_ski2
|
1999-08-20 19:15:06 +02:00
|
|
|
jnc encmd2
|
|
|
|
mov ax, [origin]
|
|
|
|
sub ax, [reporg]
|
|
|
|
add ax, 80h
|
|
|
|
call calcbr
|
|
|
|
mov [obuf], al
|
|
|
|
encmd2: call oflush
|
2000-08-05 23:12:46 +02:00
|
|
|
resfl m_first
|
1999-08-20 19:15:06 +02:00
|
|
|
mov cx, [scdvec]
|
|
|
|
jcxz encmd3
|
|
|
|
mov si, cx
|
|
|
|
jmp rdcmd2
|
|
|
|
encmd3: call linend
|
|
|
|
dec [times]
|
|
|
|
jz main
|
|
|
|
mov si, [cmdvec]
|
|
|
|
jmp rdcmd1
|
|
|
|
|
2000-08-05 23:12:46 +02:00
|
|
|
skirew: jpass1 skiret
|
|
|
|
testfl cx
|
|
|
|
jz skiret
|
|
|
|
testfl m_first
|
|
|
|
jz skiret
|
|
|
|
pusha
|
|
|
|
push dx
|
|
|
|
call warln
|
|
|
|
popa
|
|
|
|
skiret: ret
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
; ERROR
|
|
|
|
errln: call ppline
|
|
|
|
erron: call prname
|
2002-04-07 16:02:26 +02:00
|
|
|
mov dx, offset errtxt
|
|
|
|
mov cx, errtxl
|
|
|
|
call prerr
|
1999-08-20 19:15:06 +02:00
|
|
|
pop si
|
|
|
|
call msgenv
|
|
|
|
dos 4c02h
|
|
|
|
|
|
|
|
; WARNING
|
|
|
|
warln: call ppline
|
|
|
|
call prname
|
2002-04-07 16:02:26 +02:00
|
|
|
mov dx, offset wartxt
|
|
|
|
mov cx, wartxl
|
|
|
|
call prerr
|
1999-08-20 19:15:06 +02:00
|
|
|
pop ax
|
|
|
|
pop si
|
|
|
|
push ax
|
|
|
|
mov [byte exitcod], 1
|
|
|
|
msgenv: call prline
|
|
|
|
btr [flags], b_enve
|
2002-04-07 16:02:26 +02:00
|
|
|
jnc skiret
|
|
|
|
prenvt: mov si, offset envtxt
|
|
|
|
jmp prline
|
1999-08-20 19:15:06 +02:00
|
|
|
|
2002-04-20 18:41:42 +02:00
|
|
|
gname: mov di, [(icl bx).prev]
|
|
|
|
mov dx, offset clitxt
|
|
|
|
mov cx, clitxl
|
|
|
|
testfl m_def
|
|
|
|
jnz gnamex
|
|
|
|
lea cx, [bx-1]
|
|
|
|
lea dx, [(icl di).nam]
|
|
|
|
sub cx, dx
|
|
|
|
gnamex: ret
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
prname: mov bx, [iclen]
|
|
|
|
cmp bx, offset t_icl
|
2002-04-07 16:02:26 +02:00
|
|
|
jna skiret
|
2002-04-20 18:41:42 +02:00
|
|
|
call gname
|
1999-08-20 19:15:06 +02:00
|
|
|
push di
|
|
|
|
mov [envnam], dx
|
|
|
|
sub bx, dx
|
|
|
|
mov [envlen], bx
|
2002-04-07 16:02:26 +02:00
|
|
|
call prerr
|
|
|
|
mov al, ' '
|
|
|
|
call putchar
|
|
|
|
mov al, '('
|
|
|
|
call putchar
|
1999-08-20 19:15:06 +02:00
|
|
|
pop bx
|
|
|
|
mov eax, [(icl bx).line]
|
2002-04-07 16:02:26 +02:00
|
|
|
call numdet
|
|
|
|
mov dx, di
|
|
|
|
mov [envnum], di
|
|
|
|
mov cx, offset dectxt+10
|
|
|
|
sub cx, di
|
|
|
|
call prerr
|
|
|
|
mov al, ')'
|
|
|
|
call putchar
|
|
|
|
mov al, ' '
|
|
|
|
call putchar
|
2000-05-24 10:07:34 +02:00
|
|
|
testsw m_swe
|
2002-04-07 16:02:26 +02:00
|
|
|
jz skiret
|
1999-08-20 19:15:06 +02:00
|
|
|
les di, [dword envofs]
|
|
|
|
mov ax, [es:3]
|
|
|
|
shl ax, 4
|
|
|
|
sub ax, di
|
|
|
|
sub ax, offset dectxt+10+19-1
|
|
|
|
sub ax, [envlen]
|
|
|
|
add ax, [envnum]
|
|
|
|
mov [envlen], ax
|
|
|
|
js senve
|
|
|
|
mov eax, 'FRRE'
|
|
|
|
stosd
|
|
|
|
mov eax, '=ELI'
|
|
|
|
stosd
|
|
|
|
mov si, [envnam]
|
|
|
|
senv1: movsb
|
2002-04-07 16:02:26 +02:00
|
|
|
cmp [byte si], 0 ;'$'
|
1999-08-20 19:15:06 +02:00
|
|
|
jne senv1
|
|
|
|
xor al, al
|
|
|
|
stosb
|
|
|
|
mov eax, 'LRRE'
|
|
|
|
stosd
|
|
|
|
mov eax, '=ENI'
|
|
|
|
stosd
|
|
|
|
mov si, [envnum]
|
|
|
|
senv2: movsb
|
|
|
|
cmp [byte si], '$'
|
|
|
|
jne senv2
|
|
|
|
xor ax, ax
|
|
|
|
stosw
|
|
|
|
push ds
|
|
|
|
pop es
|
|
|
|
ret
|
|
|
|
|
|
|
|
senve: setfl m_enve
|
|
|
|
ret
|
|
|
|
|
|
|
|
ppline: mov si, offset line
|
2002-04-07 16:02:26 +02:00
|
|
|
prline: mov dx, si
|
|
|
|
xor cx, cx
|
|
|
|
prli1: inc si
|
|
|
|
inc cx
|
2000-05-24 10:07:34 +02:00
|
|
|
cmp [byte si-1], 0dh
|
2002-04-07 16:02:26 +02:00
|
|
|
jne prli1
|
|
|
|
mov bx, STDERR
|
|
|
|
dos 40h
|
|
|
|
mov al, 0ah
|
|
|
|
putchar:
|
|
|
|
mov [chbuf], al
|
|
|
|
mov dx, offset chbuf
|
|
|
|
mov cx, 1
|
|
|
|
prerr: mov bx, STDERR
|
|
|
|
dos 40h
|
1999-08-20 19:15:06 +02:00
|
|
|
ret
|
|
|
|
|
|
|
|
miseif: push offset e_meif
|
|
|
|
jmp erron
|
|
|
|
|
|
|
|
skiten: push offset e_skit
|
|
|
|
jmp erron
|
|
|
|
|
|
|
|
; End of file
|
2000-05-24 10:07:34 +02:00
|
|
|
pofend: pop ax
|
1999-03-04 14:04:42 +01:00
|
|
|
filend: call fclose
|
1998-05-22 18:27:22 +02:00
|
|
|
cmp bx, offset t_icl
|
|
|
|
ja main
|
1998-09-06 18:05:14 +02:00
|
|
|
jpass2 fin
|
1998-05-22 18:27:22 +02:00
|
|
|
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp [elflag], 1
|
|
|
|
jne miseif
|
1999-08-20 19:15:06 +02:00
|
|
|
testfl m_skit
|
|
|
|
jnz skiten
|
2000-05-24 10:07:34 +02:00
|
|
|
setfl m_pass+m_norg+m_rorg+m_rqff+m_hdr+m_wobj
|
1998-09-23 16:48:58 +02:00
|
|
|
and [flist], not m_lsto
|
|
|
|
jmp npass
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-05-22 18:27:22 +02:00
|
|
|
fin: mov bx, [ohand]
|
1999-03-04 14:04:42 +01:00
|
|
|
mov [errmsg], offset e_wrobj
|
1998-09-23 16:48:58 +02:00
|
|
|
call hclose
|
2000-05-24 10:07:34 +02:00
|
|
|
testsw m_swt
|
1999-03-04 14:04:42 +01:00
|
|
|
jz nlata ; czy /T ?
|
|
|
|
cmp [laben], offset t_lab ; ... tak
|
|
|
|
jbe nlata ; czy tablica pusta ?
|
|
|
|
cmp [byte tabnam], 0 ; ... nie
|
|
|
|
jnz oplata ; czy dana nazwa ?
|
|
|
|
cmp [lhand], nhand ; ... nie
|
|
|
|
jne latt1 ; czy otwarty listing ?
|
|
|
|
call opnlst ; ... nie - otworz
|
1998-09-23 16:48:58 +02:00
|
|
|
jmp latt2
|
|
|
|
latt1: call plseol
|
|
|
|
jmp latt2
|
1999-03-04 14:04:42 +01:00
|
|
|
oplata: call lclose ; zamknij listing
|
1998-09-23 16:48:58 +02:00
|
|
|
mov dx, offset tabnam
|
1999-03-04 14:04:42 +01:00
|
|
|
call opntab ; otworz tablica
|
1998-09-23 16:48:58 +02:00
|
|
|
latt2: mov dx, offset tabtxt
|
|
|
|
mov cx, tabtxl
|
|
|
|
call putlad
|
|
|
|
mov si, offset t_lab
|
|
|
|
lata1: mov di, offset lstnum
|
|
|
|
mov eax, ' '
|
|
|
|
test [(lab si).flags], m_lnus
|
|
|
|
jz lata2
|
|
|
|
mov al, 'n'
|
|
|
|
lata2: test [(lab si).flags], m_ukp1
|
|
|
|
jz lata3
|
|
|
|
mov ah, '2'
|
|
|
|
lata3: stosd
|
1999-03-04 14:04:42 +01:00
|
|
|
mov ax, [(lab si).l_val]
|
1998-09-23 16:48:58 +02:00
|
|
|
test [(lab si).flags], m_sign
|
|
|
|
jz lata4
|
|
|
|
mov [byte di-1], '-'
|
|
|
|
neg ax
|
|
|
|
lata4: call phword
|
|
|
|
mov al, ' '
|
|
|
|
stosb
|
|
|
|
mov cx, (offset (lab)-offset (lab).nam) and 0ffh
|
|
|
|
add cl, [(lab si).len]
|
|
|
|
add si, offset (lab).nam
|
|
|
|
rep movsb
|
|
|
|
call putlst
|
|
|
|
cmp si, [laben]
|
|
|
|
jb lata1
|
|
|
|
|
|
|
|
nlata: call lclose
|
2002-04-07 16:02:26 +02:00
|
|
|
testsw m_swq
|
|
|
|
jnz zrbyt
|
1998-05-10 21:14:44 +02:00
|
|
|
mov eax, [lines]
|
|
|
|
shr eax, 1
|
|
|
|
call pridec
|
|
|
|
print lintxt
|
|
|
|
mov eax, [bytes]
|
1998-10-03 15:17:18 +02:00
|
|
|
test eax, eax
|
|
|
|
jz zrbyt
|
1998-05-10 21:14:44 +02:00
|
|
|
call pridec
|
|
|
|
print byttxt
|
1998-10-03 15:17:18 +02:00
|
|
|
zrbyt: mov ax, [exitcod]
|
1999-08-29 13:43:20 +02:00
|
|
|
; dos ;!!!
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-05-22 18:27:22 +02:00
|
|
|
; I/O
|
1999-03-04 14:04:42 +01:00
|
|
|
xdisk: dos
|
|
|
|
jnc cloret
|
|
|
|
push [errmsg]
|
|
|
|
jmp erron
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
icler: push offset e_icl
|
|
|
|
jmp erron
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
lclose: mov bx, nhand ; mov bx, [lhand]
|
|
|
|
xchg bx, [lhand] ; mov [lhand], nhand
|
|
|
|
mov [errmsg], offset e_wrlst
|
1998-09-23 16:48:58 +02:00
|
|
|
hclose: cmp bx, nhand
|
|
|
|
je cloret
|
1999-08-29 13:43:20 +02:00
|
|
|
jfile 3eh
|
1998-09-23 16:48:58 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
fopen: cmp di, offset t_icl+l_icl-2
|
|
|
|
jnb icler
|
2002-04-06 20:51:52 +02:00
|
|
|
testsw m_swp
|
|
|
|
jz fopen1
|
|
|
|
push si
|
|
|
|
mov si, offset (icl).nam
|
|
|
|
add si, [iclen]
|
|
|
|
mov di, offset tlabel
|
|
|
|
file 60h, e_open
|
|
|
|
mov si, offset tlabel
|
|
|
|
mov di, offset (icl).nam
|
|
|
|
add di, [iclen]
|
|
|
|
fomna: lodsb
|
|
|
|
stosb
|
|
|
|
test al, al
|
|
|
|
jnz fomna
|
|
|
|
pop si
|
|
|
|
fopen1: mov bx, [iclen]
|
1998-05-22 18:27:22 +02:00
|
|
|
mov [(icl bx).line], 0
|
1999-03-04 14:04:42 +01:00
|
|
|
mov [(icl bx).flags], 0
|
1998-05-22 18:27:22 +02:00
|
|
|
lea dx, [(icl bx).nam]
|
|
|
|
mov [(icl di).prev], bx
|
|
|
|
mov [iclen], di
|
|
|
|
file 3d00h, e_open
|
|
|
|
mov bx, [iclen]
|
|
|
|
mov bx, [(icl bx).prev]
|
|
|
|
mov [(icl bx).handle], ax
|
1999-08-29 13:43:20 +02:00
|
|
|
cloret: ret
|
1998-05-22 18:27:22 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
fread1: mov dx, di
|
|
|
|
mov cx, 1
|
1998-05-22 18:27:22 +02:00
|
|
|
fread: mov ah, 3fh
|
1999-03-04 14:04:42 +01:00
|
|
|
fsrce: mov bx, [iclen]
|
1998-05-22 18:27:22 +02:00
|
|
|
mov bx, [(icl bx).prev]
|
|
|
|
mov bx, [(icl bx).handle]
|
1999-03-04 14:04:42 +01:00
|
|
|
mov [errmsg], offset e_read
|
1998-05-22 18:27:22 +02:00
|
|
|
call xdisk
|
|
|
|
test ax, ax
|
|
|
|
ret
|
|
|
|
|
|
|
|
fclose: mov ah, 3eh
|
1999-03-04 14:04:42 +01:00
|
|
|
call fsrce
|
1998-05-22 18:27:22 +02:00
|
|
|
mov bx, [iclen]
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp bx, [srcen]
|
|
|
|
jne fclos1
|
|
|
|
mov [srcen], 0
|
|
|
|
fclos1: mov bx, [(icl bx).prev]
|
1998-05-22 18:27:22 +02:00
|
|
|
mov [iclen], bx
|
|
|
|
ret
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
putwor: mov cx, 2 ; zapisz slowo do pliku
|
2000-05-24 10:07:34 +02:00
|
|
|
mov dx, offset oword
|
1999-08-20 19:15:06 +02:00
|
|
|
mov [oword], ax
|
|
|
|
putblk: jpass1 putx ; zapisz blok
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp [ohand], nhand
|
1999-03-04 14:04:42 +01:00
|
|
|
jne putb1 ; otwarty object ?
|
1999-08-20 19:15:06 +02:00
|
|
|
push cx dx
|
1999-03-04 14:04:42 +01:00
|
|
|
mov dx, offset objnam ; ... nie - otworz
|
1998-09-23 16:48:58 +02:00
|
|
|
xor cx, cx
|
|
|
|
file 3ch, e_crobj
|
|
|
|
mov [ohand], ax
|
2002-04-07 16:02:26 +02:00
|
|
|
testsw m_swq
|
|
|
|
jnz noobjt
|
1998-09-23 16:48:58 +02:00
|
|
|
print objtxt
|
2002-04-07 16:02:26 +02:00
|
|
|
noobjt: pop dx cx
|
1998-09-23 16:48:58 +02:00
|
|
|
putb1: mov bx, [ohand]
|
|
|
|
file 40h, e_wrobj
|
1999-08-20 19:15:06 +02:00
|
|
|
movzx ecx, cx
|
|
|
|
add [bytes], ecx
|
1998-05-10 21:14:44 +02:00
|
|
|
putx: ret
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
orgwor: push ax
|
|
|
|
call phword
|
|
|
|
pop ax
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp putwor
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
chorg: testfl m_norg
|
1999-08-29 13:43:20 +02:00
|
|
|
nenorg: jz putx
|
|
|
|
error e_norg
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
tmorgs: error e_orgs
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
incorg: inc [origin]
|
|
|
|
ret
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
savwor: push ax
|
|
|
|
call savbyt
|
|
|
|
pop ax
|
|
|
|
mov al, ah
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
savbyt: jopcod xopco
|
2000-05-24 10:07:34 +02:00
|
|
|
testfl m_wobj
|
|
|
|
jz incorg
|
1999-08-20 19:15:06 +02:00
|
|
|
mov di, [obufpt]
|
|
|
|
stosb
|
|
|
|
mov [obufpt], di
|
|
|
|
testfl m_hdr
|
1998-09-23 16:48:58 +02:00
|
|
|
jz savb1
|
1999-08-20 19:15:06 +02:00
|
|
|
call chorg
|
1998-09-23 16:48:58 +02:00
|
|
|
mov ax, [origin]
|
1999-08-20 19:15:06 +02:00
|
|
|
testfl m_rorg
|
1998-09-23 16:48:58 +02:00
|
|
|
jnz borg1
|
|
|
|
cmp ax, [curorg]
|
|
|
|
je borg3
|
|
|
|
borg1: add [orgvec], 2
|
2000-05-24 10:07:34 +02:00
|
|
|
cmp [orgvec], offset t_org+l_org
|
|
|
|
jae tmorgs
|
1998-09-23 16:48:58 +02:00
|
|
|
jpass1 borg2
|
|
|
|
mov di, offset lstorg
|
1999-08-20 19:15:06 +02:00
|
|
|
testfl m_rqff
|
1998-09-23 16:48:58 +02:00
|
|
|
jz noff
|
|
|
|
mov ax, 0ffffh
|
|
|
|
call orgwor
|
|
|
|
mov ax, ' >'
|
|
|
|
stosw
|
|
|
|
mov ax, [origin]
|
|
|
|
noff: call orgwor
|
|
|
|
mov al, '-'
|
1998-05-22 18:27:22 +02:00
|
|
|
stosb
|
1998-09-23 16:48:58 +02:00
|
|
|
mov bx, [orgvec]
|
|
|
|
mov ax, [bx]
|
|
|
|
call orgwor
|
|
|
|
mov ax, ' >'
|
|
|
|
stosw
|
|
|
|
mov ax, [origin]
|
1999-08-20 19:15:06 +02:00
|
|
|
mov [lstidx], di
|
|
|
|
borg2: resfl m_rorg+m_rqff
|
1998-09-23 16:48:58 +02:00
|
|
|
borg3: jpass2 borg4
|
|
|
|
mov di, [orgvec]
|
|
|
|
stosw
|
|
|
|
borg4: inc ax
|
|
|
|
mov [curorg], ax
|
|
|
|
|
|
|
|
savb1: inc [origin]
|
1999-08-20 19:15:06 +02:00
|
|
|
cmp [obufpt], offset obufen
|
|
|
|
jb oflur
|
|
|
|
testfl m_skit
|
|
|
|
jnz eskit
|
|
|
|
|
|
|
|
oflush: mov dx, offset obuf
|
|
|
|
mov cx, [obufpt]
|
|
|
|
sub cx, dx
|
|
|
|
jz oflur
|
|
|
|
mov [obufpt], dx
|
|
|
|
call putblk
|
1998-09-23 16:48:58 +02:00
|
|
|
test [flist], m_lsts
|
1999-08-20 19:15:06 +02:00
|
|
|
jnz oflur
|
|
|
|
mov bx, offset obuf
|
1998-09-23 16:48:58 +02:00
|
|
|
mov di, [lstidx]
|
1999-08-20 19:15:06 +02:00
|
|
|
olst1: cmp di, offset line-3
|
1998-09-23 16:48:58 +02:00
|
|
|
jae lstxtr
|
1999-08-20 19:15:06 +02:00
|
|
|
mov al, [bx]
|
|
|
|
inc bx
|
1998-09-23 16:48:58 +02:00
|
|
|
call phbyte
|
|
|
|
mov al, ' '
|
1999-08-20 19:15:06 +02:00
|
|
|
stosb
|
|
|
|
loop olst1
|
|
|
|
olstx: mov [lstidx], di
|
|
|
|
oflur: ret
|
|
|
|
lstxtr: cmp di, offset line-1
|
|
|
|
jae olstx
|
|
|
|
mov ax, ' +'
|
|
|
|
stosw
|
1998-09-23 16:48:58 +02:00
|
|
|
mov [lstidx], di
|
1999-08-20 19:15:06 +02:00
|
|
|
linret: ret
|
1998-10-03 15:17:18 +02:00
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
; Stwierdza blad, jesli nie spacja, tab lub eol
|
|
|
|
linend: lodsb
|
1998-05-22 18:27:22 +02:00
|
|
|
cmp al, 0dh
|
1998-09-23 16:48:58 +02:00
|
|
|
je linen1
|
|
|
|
cmp al, ' '
|
|
|
|
je linen1
|
|
|
|
cmp al, 9
|
|
|
|
je linen1
|
|
|
|
error e_xtra
|
2000-05-24 10:07:34 +02:00
|
|
|
; Listuje linie po ostatnim przebiegu
|
|
|
|
linen1: cmp [times], 1
|
1999-03-04 14:04:42 +01:00
|
|
|
jne linret
|
2000-05-24 10:07:34 +02:00
|
|
|
; Listuje linie
|
|
|
|
lstlin: test [flist], m_lsts
|
|
|
|
jnz linret
|
|
|
|
mov di, offset lstspa
|
1998-09-23 16:48:58 +02:00
|
|
|
mov bx, [iclen]
|
|
|
|
mov bx, [(icl bx).prev]
|
|
|
|
mov eax, [(icl bx).line]
|
|
|
|
call numdec
|
2000-05-24 10:07:34 +02:00
|
|
|
mov al, ' '
|
|
|
|
lstl1: dec di
|
|
|
|
mov [di], al
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp di, offset lstnum
|
2000-05-24 10:07:34 +02:00
|
|
|
ja lstl1
|
|
|
|
mov di, [lstidx]
|
|
|
|
mov cx, offset line
|
|
|
|
sub cx, di
|
|
|
|
rep stosb
|
|
|
|
mov [lstspa], al
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
mov bx, [iclen]
|
|
|
|
cmp bx, [srcen]
|
1999-03-04 14:04:42 +01:00
|
|
|
je nlsrc ; czy zmienil sie asemblowany plik ?
|
|
|
|
mov [srcen], bx ; ... tak
|
1998-09-23 16:48:58 +02:00
|
|
|
cmp [lhand], nhand
|
1999-03-04 14:04:42 +01:00
|
|
|
jne lsrc1 ; otwarty listing ?
|
|
|
|
call opnlst ; ... nie - otworz
|
1998-09-23 16:48:58 +02:00
|
|
|
lsrc1: mov dx, offset srctxt
|
|
|
|
mov cx, offset srctxl
|
1999-03-04 14:04:42 +01:00
|
|
|
call putlad ; komunikat o nowym source'u
|
1998-09-23 16:48:58 +02:00
|
|
|
mov bx, [iclen]
|
2002-04-20 18:41:42 +02:00
|
|
|
call gname
|
1999-03-04 14:04:42 +01:00
|
|
|
call putlad ; nazwa
|
1998-09-23 16:48:58 +02:00
|
|
|
call plseol
|
|
|
|
nlsrc:
|
2000-05-24 10:07:34 +02:00
|
|
|
mov di, [eolpos]
|
|
|
|
testsw m_sws
|
|
|
|
jnz ctrail ; jezeli nie ma /S ...
|
1998-09-23 16:48:58 +02:00
|
|
|
mov si, offset lstnum
|
1999-03-04 14:04:42 +01:00
|
|
|
mov di, si ; ... zamien spacje na taby
|
1998-09-23 16:48:58 +02:00
|
|
|
spata1: xor dl, dl
|
|
|
|
spata2: lodsb
|
2000-05-24 10:07:34 +02:00
|
|
|
cmp al, 0dh
|
|
|
|
je ctrail
|
1998-09-23 16:48:58 +02:00
|
|
|
stosb
|
|
|
|
cmp al, 9
|
|
|
|
je spata1
|
|
|
|
dec dx
|
|
|
|
cmp al, ' '
|
|
|
|
jne spata2
|
|
|
|
and dx, 7
|
|
|
|
jz spata2
|
|
|
|
mov cx, dx
|
|
|
|
mov bx, si
|
|
|
|
spata3: cmp al, [bx]
|
|
|
|
jne spata2
|
|
|
|
inc bx
|
|
|
|
loop spata3
|
|
|
|
mov [byte di-1], 9
|
|
|
|
mov si, bx
|
|
|
|
jmp spata1
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
strail: dec di
|
|
|
|
ctrail: cmp [byte di-1], ' '
|
|
|
|
je strail
|
|
|
|
cmp [byte di-1], 9
|
|
|
|
je strail
|
|
|
|
putlst: mov ax, 0a0dh
|
|
|
|
stosw
|
|
|
|
mov dx, offset lstnum
|
2002-04-06 20:51:52 +02:00
|
|
|
mov cx, di
|
|
|
|
sub cx, dx
|
1998-09-23 16:48:58 +02:00
|
|
|
putlad: mov bx, [lhand]
|
1999-08-29 13:43:20 +02:00
|
|
|
jfile 40h, e_wrlst
|
1998-09-23 16:48:58 +02:00
|
|
|
|
|
|
|
opnlst: mov dx, offset lstnam
|
|
|
|
opntab: xor cx, cx
|
|
|
|
file 3ch, e_crlst
|
|
|
|
mov [lhand], ax
|
2002-04-07 16:02:26 +02:00
|
|
|
testsw m_swq
|
|
|
|
jnz nolstt
|
1998-09-23 16:48:58 +02:00
|
|
|
print lsttxt
|
2002-04-07 16:02:26 +02:00
|
|
|
nolstt: mov dx, offset hello
|
1998-09-23 16:48:58 +02:00
|
|
|
mov cx, hellen
|
|
|
|
jmp putlad
|
|
|
|
|
|
|
|
plseol: mov dx, offset eoltxt
|
|
|
|
mov cx, 2
|
|
|
|
jmp putlad
|
|
|
|
|
|
|
|
adasx: mov eax, 'XSA'
|
1999-03-04 14:04:42 +01:00
|
|
|
; Dodaj rozszerzenie nazwy, gdy go nie ma
|
|
|
|
; we: dx,di-poczatek,koniec nazwy; eax-rozszerzenie
|
1998-09-23 16:48:58 +02:00
|
|
|
adext: mov bx, di
|
|
|
|
adex1: dec bx
|
|
|
|
cmp [byte bx], '\'
|
|
|
|
je adex2
|
|
|
|
cmp [byte bx], '.'
|
|
|
|
je adexr
|
|
|
|
cmp bx, dx
|
|
|
|
ja adex1
|
|
|
|
adex2: mov [byte di-1], '.'
|
|
|
|
stosd
|
|
|
|
adexr: ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Zapisz dziesietnie eax; di-koniec liczby
|
2002-04-07 16:02:26 +02:00
|
|
|
numdet: mov di, offset dectxt+10
|
1998-09-23 16:48:58 +02:00
|
|
|
numdec: mov ebx, 10
|
|
|
|
numde1: cdq
|
1998-05-10 21:14:44 +02:00
|
|
|
div ebx
|
|
|
|
add dl, '0'
|
|
|
|
dec di
|
|
|
|
mov [di], dl
|
|
|
|
test eax, eax
|
1998-09-23 16:48:58 +02:00
|
|
|
jnz numde1
|
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Wyswietl dziesietnie eax
|
2002-04-07 16:02:26 +02:00
|
|
|
pridec: call numdet
|
1998-05-10 21:14:44 +02:00
|
|
|
mov dx, di
|
2002-04-07 16:02:26 +02:00
|
|
|
; mov [envnum], di
|
1998-05-10 21:14:44 +02:00
|
|
|
print
|
|
|
|
ret
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
; Zapisz hex origin
|
|
|
|
phorg: mov di, offset lstorg
|
|
|
|
mov ax, [origin]
|
|
|
|
call phword ; listuj * hex
|
|
|
|
mov al, ' '
|
|
|
|
stosb
|
|
|
|
mov [lstidx], di
|
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Zapisz hex ax od [di]
|
1998-09-06 18:05:14 +02:00
|
|
|
phword: push ax
|
|
|
|
mov al, ah
|
|
|
|
call phbyte
|
|
|
|
pop ax
|
1999-08-20 19:15:06 +02:00
|
|
|
phbyte: aam 10h
|
|
|
|
cmp al, 10
|
1998-09-06 18:05:14 +02:00
|
|
|
sbb al, 69h
|
|
|
|
das
|
1999-08-20 19:15:06 +02:00
|
|
|
xchg al, ah
|
|
|
|
cmp al, 10
|
|
|
|
sbb al, 69h
|
|
|
|
das
|
|
|
|
stosw
|
1998-09-06 18:05:14 +02:00
|
|
|
ret
|
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
; Pobierz nazwe pliku z linii polecen (al=#1 znak si=adr kolejnego) i zapisz do di
|
|
|
|
clfname:
|
|
|
|
clf1: stosb
|
|
|
|
clfna:
|
|
|
|
lodsb
|
|
|
|
cmp al, ' '
|
|
|
|
je clfx
|
|
|
|
cmp al, 9
|
|
|
|
je clfx
|
2002-04-07 16:02:26 +02:00
|
|
|
; cmp al, '/'
|
|
|
|
; je clfx
|
2002-04-06 20:51:52 +02:00
|
|
|
cmp al, 0dh
|
|
|
|
jne clf1
|
|
|
|
clfx: xor al, al
|
|
|
|
stosb
|
|
|
|
ret
|
|
|
|
|
|
|
|
; wpisz domyslna nazwe dla obx lub lst
|
|
|
|
defnam: cmp [byte di], 0
|
|
|
|
jnz defnr
|
|
|
|
mov si, [fslen]
|
|
|
|
defn1: dec si
|
|
|
|
cmp [byte si], '.'
|
|
|
|
jne defn1
|
|
|
|
lea cx, [si+1]
|
|
|
|
mov si, offset (icl t_icl).nam
|
|
|
|
sub cx, si
|
|
|
|
rep movsb
|
|
|
|
stosd
|
|
|
|
defnr: ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Pobierz znak (eol=error)
|
1998-05-21 15:50:52 +02:00
|
|
|
get: lodsb
|
|
|
|
cmp al, 0dh
|
|
|
|
je uneol
|
|
|
|
ret
|
1998-09-06 18:05:14 +02:00
|
|
|
uneol: error e_uneol
|
1998-05-21 15:50:52 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Omin spacje i tabulatory
|
1998-05-21 15:50:52 +02:00
|
|
|
spaces: call get
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, ' '
|
1998-05-21 15:50:52 +02:00
|
|
|
je space1
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 9
|
1998-05-21 15:50:52 +02:00
|
|
|
je space1
|
1998-09-06 18:05:14 +02:00
|
|
|
error e_spac
|
1998-05-21 15:50:52 +02:00
|
|
|
space1: call get
|
|
|
|
cmp al, ' '
|
|
|
|
je space1
|
|
|
|
cmp al, 9
|
|
|
|
je space1
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
|
|
|
rstret: ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Pobierz nazwe pliku
|
1998-05-22 18:27:22 +02:00
|
|
|
rfname: call spaces
|
|
|
|
mov di, offset (icl).nam
|
|
|
|
add di, [iclen]
|
1999-03-04 14:04:42 +01:00
|
|
|
; Pobierz lancuch do [di]
|
1998-05-21 15:50:52 +02:00
|
|
|
rstr: call get
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, "'"
|
1998-09-16 10:39:58 +02:00
|
|
|
je rstr0
|
|
|
|
cmp al, '"'
|
1998-05-10 21:14:44 +02:00
|
|
|
jne strer
|
1998-09-16 10:39:58 +02:00
|
|
|
rstr0: mov dx, di
|
|
|
|
mov ah, al
|
1998-05-21 15:50:52 +02:00
|
|
|
rstr1: call get
|
1998-05-10 21:14:44 +02:00
|
|
|
stosb
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, ah
|
1998-05-10 21:14:44 +02:00
|
|
|
jne rstr1
|
|
|
|
lodsb
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, ah
|
1998-05-10 21:14:44 +02:00
|
|
|
je rstr1
|
|
|
|
dec si
|
1998-05-22 18:27:22 +02:00
|
|
|
mov [byte di-1], 0
|
|
|
|
lea cx, [di-1]
|
|
|
|
sub cx, dx
|
1998-05-10 21:14:44 +02:00
|
|
|
jnz rstret
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
strer: error e_str
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Przepisz etykiete do tlabel (wyj: dx-dl.etykiety+4)
|
1998-05-10 21:14:44 +02:00
|
|
|
rlabel: mov di, offset tlabel
|
|
|
|
mov [byte di], 0
|
1998-09-14 11:48:16 +02:00
|
|
|
rlab1: lodsb
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '0'
|
1998-09-14 11:48:16 +02:00
|
|
|
jb rlabx
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '9'
|
1998-09-14 11:48:16 +02:00
|
|
|
jbe rlab2
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '_'
|
1998-09-14 11:48:16 +02:00
|
|
|
je rlab2
|
1999-08-20 19:15:06 +02:00
|
|
|
and al, 0dfh
|
|
|
|
cmp al, 'A'
|
1998-09-14 11:48:16 +02:00
|
|
|
jb rlabx
|
1999-08-20 19:15:06 +02:00
|
|
|
cmp al, 'Z'
|
1998-09-14 11:48:16 +02:00
|
|
|
ja rlabx
|
|
|
|
rlab2: stosb
|
1998-09-16 20:44:16 +02:00
|
|
|
cmp di, offset tlabel+252
|
|
|
|
jb rlab1
|
1999-08-20 19:15:06 +02:00
|
|
|
linlon: push offset e_long
|
|
|
|
jmp erron
|
2002-04-06 20:51:52 +02:00
|
|
|
rlabx: lea dx, [(lab di).nam]
|
|
|
|
sub dx, offset tlabel
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
2000-05-24 10:07:34 +02:00
|
|
|
cmp [byte tlabel], 'A'
|
1998-09-14 11:48:16 +02:00
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Czytaj etykiete i szukaj w t_lab
|
1998-09-16 20:44:16 +02:00
|
|
|
; wyj: dx-dlugosc etykiety+4
|
1998-09-14 11:48:16 +02:00
|
|
|
; C=0: znaleziona, bx=adres wpisu
|
|
|
|
; C=1: nie ma jej
|
|
|
|
flabel: call rlabel
|
2000-05-24 10:07:34 +02:00
|
|
|
jb ilchar
|
|
|
|
flab0: push si
|
1998-09-16 20:44:16 +02:00
|
|
|
xor cx, cx
|
|
|
|
mov si, offset t_lab
|
|
|
|
mov ax, [laben]
|
|
|
|
dec ax
|
|
|
|
flab1: add si, cx
|
|
|
|
cmp ax, si
|
1998-09-14 11:48:16 +02:00
|
|
|
jb flabx
|
1998-09-16 20:44:16 +02:00
|
|
|
mov cl, [(lab si).len]
|
|
|
|
cmp cl, dl
|
1998-09-14 11:48:16 +02:00
|
|
|
jne flab1
|
1998-09-16 20:44:16 +02:00
|
|
|
add si, offset (lab).nam
|
|
|
|
sub cl, offset (lab).nam
|
1998-05-10 21:14:44 +02:00
|
|
|
mov di, offset tlabel
|
|
|
|
repe cmpsb
|
1998-09-14 11:48:16 +02:00
|
|
|
jne flab1
|
2002-04-06 20:51:52 +02:00
|
|
|
mov bx, offset tlabel - offset (lab).nam
|
|
|
|
add bx, si
|
1999-03-04 14:04:42 +01:00
|
|
|
sub bx, di ; c=0
|
1998-09-14 11:48:16 +02:00
|
|
|
flabx: pop si
|
1998-05-10 21:14:44 +02:00
|
|
|
ret
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
wropar: error e_wpar
|
|
|
|
|
|
|
|
spaval: call spaces
|
1999-03-04 14:04:42 +01:00
|
|
|
; Czytaj wyrazenie i zwroc jego wartosc w [val]
|
1998-08-25 16:47:04 +02:00
|
|
|
; (C=1 wartosc nieokreslona w pass 1)
|
1998-09-14 11:48:16 +02:00
|
|
|
getval: xor bx, bx
|
|
|
|
mov [ukp1], bh
|
|
|
|
push bx
|
|
|
|
|
|
|
|
v_lop:
|
|
|
|
v_par1: inc bh
|
1999-08-29 13:43:20 +02:00
|
|
|
v_par0: call get
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp al, '['
|
|
|
|
je v_par1
|
1999-08-29 13:43:20 +02:00
|
|
|
mov di, offset opert0
|
|
|
|
mov cx, noper0
|
|
|
|
repne scasb
|
|
|
|
jne v_n1a
|
|
|
|
sub di, offset opert0-noper1-noper2
|
|
|
|
call goprpa
|
2001-08-21 18:19:24 +02:00
|
|
|
dec bh
|
1999-08-29 13:43:20 +02:00
|
|
|
push di bx
|
2001-08-21 18:19:24 +02:00
|
|
|
inc bh
|
1999-08-29 13:43:20 +02:00
|
|
|
jmp v_par0
|
|
|
|
|
|
|
|
v_n1a: cmp al, '('
|
1998-09-14 11:48:16 +02:00
|
|
|
je wropar
|
2000-05-24 10:07:34 +02:00
|
|
|
movzx eax, al
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '*'
|
|
|
|
je valorg
|
|
|
|
cmp al, "'"
|
|
|
|
je valchr
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, '"'
|
|
|
|
je valchr
|
1998-05-21 15:50:52 +02:00
|
|
|
cmp al, '^'
|
|
|
|
je valreg
|
1999-03-04 14:04:42 +01:00
|
|
|
cmp al, '{'
|
|
|
|
je valquo
|
|
|
|
mov di, -1
|
2000-05-24 10:07:34 +02:00
|
|
|
cdq ; xor edx, edx
|
1998-09-14 11:48:16 +02:00
|
|
|
mov ecx, 16
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '$'
|
|
|
|
je rdnum3
|
1998-09-14 11:48:16 +02:00
|
|
|
mov cl, 2
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '%'
|
|
|
|
je rdnum3
|
1998-09-14 11:48:16 +02:00
|
|
|
mov cl, 10
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '9'
|
|
|
|
ja vlabel
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
rdnum1: cmp al, '9'
|
|
|
|
jbe rdnum2
|
1998-05-10 21:14:44 +02:00
|
|
|
and al, 0dfh
|
|
|
|
cmp al, 'A'
|
|
|
|
jb value0
|
|
|
|
add al, '0'+10-'A'
|
|
|
|
rdnum2: sub al, '0'
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp al, cl
|
1998-05-10 21:14:44 +02:00
|
|
|
jnb value0
|
1999-03-04 14:04:42 +01:00
|
|
|
movzx edi, al
|
1998-09-14 11:48:16 +02:00
|
|
|
lda edx
|
|
|
|
mul ecx
|
1999-03-04 14:04:42 +01:00
|
|
|
add eax, edi
|
1998-09-14 11:48:16 +02:00
|
|
|
js toobig
|
|
|
|
adc edx, edx
|
1998-05-10 21:14:44 +02:00
|
|
|
jnz toobig
|
1998-09-14 11:48:16 +02:00
|
|
|
sta edx
|
1998-05-10 21:14:44 +02:00
|
|
|
rdnum3: lodsb
|
|
|
|
jmp rdnum1
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
vlabel: push bx
|
|
|
|
dec si
|
|
|
|
call flabel
|
|
|
|
jnc vlabfn
|
|
|
|
jpass1 vlukp1
|
|
|
|
error e_undec
|
2000-05-24 10:07:34 +02:00
|
|
|
vlabfn: and [(lab bx).flags], not m_lnus
|
|
|
|
jpass1 vlchuk
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp bx, [pslab]
|
1998-09-30 19:23:10 +02:00
|
|
|
jb vlchuk
|
|
|
|
test [(lab bx).flags], m_ukp1
|
|
|
|
jz vlukp1
|
1998-09-14 11:48:16 +02:00
|
|
|
error e_fref
|
1998-09-30 19:23:10 +02:00
|
|
|
vlchuk: test [(lab bx).flags], m_ukp1
|
|
|
|
jz vlabkn
|
1998-09-14 11:48:16 +02:00
|
|
|
vlukp1: mov [ukp1], 0ffh
|
|
|
|
vlabkn: bt [word (lab bx).flags], b_sign
|
|
|
|
sbb eax, eax
|
1999-03-04 14:04:42 +01:00
|
|
|
mov ax, [(lab bx).l_val]
|
1998-09-14 11:48:16 +02:00
|
|
|
pop bx
|
|
|
|
jmp value1
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
valorg: call chorg
|
|
|
|
mov ax, [origin]
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp value1
|
|
|
|
|
1998-09-16 10:39:58 +02:00
|
|
|
valchr: mov dl, al
|
|
|
|
call get
|
|
|
|
cmp al, dl
|
1998-05-10 21:14:44 +02:00
|
|
|
jne valch1
|
|
|
|
lodsb
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, dl
|
1998-05-10 21:14:44 +02:00
|
|
|
jne strer
|
1998-09-16 10:39:58 +02:00
|
|
|
valch1: cmp dl, [si]
|
1998-05-10 21:14:44 +02:00
|
|
|
jne strer
|
1998-09-14 11:48:16 +02:00
|
|
|
inc si
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp [byte si], '*'
|
|
|
|
jne value1
|
|
|
|
inc si
|
1998-09-14 11:48:16 +02:00
|
|
|
xor al, 80h
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp value1
|
|
|
|
|
1998-05-21 15:50:52 +02:00
|
|
|
valreg: call get
|
|
|
|
sub al, '0'
|
1999-08-20 19:15:06 +02:00
|
|
|
cmp al, 4
|
|
|
|
ja ilchar
|
1998-05-21 15:50:52 +02:00
|
|
|
add al, 0d0h
|
|
|
|
mov ah, al
|
|
|
|
call get
|
1998-09-06 18:05:14 +02:00
|
|
|
cmp al, '9'
|
|
|
|
jbe valre1
|
1998-05-21 15:50:52 +02:00
|
|
|
and al, 0dfh
|
|
|
|
cmp al, 'A'
|
1998-09-06 18:05:14 +02:00
|
|
|
jb ilchar
|
1998-05-21 15:50:52 +02:00
|
|
|
add al, '0'+10-'A'
|
|
|
|
valre1: sub al, '0'
|
|
|
|
cmp al, 0fh
|
|
|
|
ja ilchar
|
|
|
|
cmp ah, 0d1h
|
1998-09-14 11:48:16 +02:00
|
|
|
jne value1
|
1998-05-21 15:50:52 +02:00
|
|
|
sub ax, 0f0h
|
1999-03-04 14:04:42 +01:00
|
|
|
jmp value1
|
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
valquo: jopcod rcopco
|
1999-03-04 14:04:42 +01:00
|
|
|
push bx
|
1999-04-17 12:36:00 +02:00
|
|
|
mov [opcosp], sp
|
1999-03-04 14:04:42 +01:00
|
|
|
mov bp, offset var2
|
1999-08-20 19:15:06 +02:00
|
|
|
jmp rdcmd3
|
2000-05-24 10:07:34 +02:00
|
|
|
xopco: mov sp, [opcosp]
|
|
|
|
mov bp, offset var
|
1999-08-20 19:15:06 +02:00
|
|
|
mov ah, al
|
1999-03-04 14:04:42 +01:00
|
|
|
call get
|
|
|
|
cmp al, '}'
|
1999-04-17 12:36:00 +02:00
|
|
|
jne msopco
|
1999-08-20 19:15:06 +02:00
|
|
|
movzx eax, ah
|
1999-03-04 14:04:42 +01:00
|
|
|
pop bx
|
|
|
|
jmp value1
|
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
rcopco: error e_ropco
|
1999-03-04 14:04:42 +01:00
|
|
|
|
1999-04-17 12:36:00 +02:00
|
|
|
msopco: error e_mopco
|
1998-05-10 21:14:44 +02:00
|
|
|
|
|
|
|
value0: dec si
|
1999-03-04 14:04:42 +01:00
|
|
|
test di, di
|
1998-09-14 11:48:16 +02:00
|
|
|
js ilchar
|
|
|
|
lda edx
|
1999-08-29 13:43:20 +02:00
|
|
|
value1: push eax
|
1998-09-14 11:48:16 +02:00
|
|
|
v_par2: dec bh
|
|
|
|
js mbrack
|
1998-05-10 21:14:44 +02:00
|
|
|
lodsb
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp al, ']'
|
|
|
|
je v_par2
|
|
|
|
|
|
|
|
mov ah, [si]
|
|
|
|
mov di, offset opert2
|
|
|
|
mov cx, noper2
|
|
|
|
repne scasw
|
1999-03-04 14:04:42 +01:00
|
|
|
je foper2 ; operator 2-znakowy
|
1998-09-14 11:48:16 +02:00
|
|
|
mov cx, noper1
|
|
|
|
repne scasb
|
1999-03-04 14:04:42 +01:00
|
|
|
je foper1 ; operator 1-znakowy
|
|
|
|
test bh, bh ; koniec wyrazenia
|
|
|
|
jnz mbrack ; musza byc zamkniete nawiasy
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
1998-09-14 11:48:16 +02:00
|
|
|
mov di, offset opert1
|
|
|
|
foper1: sub di, offset opert1
|
|
|
|
jmp goper
|
|
|
|
foper2: inc si
|
|
|
|
sub di, offset opert2
|
|
|
|
shr di, 1
|
|
|
|
add di, noper1
|
1999-08-29 13:43:20 +02:00
|
|
|
goper: call goprpa
|
1998-09-14 11:48:16 +02:00
|
|
|
pop eax
|
|
|
|
v_com: pop cx
|
|
|
|
cmp cx, bx
|
|
|
|
jb v_xcm
|
|
|
|
pop dx
|
1999-08-29 13:43:20 +02:00
|
|
|
cmp dx, offset v_1arg
|
|
|
|
jae v_r1a
|
|
|
|
sta ecx
|
|
|
|
pop eax
|
|
|
|
v_r1a: push offset v_com
|
1998-09-14 11:48:16 +02:00
|
|
|
push dx
|
|
|
|
ret
|
|
|
|
v_xcm: cmp bl, 1
|
|
|
|
jbe v_xit
|
1999-08-29 13:43:20 +02:00
|
|
|
push cx eax di bx
|
1998-09-14 11:48:16 +02:00
|
|
|
jmp v_lop
|
|
|
|
v_xit: mov [dword val], eax
|
|
|
|
cmp [ukp1], 1
|
|
|
|
cmc
|
1999-08-20 19:15:06 +02:00
|
|
|
jc unsret
|
1998-10-25 19:44:40 +01:00
|
|
|
wrange: cmp eax, 10000h
|
1998-09-14 11:48:16 +02:00
|
|
|
cmc
|
1999-08-20 19:15:06 +02:00
|
|
|
jnb unsret
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp eax, -0ffffh
|
|
|
|
jb orange
|
|
|
|
ret
|
|
|
|
|
|
|
|
brange: cmp eax, 100h
|
1999-08-20 19:15:06 +02:00
|
|
|
jb unsret
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp eax, -0ffh
|
|
|
|
jb orange
|
1998-05-10 21:14:44 +02:00
|
|
|
ret
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
spauns: call spaces
|
|
|
|
getuns: call getval
|
1998-09-30 19:23:10 +02:00
|
|
|
pushf
|
|
|
|
jnc getun1
|
|
|
|
jpass1 getun2
|
|
|
|
getun1: test eax, eax
|
|
|
|
js orange
|
|
|
|
getun2: popf
|
|
|
|
unsret: ret
|
|
|
|
|
|
|
|
getpos: call getval
|
|
|
|
jc unknow
|
1998-09-14 11:48:16 +02:00
|
|
|
test eax, eax
|
1998-09-30 19:23:10 +02:00
|
|
|
jg unsret
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
orange: error e_range
|
|
|
|
|
|
|
|
mbrack: error e_brack
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
toobig: error e_nbig
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Procedury operatorow nie moga zmieniac bx ani di
|
|
|
|
|
|
|
|
v_sub: neg ecx ; -
|
|
|
|
v_add: add eax, ecx ; +
|
1998-10-03 15:17:18 +02:00
|
|
|
jno v_ret
|
1998-09-14 11:48:16 +02:00
|
|
|
oflow: error e_over
|
|
|
|
|
|
|
|
div0: error e_div0
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_mul: mov edx, ecx ; *
|
1998-09-14 11:48:16 +02:00
|
|
|
xor ecx, eax
|
|
|
|
imul edx
|
|
|
|
test ecx, ecx
|
|
|
|
js v_mu1
|
|
|
|
test edx, edx
|
|
|
|
jnz oflow
|
|
|
|
test eax, eax
|
|
|
|
js oflow
|
|
|
|
ret
|
|
|
|
v_mu1: inc edx
|
|
|
|
jnz oflow
|
|
|
|
test eax, eax
|
|
|
|
jns oflow
|
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_div: jecxz div0 ; /
|
1998-09-14 11:48:16 +02:00
|
|
|
cdq
|
|
|
|
idiv ecx
|
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_mod: jecxz div0 ; %
|
1998-09-14 11:48:16 +02:00
|
|
|
cdq
|
|
|
|
idiv ecx
|
2001-04-07 11:03:20 +02:00
|
|
|
lda edx
|
1999-08-20 19:15:06 +02:00
|
|
|
ret
|
1998-09-14 11:48:16 +02:00
|
|
|
|
|
|
|
v_sln: neg ecx
|
1999-03-04 14:04:42 +01:00
|
|
|
v_sal: test ecx, ecx ; <<
|
1998-09-14 11:48:16 +02:00
|
|
|
js v_srn
|
|
|
|
jz v_ret
|
|
|
|
cmp ecx, 20h
|
|
|
|
jb v_sl1
|
|
|
|
test eax, eax
|
|
|
|
jnz oflow
|
|
|
|
ret
|
|
|
|
v_sl1: add eax, eax
|
|
|
|
jo oflow
|
|
|
|
loop v_sl1
|
1999-08-20 19:15:06 +02:00
|
|
|
p_skp:
|
|
|
|
v_ret: ret
|
1998-09-14 11:48:16 +02:00
|
|
|
|
|
|
|
v_srn: neg ecx
|
1999-03-04 14:04:42 +01:00
|
|
|
v_sar: test ecx, ecx ; >>
|
1998-09-14 11:48:16 +02:00
|
|
|
js v_sln
|
|
|
|
cmp ecx, 20h
|
|
|
|
jb v_sr1
|
|
|
|
mov cl, 1fh
|
|
|
|
v_sr1: sar eax, cl
|
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_and: and eax, ecx ; &
|
1998-09-14 11:48:16 +02:00
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_or: or eax, ecx ; |
|
1998-09-14 11:48:16 +02:00
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_xor: xor eax, ecx ; ^
|
1998-09-14 11:48:16 +02:00
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_equ: cmp eax, ecx ; =
|
1999-08-29 13:43:20 +02:00
|
|
|
v_eq1: je v_one
|
1998-09-14 11:48:16 +02:00
|
|
|
v_zer: xor eax, eax
|
|
|
|
ret
|
1999-03-04 14:04:42 +01:00
|
|
|
v_one: mov eax, 1
|
1998-09-14 11:48:16 +02:00
|
|
|
ret
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_neq: cmp eax, ecx ; <> !=
|
1998-09-14 11:48:16 +02:00
|
|
|
jne v_one
|
|
|
|
jmp v_zer
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_les: cmp eax, ecx ; <
|
1998-09-14 11:48:16 +02:00
|
|
|
jl v_one
|
|
|
|
jmp v_zer
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_grt: cmp eax, ecx ; >
|
1998-09-14 11:48:16 +02:00
|
|
|
jg v_one
|
|
|
|
jmp v_zer
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_leq: cmp eax, ecx ; <=
|
1998-09-14 11:48:16 +02:00
|
|
|
jle v_one
|
|
|
|
jmp v_zer
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_geq: cmp eax, ecx ; >=
|
1998-09-14 11:48:16 +02:00
|
|
|
jge v_one
|
|
|
|
jmp v_zer
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_anl: jecxz v_zer ; &&
|
1998-09-14 11:48:16 +02:00
|
|
|
test eax, eax
|
|
|
|
jz v_ret
|
|
|
|
jmp v_one
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
v_orl: or eax, ecx ; ||
|
1998-09-14 11:48:16 +02:00
|
|
|
jz v_ret
|
|
|
|
jmp v_one
|
|
|
|
|
1999-08-29 13:43:20 +02:00
|
|
|
; Operatory 1-argumentowe
|
|
|
|
v_1arg:
|
|
|
|
v_neg: neg eax
|
|
|
|
v_plu: ret
|
|
|
|
|
|
|
|
v_low: movzx eax, al
|
|
|
|
ret
|
|
|
|
|
|
|
|
v_hig: movzx eax, ah
|
|
|
|
ret
|
|
|
|
|
|
|
|
v_nol: test eax, eax
|
|
|
|
jmp v_eq1
|
|
|
|
|
|
|
|
v_not: not eax
|
|
|
|
ret
|
|
|
|
|
|
|
|
goprpa: lea ax, [di+operpa]
|
|
|
|
add di, di
|
|
|
|
add di, ax
|
|
|
|
mov bl, [di]
|
|
|
|
mov di, [di+1]
|
|
|
|
ret
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
onemod: jnopcod getadr
|
|
|
|
cmp [byte si], '}'
|
|
|
|
jne getadr
|
|
|
|
jmp xopco
|
|
|
|
|
|
|
|
getaim: jnopcod getai0
|
|
|
|
cmp [byte si], '}'
|
|
|
|
je getai2
|
|
|
|
getai0: cmp al, '<'
|
|
|
|
pushf
|
|
|
|
call getval
|
|
|
|
popf
|
|
|
|
jb getai2
|
|
|
|
je getai1
|
|
|
|
mov al, ah
|
|
|
|
getai1: movzx eax, al
|
|
|
|
mov [dword val], eax
|
|
|
|
getai2: mov dx, 1
|
|
|
|
jmp getadx
|
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Pobierz operand rozkazu i rozpoznaj tryb adresowania
|
1998-05-10 21:14:44 +02:00
|
|
|
getadr: call spaces
|
|
|
|
lodsb
|
1998-09-06 18:05:14 +02:00
|
|
|
xor dx, dx
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '@'
|
|
|
|
je getadx
|
|
|
|
cmp al, '#'
|
1998-09-14 11:48:16 +02:00
|
|
|
je getaim
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '<'
|
1998-09-14 11:48:16 +02:00
|
|
|
je getaim
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, '>'
|
1998-09-14 11:48:16 +02:00
|
|
|
je getaim
|
1998-05-10 21:14:44 +02:00
|
|
|
mov dl, 8
|
|
|
|
cmp al, '('
|
2000-05-24 10:07:34 +02:00
|
|
|
je getao1
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
1998-05-22 18:27:22 +02:00
|
|
|
lodsw
|
|
|
|
and al, 0dfh
|
1998-09-06 18:05:14 +02:00
|
|
|
mov dl, 2
|
1998-05-22 18:27:22 +02:00
|
|
|
cmp ax, ':A'
|
2000-05-24 10:07:34 +02:00
|
|
|
je getao2
|
1998-09-06 18:05:14 +02:00
|
|
|
inc dx
|
|
|
|
cmp ax, ':Z'
|
2000-05-24 10:07:34 +02:00
|
|
|
je getao2
|
1998-05-22 18:27:22 +02:00
|
|
|
dec si
|
|
|
|
dec si
|
1998-09-06 18:05:14 +02:00
|
|
|
xor dx, dx
|
2000-05-24 10:07:34 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
getad1: push dx
|
1998-09-14 11:48:16 +02:00
|
|
|
call getuns
|
1998-05-10 21:14:44 +02:00
|
|
|
sbb al, al
|
1998-09-06 18:05:14 +02:00
|
|
|
jnz getad2
|
|
|
|
mov al, [byte high val]
|
1998-05-22 18:27:22 +02:00
|
|
|
getad2: pop dx
|
2000-05-24 10:07:34 +02:00
|
|
|
getad9: cmp dl, 8
|
1998-09-06 18:05:14 +02:00
|
|
|
jae getaid
|
1998-09-14 11:48:16 +02:00
|
|
|
cmp dl, 2
|
|
|
|
jae getad3
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 1
|
1998-09-06 18:05:14 +02:00
|
|
|
adc dl, 2
|
|
|
|
getad3: lodsw
|
1998-05-10 21:14:44 +02:00
|
|
|
and ah, 0dfh
|
1998-09-06 18:05:14 +02:00
|
|
|
mov bl, 2
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp ax, 'X,'
|
1998-09-06 18:05:14 +02:00
|
|
|
je getabi
|
|
|
|
mov bl, 4
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp ax, 'Y,'
|
1998-09-06 18:05:14 +02:00
|
|
|
je getabi
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
|
|
|
dec si
|
|
|
|
jmp getadx
|
1998-09-06 18:05:14 +02:00
|
|
|
getabi: add dl, bl
|
|
|
|
getaxt: lodsb
|
|
|
|
cmp al, '+'
|
|
|
|
je getabx
|
|
|
|
inc bx
|
|
|
|
cmp al, '-'
|
|
|
|
je getabx
|
|
|
|
dec si
|
|
|
|
jmp getadx
|
|
|
|
getabx: mov dh, bl
|
|
|
|
getadx: lda dx
|
|
|
|
mov [word amod], ax
|
|
|
|
ret
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
getao1: jnopcod getad1
|
|
|
|
cmp [byte si], ')'
|
|
|
|
je getaid
|
|
|
|
getao2: jnopcod getad1
|
|
|
|
cmp [byte si], ','
|
|
|
|
je getad9
|
|
|
|
cmp [byte si], '}'
|
|
|
|
je getad9
|
|
|
|
jmp getad1
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
getaid: lodsb
|
|
|
|
cmp al, ','
|
|
|
|
je getaix
|
1999-08-29 13:43:20 +02:00
|
|
|
call chkpar
|
1998-05-10 21:14:44 +02:00
|
|
|
lodsw
|
1999-08-20 19:15:06 +02:00
|
|
|
mov dx, 1009h
|
|
|
|
mov bl, 14h
|
1998-09-06 18:05:14 +02:00
|
|
|
cmp ax, '0,'
|
1999-08-20 19:15:06 +02:00
|
|
|
je getaxt
|
1998-09-06 18:05:14 +02:00
|
|
|
xor dh, dh
|
|
|
|
mov bl, 4
|
1998-05-10 21:14:44 +02:00
|
|
|
and ah, 0dfh
|
|
|
|
cmp ax, 'Y,'
|
1998-09-06 18:05:14 +02:00
|
|
|
je getaxt
|
|
|
|
inc dx
|
1998-05-10 21:14:44 +02:00
|
|
|
dec si
|
|
|
|
dec si
|
|
|
|
jmp getadx
|
|
|
|
getaix: lodsw
|
1999-08-20 19:15:06 +02:00
|
|
|
mov dh, 8
|
1998-09-06 18:05:14 +02:00
|
|
|
cmp ax, ')0'
|
|
|
|
je getadx
|
|
|
|
xor dh, dh
|
1998-05-10 21:14:44 +02:00
|
|
|
and al, 0dfh
|
|
|
|
cmp ax, ')X'
|
1998-09-06 18:05:14 +02:00
|
|
|
je getadx
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp ilchar
|
|
|
|
|
|
|
|
p_imp = savbyt
|
|
|
|
|
1998-05-21 15:50:52 +02:00
|
|
|
p_ads: call getadr
|
|
|
|
mov al, [cod]
|
|
|
|
call savbyt
|
|
|
|
mov al, 60h
|
|
|
|
cmp [cod], 18h
|
|
|
|
je p_as1
|
|
|
|
mov al, 0e0h
|
|
|
|
p_as1: mov [cod], al
|
|
|
|
jmp p_ac1
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
p_acc: call getadr
|
1998-09-06 18:05:14 +02:00
|
|
|
p_ac1: mov ax, [word amod]
|
|
|
|
cmp al, 7
|
1998-05-10 21:14:44 +02:00
|
|
|
jne acc1
|
1998-09-06 18:05:14 +02:00
|
|
|
dec [amod]
|
1999-08-20 19:15:06 +02:00
|
|
|
acc1: cmp ah, 8
|
1998-09-06 18:05:14 +02:00
|
|
|
jb acc3
|
|
|
|
mov ax, 0a2h
|
|
|
|
je acc2
|
|
|
|
mov al, 0a0h
|
|
|
|
acc2: call savwor
|
|
|
|
acc3: mov al, [amod]
|
|
|
|
mov bx, offset acctab
|
1998-05-10 21:14:44 +02:00
|
|
|
xlat
|
|
|
|
test al, al
|
|
|
|
jz ilamod
|
|
|
|
or al, [cod]
|
2000-05-24 10:07:34 +02:00
|
|
|
cmp al, 89h ; sta #
|
1998-09-06 18:05:14 +02:00
|
|
|
jne putsfx
|
|
|
|
ilamod: error e_amod
|
1998-05-10 21:14:44 +02:00
|
|
|
|
|
|
|
p_srt: call getadr
|
|
|
|
cmp al, 6
|
|
|
|
jnb ilamod
|
|
|
|
cmp al, 1
|
|
|
|
je ilamod
|
|
|
|
mov bx, offset srttab
|
|
|
|
xlat
|
|
|
|
or al, [cod]
|
|
|
|
cmp al, 0c0h
|
|
|
|
je ilamod
|
|
|
|
cmp al, 0e0h
|
|
|
|
je ilamod
|
1998-09-06 18:05:14 +02:00
|
|
|
putsfx: call putcmd
|
|
|
|
mov al, [amod+1]
|
1999-08-20 19:15:06 +02:00
|
|
|
and al, 7
|
1998-09-06 18:05:14 +02:00
|
|
|
mov bx, offset sfxtab
|
|
|
|
xlat
|
|
|
|
test al, al
|
|
|
|
jnz savbyt
|
|
|
|
putret: ret
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-05-22 18:27:22 +02:00
|
|
|
p_inw: call getadr
|
|
|
|
cmp al, 6
|
|
|
|
jnb ilamod
|
|
|
|
sub al, 2
|
|
|
|
jb ilamod
|
|
|
|
mov bx, offset inwtab
|
|
|
|
xlat
|
|
|
|
push ax
|
|
|
|
call putcmd
|
|
|
|
inc [val]
|
|
|
|
mov ax, 03d0h
|
|
|
|
test [amod], 1
|
|
|
|
jz p_iw1
|
|
|
|
dec ah
|
|
|
|
p_iw1: call savwor
|
|
|
|
pop ax
|
1998-09-06 18:05:14 +02:00
|
|
|
jmp putsfx
|
1998-05-22 18:27:22 +02:00
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
p_ldi: call getadr
|
1998-09-06 18:05:14 +02:00
|
|
|
p_ld1: mov al, [amod]
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 1
|
|
|
|
jb ilamod
|
|
|
|
cmp al, 4
|
|
|
|
jb ldi1
|
|
|
|
and al, 0feh
|
|
|
|
xor al, [cod]
|
|
|
|
cmp al, 0a4h
|
|
|
|
jne ilamod
|
|
|
|
mov al, [amod]
|
|
|
|
ldi1: mov bx, offset lditab
|
|
|
|
xlat
|
|
|
|
putcod: or al, [cod]
|
1998-09-06 18:05:14 +02:00
|
|
|
jmp putsfx
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
putcmd: call savbyt
|
|
|
|
mov al, [amod]
|
|
|
|
mov bx, offset lentab
|
|
|
|
xlat
|
|
|
|
cmp al, 2
|
|
|
|
jb putret
|
1998-09-14 11:48:16 +02:00
|
|
|
mov eax, [dword val]
|
1998-05-10 21:14:44 +02:00
|
|
|
jne savwor
|
1998-09-06 18:05:14 +02:00
|
|
|
jpass1 putcm1
|
1998-09-14 11:48:16 +02:00
|
|
|
call brange
|
1998-05-10 21:14:44 +02:00
|
|
|
putcm1: jmp savbyt
|
|
|
|
|
|
|
|
p_sti: call getadr
|
1998-09-06 18:05:14 +02:00
|
|
|
p_st1: mov al, [amod]
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 2
|
|
|
|
jb ilamod
|
1998-09-06 18:05:14 +02:00
|
|
|
je cod8
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 3
|
|
|
|
je cod0
|
|
|
|
and al, 0feh
|
|
|
|
xor al, [cod]
|
|
|
|
cmp al, 80h
|
|
|
|
jne ilamod
|
|
|
|
or [amod], 1
|
|
|
|
mov al, 10h
|
|
|
|
jmp putcod
|
|
|
|
cod8: mov al, 8
|
|
|
|
jmp putcod
|
|
|
|
cod0: xor al, al
|
|
|
|
jmp putcod
|
|
|
|
|
|
|
|
p_cpi: call getadr
|
|
|
|
cmp al, 1
|
|
|
|
jb ilamod
|
|
|
|
cmp al, 4
|
|
|
|
jnb ilamod
|
|
|
|
cmp al, 2
|
|
|
|
jb cod0
|
1999-08-20 19:15:06 +02:00
|
|
|
mov al, 0ch
|
|
|
|
je putcod
|
1998-05-10 21:14:44 +02:00
|
|
|
mov al, 4
|
|
|
|
jmp putcod
|
|
|
|
|
2000-08-05 23:12:46 +02:00
|
|
|
p_rep:
|
|
|
|
mov ax, [origin]
|
|
|
|
xchg ax, [reporg]
|
|
|
|
jmp bra0
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
p_bra: call onemod
|
1999-08-20 19:15:06 +02:00
|
|
|
and al, 0feh
|
|
|
|
cmp al, 2
|
|
|
|
jne ilamod
|
1998-05-10 21:14:44 +02:00
|
|
|
mov ax, [val]
|
1999-08-20 19:15:06 +02:00
|
|
|
bra0: jpass1 bra1
|
|
|
|
call chorg
|
1998-05-10 21:14:44 +02:00
|
|
|
sub ax, [origin]
|
|
|
|
add ax, 7eh
|
1999-08-20 19:15:06 +02:00
|
|
|
call calcbr
|
1998-05-10 21:14:44 +02:00
|
|
|
mov [byte val], al
|
1999-03-04 14:04:42 +01:00
|
|
|
bra1: mov al, [cod]
|
|
|
|
call savbyt
|
1998-05-10 21:14:44 +02:00
|
|
|
mov al, [byte val]
|
|
|
|
jmp savbyt
|
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
calcbr: test ah, ah
|
|
|
|
jnz toofar
|
|
|
|
add al, 80h
|
|
|
|
ret
|
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
toofar: cmp ax, 8080h
|
|
|
|
jae toofa1
|
|
|
|
sub ax, 0ffh
|
|
|
|
neg ax
|
|
|
|
toofa1: neg ax
|
1998-09-14 11:48:16 +02:00
|
|
|
mov di, offset brout
|
1998-09-06 18:05:14 +02:00
|
|
|
call phword
|
|
|
|
error e_bra
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
p_jsr: call onemod
|
1998-05-10 21:14:44 +02:00
|
|
|
mov al, 20h
|
1998-05-21 15:50:52 +02:00
|
|
|
jmp p_abs
|
1998-05-10 21:14:44 +02:00
|
|
|
|
|
|
|
p_bit: call getadr
|
|
|
|
cmp al, 2
|
|
|
|
mov al, 2ch
|
|
|
|
je putcmd
|
|
|
|
cmp [amod], 3
|
|
|
|
jne ilamod
|
|
|
|
mov al, 24h
|
|
|
|
jmp putcmd
|
|
|
|
|
1998-05-21 15:50:52 +02:00
|
|
|
p_juc: call getadr
|
|
|
|
mov al, [cod]
|
|
|
|
mov ah, 3
|
|
|
|
call savwor
|
|
|
|
jmp p_jp1
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
p_jmp: call getadr
|
1998-09-06 18:05:14 +02:00
|
|
|
p_jp1: cmp [amod], 10
|
|
|
|
je chkbug
|
|
|
|
jpass1 p_jpu
|
|
|
|
cmp [cod], 4ch
|
|
|
|
je p_jpu
|
1999-08-20 19:15:06 +02:00
|
|
|
testfl m_norg ; nieznany * (przy OPT H-)
|
|
|
|
jnz p_jpu
|
|
|
|
mov ax, [val] ; moze branch wystarczy?
|
1998-09-06 18:05:14 +02:00
|
|
|
sub ax, [origin]
|
|
|
|
add ax, 80h
|
|
|
|
test ah, ah
|
|
|
|
jnz p_jpu
|
|
|
|
push si
|
|
|
|
push offset w_bras
|
|
|
|
call warln
|
|
|
|
pop si
|
|
|
|
p_jpu: mov al, 4ch
|
1998-05-21 15:50:52 +02:00
|
|
|
p_abs: and [amod], 0feh
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp [amod], 2
|
1998-09-06 18:05:14 +02:00
|
|
|
je p_jpp
|
|
|
|
jmp ilamod
|
|
|
|
chkbug: jpass1 p_jid
|
|
|
|
cmp [byte val], 0ffh
|
|
|
|
jne p_jid
|
|
|
|
push si
|
|
|
|
push offset w_bugjp
|
|
|
|
call warln
|
|
|
|
pop si
|
|
|
|
p_jid: mov al, 6ch
|
|
|
|
p_jpp: jmp putcmd
|
|
|
|
|
|
|
|
getops: call getadr
|
1999-03-04 14:04:42 +01:00
|
|
|
lea di, [op1]
|
1998-09-06 18:05:14 +02:00
|
|
|
call stop
|
|
|
|
push [word ukp1]
|
|
|
|
call getadr
|
|
|
|
pop [word ukp1]
|
|
|
|
mov [tempsi], si
|
1999-03-04 14:04:42 +01:00
|
|
|
lea di, [op2]
|
1998-09-06 18:05:14 +02:00
|
|
|
call stop
|
|
|
|
movzx bx, [cod]
|
|
|
|
add bx, offset movtab
|
1999-03-04 14:04:42 +01:00
|
|
|
ldop1: lea si, [op1]
|
1998-09-14 11:48:16 +02:00
|
|
|
ldop: lodsd
|
|
|
|
mov [dword val], eax
|
1998-09-06 18:05:14 +02:00
|
|
|
lodsw
|
|
|
|
mov [word amod], ax
|
|
|
|
ret
|
1998-09-14 11:48:16 +02:00
|
|
|
stop: mov eax, [dword val]
|
|
|
|
stosd
|
1998-09-06 18:05:14 +02:00
|
|
|
mov ax, [word amod]
|
|
|
|
stosw
|
|
|
|
ret
|
|
|
|
|
2001-04-12 22:58:12 +02:00
|
|
|
mcall1: mov al, [(movt bx).m_lcod]
|
1998-09-06 18:05:14 +02:00
|
|
|
mov [cod], al
|
|
|
|
push bx
|
2001-04-12 22:58:12 +02:00
|
|
|
call [(movt bx).m_lvec]
|
1998-09-06 18:05:14 +02:00
|
|
|
pop bx
|
|
|
|
ret
|
|
|
|
|
2001-04-12 22:58:12 +02:00
|
|
|
mcall2: mov al, [(movt bx).m_scod]
|
1998-09-06 18:05:14 +02:00
|
|
|
mov [cod], al
|
|
|
|
push bx
|
2001-04-12 22:58:12 +02:00
|
|
|
call [(movt bx).m_svec]
|
1998-09-06 18:05:14 +02:00
|
|
|
pop bx
|
|
|
|
ret
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
p_mvs: call getops
|
|
|
|
call mcall1
|
1999-03-04 14:04:42 +01:00
|
|
|
lea si, [op2]
|
1998-09-06 18:05:14 +02:00
|
|
|
call ldop
|
|
|
|
p_mvx: call mcall2
|
|
|
|
mov si, [tempsi]
|
|
|
|
ret
|
|
|
|
|
|
|
|
p_mws: call getops
|
|
|
|
mov ax, [word amod]
|
|
|
|
cmp ax, 8
|
|
|
|
jae ilamod
|
|
|
|
cmp al, 1
|
|
|
|
jne p_mw1
|
2002-04-06 20:51:52 +02:00
|
|
|
and [dword val], 0ffh
|
1998-09-06 18:05:14 +02:00
|
|
|
p_mw1: call mcall1
|
1999-03-04 14:04:42 +01:00
|
|
|
lea si, [op2]
|
1998-09-06 18:05:14 +02:00
|
|
|
call ldop
|
|
|
|
cmp [word amod], 8
|
|
|
|
jae ilamod
|
|
|
|
call mcall2
|
|
|
|
call ldop1
|
|
|
|
cmp [amod], 1
|
|
|
|
je p_mwi
|
|
|
|
inc [val]
|
|
|
|
jmp p_mw2
|
2001-04-12 22:58:12 +02:00
|
|
|
p_mwi:
|
|
|
|
cmp [ukp1], 0
|
1998-09-06 18:05:14 +02:00
|
|
|
jnz p_mwh
|
2001-04-12 22:58:12 +02:00
|
|
|
mov dx, [val]
|
|
|
|
cmp dl, dh
|
1998-09-06 18:05:14 +02:00
|
|
|
je p_mw3
|
2001-04-12 22:58:12 +02:00
|
|
|
dec dh
|
|
|
|
mov al, [(movt bx).m_inc]
|
|
|
|
cmp dl, dh
|
|
|
|
je p_mw4
|
|
|
|
add dh, 2
|
|
|
|
cmp dl, dh
|
|
|
|
jne p_mwh
|
|
|
|
mov al, [(movt bx).m_dec]
|
|
|
|
p_mw4: test al, al
|
|
|
|
jz p_mwh
|
|
|
|
call savbyt
|
|
|
|
jmp p_mw3
|
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
p_mwh: sar [dword val], 8
|
1998-09-06 18:05:14 +02:00
|
|
|
p_mw2: call mcall1
|
1999-03-04 14:04:42 +01:00
|
|
|
p_mw3: lea si, [op2]
|
1998-09-06 18:05:14 +02:00
|
|
|
call ldop
|
|
|
|
inc [val]
|
|
|
|
jmp p_mvx
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
p_opt: call spaces
|
2000-05-24 10:07:34 +02:00
|
|
|
xor dx, dx
|
|
|
|
jmp opt0
|
|
|
|
opt1: shr cx, 1
|
|
|
|
bts dx, cx
|
|
|
|
jc opter
|
|
|
|
call [word di-2+optvec-opttxt]
|
1999-08-20 19:15:06 +02:00
|
|
|
opt0: lodsw
|
1998-09-23 16:48:58 +02:00
|
|
|
and al, 0dfh
|
2000-05-24 10:07:34 +02:00
|
|
|
mov cx, 6
|
|
|
|
mov di, offset opttxt
|
|
|
|
repne scasw
|
|
|
|
je opt1
|
|
|
|
test dx, dx
|
|
|
|
jz opter
|
1998-09-23 16:48:58 +02:00
|
|
|
dec si
|
|
|
|
dec si
|
|
|
|
ret
|
2000-05-24 10:07:34 +02:00
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
opter: error e_opt
|
2000-05-24 10:07:34 +02:00
|
|
|
|
|
|
|
optl0: or [flist], m_lsto
|
|
|
|
ret
|
|
|
|
optl1: jpass1 optr
|
1998-09-23 16:48:58 +02:00
|
|
|
and [flist], not m_lsto
|
2000-05-24 10:07:34 +02:00
|
|
|
optr: ret
|
|
|
|
opth0: resfl m_hdr+m_rqff
|
|
|
|
ret
|
1999-08-20 19:15:06 +02:00
|
|
|
opth1: bts [flags], b_hdr
|
2000-05-24 10:07:34 +02:00
|
|
|
jc optr
|
1999-08-20 19:15:06 +02:00
|
|
|
setfl m_rorg
|
2000-05-24 10:07:34 +02:00
|
|
|
ret
|
|
|
|
opto0: resfl m_wobj
|
|
|
|
ret
|
|
|
|
opto1: setfl m_wobj
|
|
|
|
ret
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
p_ert: call spaval
|
|
|
|
jpass1 equret
|
|
|
|
test eax, eax
|
|
|
|
jz equret
|
|
|
|
error e_user
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
p_equ: mov di, [labvec]
|
1998-09-14 11:48:16 +02:00
|
|
|
test di, di
|
2000-05-24 10:07:34 +02:00
|
|
|
jz nolabd
|
1999-03-04 14:04:42 +01:00
|
|
|
mov [(lab di).l_val], 0
|
1998-09-14 11:48:16 +02:00
|
|
|
and [(lab di).flags], not m_sign
|
|
|
|
call spaval
|
1998-05-10 21:14:44 +02:00
|
|
|
mov di, [labvec]
|
1998-08-31 13:00:16 +02:00
|
|
|
jnc equ1
|
1998-09-14 11:48:16 +02:00
|
|
|
or [(lab di).flags], m_ukp1
|
1999-03-04 14:04:42 +01:00
|
|
|
equ1: mov [(lab di).l_val], ax
|
1998-09-14 11:48:16 +02:00
|
|
|
test eax, eax
|
1998-09-23 16:48:58 +02:00
|
|
|
jns equ2
|
1998-09-14 11:48:16 +02:00
|
|
|
or [(lab di).flags], m_sign
|
1998-09-23 16:48:58 +02:00
|
|
|
equ2: test [flist], m_lsts
|
|
|
|
jnz equret
|
|
|
|
sta dx
|
|
|
|
mov di, offset lstorg
|
|
|
|
mov ax, ' ='
|
|
|
|
test eax, eax
|
|
|
|
jns equ3
|
|
|
|
mov ah, '-'
|
|
|
|
neg dx
|
|
|
|
equ3: stosw
|
|
|
|
lda dx
|
|
|
|
call phword
|
|
|
|
mov [lstidx], di
|
1998-05-10 21:14:44 +02:00
|
|
|
equret: ret
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
nolabd: error e_label
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-08-20 19:15:06 +02:00
|
|
|
chkhon: testfl m_hdr
|
1998-10-04 19:27:10 +02:00
|
|
|
jnz equret
|
|
|
|
error e_hoff
|
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
p_org: call spaces
|
|
|
|
lodsw
|
|
|
|
and al, 0dfh
|
|
|
|
cmp ax, ':F'
|
|
|
|
je orgff
|
|
|
|
cmp ax, ':A'
|
|
|
|
je orgaf
|
|
|
|
dec si
|
|
|
|
dec si
|
|
|
|
jmp orget
|
1999-08-20 19:15:06 +02:00
|
|
|
orgff: setfl m_rqff
|
|
|
|
orgaf: setfl m_rorg
|
1998-10-04 19:27:10 +02:00
|
|
|
call chkhon
|
1998-09-23 16:48:58 +02:00
|
|
|
orget: call getuns
|
1998-05-10 21:14:44 +02:00
|
|
|
jc unknow
|
1999-08-20 19:15:06 +02:00
|
|
|
setorg: resfl m_norg
|
1998-05-10 21:14:44 +02:00
|
|
|
mov [origin], ax
|
|
|
|
ret
|
|
|
|
|
1998-10-04 19:27:10 +02:00
|
|
|
p_rui: call chkhon
|
|
|
|
mov ah, 2
|
1999-08-20 19:15:06 +02:00
|
|
|
call setorg
|
1998-09-14 11:48:16 +02:00
|
|
|
call spauns
|
1998-05-22 18:27:22 +02:00
|
|
|
jmp savwor
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
valuco: call getval
|
1998-05-21 15:50:52 +02:00
|
|
|
jc unknow
|
|
|
|
call get
|
|
|
|
cmp al, ','
|
|
|
|
jne badsin
|
|
|
|
mov ax, [val]
|
|
|
|
ret
|
1998-09-06 18:05:14 +02:00
|
|
|
badsin: error e_sin
|
1998-05-21 15:50:52 +02:00
|
|
|
|
1999-08-29 13:43:20 +02:00
|
|
|
dtan0: cmp al, 'A'
|
1998-05-10 21:14:44 +02:00
|
|
|
je dtan1
|
|
|
|
cmp al, 'B'
|
|
|
|
je dtan1
|
|
|
|
cmp al, 'L'
|
|
|
|
je dtan1
|
|
|
|
cmp al, 'H'
|
|
|
|
je dtan1
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, 'R'
|
1999-08-29 13:43:20 +02:00
|
|
|
jne dtab1
|
|
|
|
jmp dtar1
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-08-29 13:43:20 +02:00
|
|
|
dtat0: cmp al, 'C'
|
|
|
|
je dtat1j
|
|
|
|
cmp al, 'D'
|
|
|
|
jne dtab1
|
|
|
|
dtat1j: dec si
|
2000-05-24 10:07:34 +02:00
|
|
|
mov [cod], al
|
1999-08-29 13:43:20 +02:00
|
|
|
jmp dtat1
|
|
|
|
|
|
|
|
p_dta: call spaces
|
|
|
|
dta1: lodsw
|
|
|
|
and al, 0dfh
|
|
|
|
cmp ah, '('
|
|
|
|
je dtan0
|
|
|
|
cmp ah, "'"
|
|
|
|
je dtat0
|
|
|
|
cmp ah, '"'
|
|
|
|
je dtat0
|
|
|
|
dtab1: dec si
|
|
|
|
dec si
|
|
|
|
mov al, ' '
|
|
|
|
dtan1: mov [cod], al
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-05-21 15:50:52 +02:00
|
|
|
dtan2: lodsd
|
|
|
|
and eax, 0ffdfdfdfh
|
|
|
|
cmp eax, '(NIS'
|
|
|
|
jne dtansi
|
|
|
|
call valuco
|
1998-10-25 19:44:40 +01:00
|
|
|
mov [sinadd], eax
|
1998-05-21 15:50:52 +02:00
|
|
|
call valuco
|
1998-10-25 19:44:40 +01:00
|
|
|
mov [sinamp], eax
|
1998-09-30 19:23:10 +02:00
|
|
|
call getpos
|
1998-05-21 15:50:52 +02:00
|
|
|
mov [sinsiz], ax
|
|
|
|
mov [sinmin], 0
|
|
|
|
dec ax
|
|
|
|
mov [sinmax], ax
|
|
|
|
call get
|
|
|
|
cmp al, ')'
|
|
|
|
je presin
|
|
|
|
cmp al, ','
|
|
|
|
jne badsin
|
|
|
|
call valuco
|
1998-09-14 11:48:16 +02:00
|
|
|
test eax, eax
|
1998-05-21 15:50:52 +02:00
|
|
|
js badsin
|
|
|
|
mov [sinmin], ax
|
1998-09-14 11:48:16 +02:00
|
|
|
call getuns
|
1998-05-21 15:50:52 +02:00
|
|
|
jc unknow
|
|
|
|
cmp ax, [sinmin]
|
|
|
|
jb badsin
|
|
|
|
mov [sinmax], ax
|
|
|
|
lodsb
|
1999-08-29 13:43:20 +02:00
|
|
|
call chkpar
|
1998-05-21 15:50:52 +02:00
|
|
|
presin: finit
|
|
|
|
fldpi
|
|
|
|
fld st
|
|
|
|
faddp st(1), st
|
1998-08-25 16:47:04 +02:00
|
|
|
fidiv [sinsiz]
|
1998-05-21 15:50:52 +02:00
|
|
|
gensin: fild [sinmin]
|
|
|
|
fmul st, st(1)
|
|
|
|
fsin
|
1998-08-25 16:47:04 +02:00
|
|
|
fimul [sinamp]
|
1998-10-25 19:44:40 +01:00
|
|
|
fiadd [sinadd]
|
|
|
|
fistp [dword val]
|
1998-09-06 18:05:14 +02:00
|
|
|
inc [sinmin]
|
1998-10-25 19:44:40 +01:00
|
|
|
mov eax, [dword val]
|
|
|
|
call wrange
|
1998-05-21 15:50:52 +02:00
|
|
|
jmp dtasto
|
|
|
|
|
|
|
|
dtansi: sub si, 4
|
1998-09-14 11:48:16 +02:00
|
|
|
call getval
|
1998-09-23 16:48:58 +02:00
|
|
|
dtasto: mov al, [cod]
|
|
|
|
cmp al, 'A'
|
|
|
|
je dtana
|
|
|
|
jpass1 dtans
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, 'L'
|
|
|
|
je dtanl
|
|
|
|
cmp al, 'H'
|
|
|
|
je dtanh
|
1998-09-23 16:48:58 +02:00
|
|
|
mov eax, [dword val]
|
1998-09-14 11:48:16 +02:00
|
|
|
call brange
|
|
|
|
jmp dtans
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
dtana: mov ax, [val]
|
|
|
|
call savwor
|
|
|
|
jmp dtanx
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
dtanl: mov al, [byte low val]
|
|
|
|
jmp dtans
|
|
|
|
|
|
|
|
dtanh: mov al, [byte high val]
|
|
|
|
|
|
|
|
dtans: call savbyt
|
1998-05-21 15:50:52 +02:00
|
|
|
dtanx: mov ax, [sinmin]
|
|
|
|
cmp ax, [sinmax]
|
|
|
|
jbe gensin
|
1999-08-29 13:43:20 +02:00
|
|
|
cmp [cod], ' '
|
|
|
|
je dtanxt
|
1998-05-21 15:50:52 +02:00
|
|
|
lodsb
|
1998-05-10 21:14:44 +02:00
|
|
|
cmp al, ','
|
|
|
|
je dtan2
|
1999-08-29 13:43:20 +02:00
|
|
|
dtanp: push offset dtanxt
|
|
|
|
chkpar: cmp al, ')'
|
|
|
|
je paret
|
|
|
|
error e_paren
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-06 18:05:14 +02:00
|
|
|
unknow: error e_uknow
|
1998-05-10 21:14:44 +02:00
|
|
|
|
|
|
|
dtat1: mov di, offset tlabel
|
|
|
|
call rstr
|
|
|
|
lodsb
|
|
|
|
mov ah, 80h
|
|
|
|
cmp al, '*'
|
|
|
|
je dtat2
|
|
|
|
dec si
|
|
|
|
xor ah, ah
|
|
|
|
dtat2: push si
|
1998-05-22 18:27:22 +02:00
|
|
|
mov si, dx
|
1998-05-10 21:14:44 +02:00
|
|
|
dtatm: lodsb
|
|
|
|
xor al, ah
|
|
|
|
cmp [cod], 'D'
|
|
|
|
jne ascinx
|
|
|
|
mov dl, 60h
|
|
|
|
and dl, al
|
|
|
|
jz ascin1
|
|
|
|
cmp dl, 60h
|
|
|
|
je ascinx
|
|
|
|
sub al, 60h
|
|
|
|
ascin1: add al, 40h
|
1998-09-23 16:48:58 +02:00
|
|
|
ascinx: push ax cx
|
1998-05-10 21:14:44 +02:00
|
|
|
call savbyt
|
1998-09-23 16:48:58 +02:00
|
|
|
pop cx ax
|
1998-05-10 21:14:44 +02:00
|
|
|
loop dtatm
|
|
|
|
pop si
|
|
|
|
dtanxt: lodsb
|
|
|
|
cmp al, ','
|
|
|
|
je dta1
|
|
|
|
dec si
|
1999-08-29 13:43:20 +02:00
|
|
|
paret: ret
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1999-03-04 14:04:42 +01:00
|
|
|
; Zapisz liczbe rzeczywista
|
1999-08-29 13:43:20 +02:00
|
|
|
dtar1:
|
1998-09-16 10:39:58 +02:00
|
|
|
dtar2: xor bx, bx
|
|
|
|
xor edx, edx
|
|
|
|
xor cx, cx
|
|
|
|
call getsgn
|
|
|
|
dreal1: call getdig
|
|
|
|
jnc dreal2
|
|
|
|
cmp al, '.'
|
|
|
|
je drealp
|
|
|
|
test bh, bh
|
|
|
|
jnz drealz
|
2000-05-24 10:07:34 +02:00
|
|
|
ilchar: error e_char
|
1998-09-16 10:39:58 +02:00
|
|
|
dreal2: mov bh, 1
|
|
|
|
test al, al
|
|
|
|
jz dreal1
|
|
|
|
dec cx
|
|
|
|
dreal3: inc cx
|
|
|
|
call putdig
|
|
|
|
call getdig
|
|
|
|
jnc dreal3
|
|
|
|
cmp al, '.'
|
|
|
|
je drealp
|
1999-08-29 13:43:20 +02:00
|
|
|
jmp dreale
|
|
|
|
dreal5: test edx, edx
|
|
|
|
jnz dreal9
|
|
|
|
test bl, bl
|
|
|
|
jnz dreal9
|
|
|
|
dec cx
|
|
|
|
dreal9: call putdig
|
|
|
|
drealp: call getdig
|
|
|
|
jnc dreal5
|
|
|
|
dreale: and al, 0dfh
|
1998-09-16 10:39:58 +02:00
|
|
|
cmp al, 'E'
|
|
|
|
jne drealf
|
1999-08-29 13:43:20 +02:00
|
|
|
call getsgn
|
1998-09-16 10:39:58 +02:00
|
|
|
call getdig
|
|
|
|
jc ilchar
|
|
|
|
mov ah, al
|
|
|
|
call getdig
|
|
|
|
jnc dreal4
|
|
|
|
shr ax, 8
|
1999-08-29 13:43:20 +02:00
|
|
|
dec si
|
|
|
|
dreal4: inc si
|
|
|
|
aad
|
1998-09-16 10:39:58 +02:00
|
|
|
add di, di
|
|
|
|
jnc drealn
|
|
|
|
neg ax
|
|
|
|
drealn: add cx, ax
|
|
|
|
drealf: test edx, edx
|
|
|
|
jnz drealx
|
|
|
|
test bl, bl
|
|
|
|
jnz drealx
|
|
|
|
drealz: xor ax, ax
|
|
|
|
xor edx, edx
|
|
|
|
jmp dreals
|
|
|
|
drealx: add cx, 80h
|
|
|
|
cmp cx, 20h
|
|
|
|
js drealz
|
|
|
|
cmp cx, 0e2h
|
|
|
|
jnb toobig
|
|
|
|
add di, di
|
|
|
|
rcr cl, 1
|
|
|
|
mov al, 10h
|
|
|
|
jc dreal7
|
|
|
|
cmp bl, al
|
|
|
|
mov al, 1
|
|
|
|
jb dreal7
|
|
|
|
shrd edx, ebx, 4
|
|
|
|
shr bl, 4
|
|
|
|
jmp dreal8
|
|
|
|
dreal6: shld ebx, edx, 4
|
|
|
|
shl edx, 4
|
|
|
|
dreal7: cmp bl, al
|
|
|
|
jb dreal6
|
|
|
|
dreal8: lda cx
|
|
|
|
mov ah, bl
|
1999-08-29 13:43:20 +02:00
|
|
|
rol edx, 16
|
|
|
|
dreals: push edx
|
1998-09-16 10:39:58 +02:00
|
|
|
call savwor
|
|
|
|
pop ax
|
|
|
|
xchg ah, al
|
|
|
|
call savwor
|
|
|
|
pop ax
|
|
|
|
xchg ah, al
|
|
|
|
call savwor
|
|
|
|
dec si
|
|
|
|
lodsb
|
|
|
|
cmp al, ','
|
|
|
|
je dtar2
|
1999-08-29 13:43:20 +02:00
|
|
|
jmp dtanp
|
1998-09-16 10:39:58 +02:00
|
|
|
|
|
|
|
putdig: cmp bl, 10h
|
|
|
|
jnb rlret
|
|
|
|
shld ebx, edx, 4
|
|
|
|
shl edx, 4
|
|
|
|
add dl, al
|
|
|
|
ret
|
|
|
|
|
|
|
|
getsgn: call get
|
|
|
|
cmp al, '-'
|
|
|
|
stc
|
|
|
|
je sgnret
|
|
|
|
cmp al, '+'
|
1999-08-20 19:15:06 +02:00
|
|
|
je sgnret ; C=0
|
1998-09-16 10:39:58 +02:00
|
|
|
dec si
|
|
|
|
sgnret: rcr di, 1
|
|
|
|
rlret: ret
|
|
|
|
|
|
|
|
getdig: call get
|
|
|
|
cmp al, '0'
|
|
|
|
jb rlret
|
|
|
|
cmp al, '9'+1
|
|
|
|
cmc
|
|
|
|
jb rlret
|
|
|
|
sub al, '0'
|
|
|
|
ret
|
|
|
|
|
1998-05-22 18:27:22 +02:00
|
|
|
p_icl: call rfname
|
1998-05-21 15:50:52 +02:00
|
|
|
pop ax
|
1998-09-23 16:48:58 +02:00
|
|
|
push di
|
1998-05-21 15:50:52 +02:00
|
|
|
call linend
|
1998-09-23 16:48:58 +02:00
|
|
|
mov dx, offset (icl).nam
|
|
|
|
add dx, [iclen]
|
|
|
|
pop di
|
|
|
|
call adasx
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp opfile
|
|
|
|
|
1998-05-22 18:27:22 +02:00
|
|
|
p_ins: call rfname
|
1998-09-30 19:23:10 +02:00
|
|
|
xor eax, eax
|
|
|
|
mov [insofs], eax
|
|
|
|
mov [inslen], ax
|
|
|
|
lodsb
|
|
|
|
cmp al, ','
|
|
|
|
jne p_ii2
|
|
|
|
push di
|
|
|
|
call getval
|
|
|
|
jc unknow
|
|
|
|
mov [insofs], eax
|
|
|
|
lodsb
|
|
|
|
cmp al, ','
|
|
|
|
jne p_ii1
|
|
|
|
call getpos
|
|
|
|
mov [inslen], ax
|
|
|
|
inc si
|
|
|
|
p_ii1: pop di
|
|
|
|
p_ii2: dec si
|
1998-05-22 18:27:22 +02:00
|
|
|
push si
|
1998-09-30 19:23:10 +02:00
|
|
|
call fopen
|
|
|
|
mov dx, [word insofs]
|
|
|
|
mov cx, [word high insofs]
|
|
|
|
mov ax, 4200h
|
|
|
|
jcxz p_ip1
|
|
|
|
mov al, 2
|
1999-03-04 14:04:42 +01:00
|
|
|
p_ip1: call fsrce
|
1998-09-30 19:23:10 +02:00
|
|
|
p_in1: mov cx, [inslen]
|
|
|
|
jcxz p_in2
|
|
|
|
test ch, ch
|
|
|
|
jz p_in3
|
|
|
|
p_in2: mov cx, 256
|
|
|
|
p_in3: mov dx, offset tlabel
|
1998-05-22 18:27:22 +02:00
|
|
|
call fread
|
1998-09-23 16:48:58 +02:00
|
|
|
jz p_inx
|
1998-05-22 18:27:22 +02:00
|
|
|
cwde
|
|
|
|
mov bx, [iclen]
|
|
|
|
mov bx, [(icl bx).prev]
|
|
|
|
add [(icl bx).line], eax
|
1998-09-23 16:48:58 +02:00
|
|
|
mov si, offset tlabel
|
1998-09-30 19:23:10 +02:00
|
|
|
push ax
|
1998-05-22 18:27:22 +02:00
|
|
|
sta cx
|
1998-09-30 19:23:10 +02:00
|
|
|
p_inp: lodsb
|
1998-09-23 16:48:58 +02:00
|
|
|
push cx
|
|
|
|
call savbyt
|
|
|
|
pop cx
|
1998-09-30 19:23:10 +02:00
|
|
|
loop p_inp
|
|
|
|
pop ax
|
|
|
|
cmp [inslen], 0
|
|
|
|
jz p_in1
|
|
|
|
sub [inslen], ax
|
|
|
|
jnz p_in1
|
1998-09-23 16:48:58 +02:00
|
|
|
p_inx: call fclose
|
1998-05-22 18:27:22 +02:00
|
|
|
pop si
|
1998-09-30 19:23:10 +02:00
|
|
|
cmp [inslen], 0
|
|
|
|
jz rlret
|
|
|
|
error e_fshor
|
1998-05-22 18:27:22 +02:00
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
p_end: pop ax
|
1998-05-21 15:50:52 +02:00
|
|
|
call linend
|
1998-05-10 21:14:44 +02:00
|
|
|
jmp filend
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
p_ift: shl [elflag], 1
|
|
|
|
jc etmift
|
|
|
|
shl [cmflag], 1
|
|
|
|
shl [skflag], 1
|
|
|
|
ift1: call spaval
|
1998-09-16 10:39:58 +02:00
|
|
|
jc unknow
|
|
|
|
test eax, eax
|
2000-05-24 10:07:34 +02:00
|
|
|
jnz ift2
|
|
|
|
ift0: setflag [skflag], 1
|
|
|
|
ret
|
|
|
|
|
|
|
|
p_els: bts [elflag], 0
|
|
|
|
jc cnderr
|
|
|
|
ift2: bts [cmflag], 0
|
|
|
|
jc ift0
|
|
|
|
maskflag [skflag], not 1
|
1998-09-16 10:39:58 +02:00
|
|
|
cndret: ret
|
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
p_eli: testflag [elflag], 1
|
|
|
|
jz ift1
|
|
|
|
cnderr: cmp [elflag], 1
|
|
|
|
je emift
|
|
|
|
error e_eifex
|
1998-09-16 10:39:58 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
p_eif: shr [skflag], 1
|
|
|
|
shr [cmflag], 1
|
|
|
|
shr [elflag], 1
|
1998-09-16 10:39:58 +02:00
|
|
|
jnz cndret
|
2000-05-24 10:07:34 +02:00
|
|
|
emift: error e_mift
|
|
|
|
|
|
|
|
etmift: error e_tmift
|
1998-09-16 10:39:58 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
ENDS
|
|
|
|
DATASEG
|
|
|
|
; ORG 0
|
|
|
|
ENDIF
|
1998-05-22 18:27:22 +02:00
|
|
|
; addressing modes:
|
|
|
|
; 0-@ 1-# 2-A 3-Z 4-A,X 5-Z,X 6-A,Y 7-Z,Y 8-(Z,X) 9-(Z),Y 10-(A)
|
1998-05-10 21:14:44 +02:00
|
|
|
lentab db 1,2,3,2,3,2,3,2,2,2,3
|
|
|
|
acctab db 0,9,0dh,5,1dh,15h,19h,19h,1,11h,0
|
|
|
|
srttab db 0ah,0,0eh,6,1eh,16h
|
|
|
|
lditab db 0,0,0ch,4,1ch,14h,1ch,14h
|
1998-05-22 18:27:22 +02:00
|
|
|
inwtab db 0eeh,0e6h,0feh,0f6h
|
1999-08-20 19:15:06 +02:00
|
|
|
; pseudo-adr modes: 2-X+ 3-X- 4-Y+ 5-Y-
|
|
|
|
; +8-,0) +16-),0
|
|
|
|
sfxtab db 0,0,0e8h,0cah,0c8h,088h
|
1998-09-06 18:05:14 +02:00
|
|
|
|
2001-04-12 22:58:12 +02:00
|
|
|
movtab movt <0a0h,p_ac1,080h,p_ac1,0,0>
|
|
|
|
movt <0a2h,p_ld1,086h,p_st1,0e8h,0cah>
|
|
|
|
movt <0a0h,p_ld1,084h,p_st1,0c8h,088h>
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
comtab = $
|
|
|
|
cmd ADC0060p_acc
|
1999-08-20 19:15:06 +02:00
|
|
|
cmd ADD8018p_ads
|
|
|
|
cmd AND0020p_acc
|
|
|
|
cmd ASL0000p_srt
|
|
|
|
cmd BCC0090p_bra
|
|
|
|
cmd BCS00b0p_bra
|
|
|
|
cmd BEQ00f0p_bra
|
|
|
|
cmd BIT002cp_bit
|
|
|
|
cmd BMI0030p_bra
|
|
|
|
cmd BNE00d0p_bra
|
|
|
|
cmd BPL0010p_bra
|
|
|
|
cmd BRK0000p_imp
|
|
|
|
cmd BVC0050p_bra
|
|
|
|
cmd BVS0070p_bra
|
|
|
|
cmd CLC0018p_imp
|
|
|
|
cmd CLD00d8p_imp
|
|
|
|
cmd CLI0058p_imp
|
|
|
|
cmd CLV00b8p_imp
|
|
|
|
cmd CMP00c0p_acc
|
|
|
|
cmd CPX00e0p_cpi
|
|
|
|
cmd CPY00c0p_cpi
|
|
|
|
cmd DEC00c0p_srt
|
|
|
|
cmd DEX00cap_imp
|
|
|
|
cmd DEY0088p_imp
|
|
|
|
cmd DTA8000p_dta
|
|
|
|
cmd EIFe000p_eif
|
2000-05-24 10:07:34 +02:00
|
|
|
cmd ELIe000p_eli
|
1999-08-20 19:15:06 +02:00
|
|
|
cmd ELSe000p_els
|
|
|
|
cmd ENDe000p_end
|
|
|
|
cmd EOR0040p_acc
|
|
|
|
cmd EQUe000p_equ
|
|
|
|
cmd ERTe000p_ert
|
|
|
|
cmd ICLe000p_icl
|
|
|
|
cmd IFTe000p_ift
|
|
|
|
cmd INC00e0p_srt
|
|
|
|
cmd INIf0e2p_rui
|
|
|
|
cmd INSf000p_ins
|
|
|
|
cmd INW8000p_inw
|
|
|
|
cmd INX00e8p_imp
|
|
|
|
cmd INY00c8p_imp
|
|
|
|
cmd JCC80b0p_juc
|
|
|
|
cmd JCS8090p_juc
|
|
|
|
cmd JEQ80d0p_juc
|
|
|
|
cmd JMI8010p_juc
|
|
|
|
cmd JMP004cp_jmp
|
|
|
|
cmd JNE80f0p_juc
|
|
|
|
cmd JPL8030p_juc
|
|
|
|
cmd JSR0020p_jsr
|
|
|
|
cmd JVC8070p_juc
|
|
|
|
cmd JVS8050p_juc
|
|
|
|
cmd LDA00a0p_acc
|
|
|
|
cmd LDX00a2p_ldi
|
|
|
|
cmd LDY00a0p_ldi
|
|
|
|
cmd LSR0040p_srt
|
|
|
|
cmd MVA8000p_mvs
|
2001-04-12 22:58:12 +02:00
|
|
|
cmd MVX8008p_mvs
|
|
|
|
cmd MVY8010p_mvs
|
1999-08-20 19:15:06 +02:00
|
|
|
cmd MWA8000p_mws
|
2001-04-12 22:58:12 +02:00
|
|
|
cmd MWX8008p_mws
|
|
|
|
cmd MWY8010p_mws
|
1999-08-20 19:15:06 +02:00
|
|
|
cmd NOP00eap_imp
|
|
|
|
cmd OPTe000p_opt
|
|
|
|
cmd ORA0000p_acc
|
|
|
|
cmd ORGf000p_org
|
|
|
|
cmd PHA0048p_imp
|
|
|
|
cmd PHP0008p_imp
|
|
|
|
cmd PLA0068p_imp
|
|
|
|
cmd PLP0028p_imp
|
|
|
|
cmd RCC8890p_rep
|
|
|
|
cmd RCS88b0p_rep
|
|
|
|
cmd REQ88f0p_rep
|
|
|
|
cmd RMI8830p_rep
|
|
|
|
cmd RNE88d0p_rep
|
|
|
|
cmd ROL0020p_srt
|
|
|
|
cmd ROR0060p_srt
|
|
|
|
cmd RPL8810p_rep
|
|
|
|
cmd RTI0040p_imp
|
|
|
|
cmd RTS0060p_imp
|
|
|
|
cmd RUNf0e0p_rui
|
|
|
|
cmd RVC8850p_rep
|
|
|
|
cmd RVS8870p_rep
|
|
|
|
cmd SBC00e0p_acc
|
|
|
|
cmd SCC8490p_skp
|
|
|
|
cmd SCS84b0p_skp
|
|
|
|
cmd SEC0038p_imp
|
|
|
|
cmd SED00f8p_imp
|
|
|
|
cmd SEI0078p_imp
|
|
|
|
cmd SEQ84f0p_skp
|
|
|
|
cmd SMI8430p_skp
|
|
|
|
cmd SNE84d0p_skp
|
|
|
|
cmd SPL8410p_skp
|
|
|
|
cmd STA0080p_acc
|
|
|
|
cmd STX0086p_sti
|
|
|
|
cmd STY0084p_sti
|
|
|
|
cmd SUB8038p_ads
|
|
|
|
cmd SVC8450p_skp
|
|
|
|
cmd SVS8470p_skp
|
|
|
|
cmd TAX00aap_imp
|
|
|
|
cmd TAY00a8p_imp
|
|
|
|
cmd TSX00bap_imp
|
|
|
|
cmd TXA008ap_imp
|
|
|
|
cmd TXS009ap_imp
|
|
|
|
cmd TYA0098p_imp
|
2002-04-06 20:51:52 +02:00
|
|
|
comend = $
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
operpa = $
|
|
|
|
opr 1ret
|
1999-08-29 13:43:20 +02:00
|
|
|
opr 6add
|
|
|
|
opr 6sub
|
|
|
|
opr 7mul
|
|
|
|
opr 7div
|
|
|
|
opr 7mod
|
|
|
|
opr 7and
|
|
|
|
opr 6or
|
|
|
|
opr 6xor
|
|
|
|
opr 5equ
|
|
|
|
opr 5les
|
|
|
|
opr 5grt
|
|
|
|
opr 7sal
|
|
|
|
opr 7sar
|
|
|
|
opr 5leq
|
|
|
|
opr 5geq
|
|
|
|
opr 5neq
|
|
|
|
opr 5neq
|
2000-05-24 10:07:34 +02:00
|
|
|
opr 5equ
|
1998-09-14 11:48:16 +02:00
|
|
|
opr 3anl
|
|
|
|
opr 2orl
|
1999-08-29 13:43:20 +02:00
|
|
|
opr 8plu
|
|
|
|
opr 8neg
|
|
|
|
opr 8low
|
|
|
|
opr 8hig
|
|
|
|
opr 4nol
|
|
|
|
opr 8not
|
1998-09-14 11:48:16 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
opert2 db '<<>><=>=<>!===&&||'
|
1998-09-14 11:48:16 +02:00
|
|
|
noper2 = ($-opert2)/2
|
|
|
|
opert1 db '+-*/%&|^=<>'
|
|
|
|
noper1 = $-opert1
|
1999-08-29 13:43:20 +02:00
|
|
|
opert0 db '+-<>!~'
|
|
|
|
noper0 = $-opert0
|
1998-09-14 11:48:16 +02:00
|
|
|
|
2000-05-24 10:07:34 +02:00
|
|
|
opttxt db 'L-L+H-H+O-O+'
|
|
|
|
optvec dw optl0,optl1,opth0,opth1,opto0,opto1
|
|
|
|
|
|
|
|
cndtxt dd 'DNE','TFI','ILE','SLE','FIE'
|
|
|
|
cndvec dw pofend,0,p_ift,0,p_eli,0,p_els,0,p_eif
|
|
|
|
|
2002-04-20 18:41:42 +02:00
|
|
|
swilet db 'UTSQPONLIEDC'
|
1998-09-23 16:48:58 +02:00
|
|
|
|
2002-04-20 18:41:42 +02:00
|
|
|
hello db 'X-Assembler 2.4'
|
2000-05-24 10:07:34 +02:00
|
|
|
ifdef SET_WIN_TITLE
|
|
|
|
titfin db 0
|
|
|
|
else
|
|
|
|
db ' '
|
|
|
|
endif
|
2002-04-07 16:02:26 +02:00
|
|
|
db 'by Fox/Taquart',eol
|
|
|
|
hellen = $-hello
|
1998-09-23 16:48:58 +02:00
|
|
|
usgtxt db "Syntax: XASM source [options]",eol
|
2002-04-07 16:02:26 +02:00
|
|
|
db "/c Include false conditionals in listing",eol
|
2002-04-20 18:41:42 +02:00
|
|
|
db "/d:label=value Define a label",eol
|
2002-04-07 16:02:26 +02:00
|
|
|
db "/e Set environment variables ERRFILE and ERRLINE",eol
|
|
|
|
db "/i Don't list included files",eol
|
|
|
|
db "/l[:filename] Generate listing",eol
|
|
|
|
db "/n Assemble only if source file is newer than object file",eol
|
|
|
|
db "/o:filename Set object file name",eol
|
|
|
|
db "/p Print fully qualified file names in listing and error messages",eol
|
|
|
|
db "/q Suppress info messages",eol
|
|
|
|
db "/s Don't convert spaces to tabs in listing",eol
|
|
|
|
db "/t[:filename] List label table",eol
|
|
|
|
db "/u Warn of unused labels",eot
|
|
|
|
oldtxt db 'Source file is older than object file - not assembling',cr
|
|
|
|
envtxt db 'Can''t change environment',cr
|
2002-04-06 20:51:52 +02:00
|
|
|
objtxt db 'Writing object file...',eot
|
|
|
|
lsttxt db 'Writing listing file...'
|
1998-09-23 16:48:58 +02:00
|
|
|
eoltxt db eot
|
|
|
|
srctxt db 'Source: '
|
|
|
|
srctxl = $-srctxt
|
|
|
|
tabtxt db 'Label table:',eol
|
|
|
|
tabtxl = $-tabtxt
|
|
|
|
lintxt db ' lines of source assembled',eot
|
2002-04-06 20:51:52 +02:00
|
|
|
byttxt db ' bytes written to the object file',eot
|
1998-05-10 21:14:44 +02:00
|
|
|
dectxt db 10 dup(' '),'$'
|
2002-04-07 16:02:26 +02:00
|
|
|
wartxt db 'WARNING: '
|
|
|
|
wartxl = $-wartxt
|
1998-09-06 18:05:14 +02:00
|
|
|
w_bugjp db 'Buggy indirect jump',eol
|
|
|
|
w_bras db 'Branch would be sufficient',eol
|
2000-05-24 10:07:34 +02:00
|
|
|
w_ulab db 'Unused label',eol
|
2000-08-05 23:12:46 +02:00
|
|
|
w_skif db 'Skipping only first instruction',eol
|
|
|
|
w_repl db 'Repeating only last instruction',eol
|
2002-04-07 16:02:26 +02:00
|
|
|
errtxt db 'ERROR: '
|
|
|
|
errtxl = $-errtxt
|
2000-05-24 10:07:34 +02:00
|
|
|
e_open db 'Can''t open file',cr
|
|
|
|
e_read db 'Disk read error',cr
|
2002-04-06 20:51:52 +02:00
|
|
|
e_crobj db 'Can''t write to the object file',cr
|
|
|
|
e_wrobj db 'Error writing to the object file',cr
|
|
|
|
e_crlst db 'Can''t write to the listing file',cr
|
|
|
|
e_wrlst db 'Error writing to the listing file',cr
|
2000-05-24 10:07:34 +02:00
|
|
|
e_icl db 'Too many files nested',cr
|
|
|
|
e_long db 'Line too long',cr
|
|
|
|
e_uneol db 'Unexpected eol',cr
|
|
|
|
e_char db 'Illegal character',cr
|
|
|
|
e_twice db 'Label declared twice',cr
|
|
|
|
e_inst db 'Illegal instruction',cr
|
|
|
|
e_nbig db 'Number too big',cr
|
|
|
|
e_xtra db 'Extra characters on line',cr
|
|
|
|
e_label db 'Label name required',cr
|
|
|
|
e_str db 'String error',cr
|
|
|
|
e_orgs db 'Too many ORGs',cr
|
|
|
|
e_paren db 'Need parenthesis',cr
|
|
|
|
e_tlab db 'Too many labels',cr
|
|
|
|
e_amod db 'Illegal addressing mode',cr
|
1998-09-06 18:05:14 +02:00
|
|
|
e_bra db 'Branch out of range by $'
|
2000-05-24 10:07:34 +02:00
|
|
|
brout db ' bytes',cr
|
|
|
|
e_sin db 'Bad or missing sinus parameter',cr
|
|
|
|
e_spac db 'Space expected',cr
|
2002-04-06 20:51:52 +02:00
|
|
|
e_opt db 'Invalid option',cr
|
2000-05-24 10:07:34 +02:00
|
|
|
e_over db 'Arithmetic overflow',cr
|
|
|
|
e_div0 db 'Divide by zero',cr
|
|
|
|
e_range db 'Value out of range',cr
|
|
|
|
e_uknow db 'Label not defined before',cr
|
|
|
|
e_undec db 'Undeclared label',cr
|
|
|
|
e_fref db 'Illegal forward reference',cr
|
|
|
|
e_wpar db 'Use square brackets instead',cr
|
|
|
|
e_brack db 'No matching bracket',cr
|
|
|
|
e_user db 'User error',cr
|
|
|
|
e_tmift db 'Too many IFTs nested',cr
|
|
|
|
e_eifex db 'EIF expected',cr
|
|
|
|
e_mift db 'Missing IFT',cr
|
|
|
|
e_meif db 'Missing EIF',cr
|
|
|
|
e_norg db 'No ORG specified',cr
|
|
|
|
e_fshor db 'File is too short',cr
|
|
|
|
e_hoff db 'Illegal when headers off',cr
|
|
|
|
e_crep db 'Can''t repeat this directive',cr
|
|
|
|
e_opcod db 'Can''t get op-code of this',cr
|
|
|
|
e_ropco db 'Nested op-codes not supported',cr
|
|
|
|
e_mopco db 'Missing ''}''',cr
|
|
|
|
e_pair db 'Can''t pair this directive',cr
|
|
|
|
e_skit db 'Can''t skip over it',cr
|
|
|
|
e_repa db 'No instruction to repeat',cr
|
2002-04-20 18:41:42 +02:00
|
|
|
clitxt db 'command line'
|
|
|
|
clitxl = $-clitxt
|
1998-09-06 18:05:14 +02:00
|
|
|
|
|
|
|
exitcod dw 4c00h
|
1998-09-23 16:48:58 +02:00
|
|
|
ohand dw nhand
|
|
|
|
lhand dw nhand
|
2000-05-24 10:07:34 +02:00
|
|
|
flags dw m_norg+m_rorg+m_rqff+m_hdr+m_wobj
|
|
|
|
swits dw 0
|
1998-05-10 21:14:44 +02:00
|
|
|
lines dd 0
|
|
|
|
bytes dd 0
|
1998-09-23 16:48:58 +02:00
|
|
|
srcen dw 0
|
1998-05-22 18:27:22 +02:00
|
|
|
iclen dw t_icl
|
2002-04-20 18:41:42 +02:00
|
|
|
defen dw t_def
|
1998-09-16 20:44:16 +02:00
|
|
|
laben dw t_lab
|
|
|
|
pslab dw t_lab
|
1998-09-16 10:39:58 +02:00
|
|
|
elflag dd 1
|
2000-05-24 10:07:34 +02:00
|
|
|
cmflag dd 0
|
|
|
|
skflag dd 0
|
1998-05-21 15:50:52 +02:00
|
|
|
sinmin dw 1
|
|
|
|
sinmax dw 0
|
1998-10-25 19:44:40 +01:00
|
|
|
sinadd dd ?
|
|
|
|
sinamp dd ?
|
1998-05-21 15:50:52 +02:00
|
|
|
sinsiz dw ?
|
1998-09-23 16:48:58 +02:00
|
|
|
flist db ?
|
1999-03-04 14:04:42 +01:00
|
|
|
fslen dw ?
|
|
|
|
times dw ?
|
|
|
|
cmdvec dw ?
|
1999-08-20 19:15:06 +02:00
|
|
|
scdvec dw ?
|
1999-04-17 12:36:00 +02:00
|
|
|
opcosp dw ?
|
1999-03-04 14:04:42 +01:00
|
|
|
insofs dd ?
|
|
|
|
inslen dw ?
|
1998-05-10 21:14:44 +02:00
|
|
|
origin dw ?
|
1998-09-23 16:48:58 +02:00
|
|
|
curorg dw ?
|
|
|
|
orgvec dw ?
|
2002-04-20 18:41:42 +02:00
|
|
|
defvec dw ?
|
1999-08-20 19:15:06 +02:00
|
|
|
reporg dw ?
|
2000-05-24 10:07:34 +02:00
|
|
|
eolpos dw ?
|
1998-09-23 16:48:58 +02:00
|
|
|
lstidx dw ?
|
1999-03-04 14:04:42 +01:00
|
|
|
labvec dw ?
|
1999-08-20 19:15:06 +02:00
|
|
|
obufpt dw ?
|
|
|
|
oword dw ?
|
|
|
|
objmod dd ?
|
1998-09-14 11:48:16 +02:00
|
|
|
op1 dd ?
|
|
|
|
dw ?
|
|
|
|
op2 dd ?
|
|
|
|
dw ?
|
1999-03-04 14:04:42 +01:00
|
|
|
tempsi dw ?
|
|
|
|
errmsg dw ?
|
1999-08-20 19:15:06 +02:00
|
|
|
envofs dw ?
|
|
|
|
envseg dw ?
|
|
|
|
envnam dw ?
|
|
|
|
envnum dw ?
|
|
|
|
envlen dw ?
|
2002-04-07 16:02:26 +02:00
|
|
|
chbuf db ?
|
1999-03-04 14:04:42 +01:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
var = $
|
1999-03-04 14:04:42 +01:00
|
|
|
MACRO bb _name
|
|
|
|
_name&o = $-var
|
|
|
|
_name equ byte bp+_name&o
|
|
|
|
db ?
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
MACRO bw _name
|
|
|
|
_name&o = $-var
|
|
|
|
_name equ word bp+_name&o
|
|
|
|
dw ?
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
bw val
|
|
|
|
dw ?
|
|
|
|
bb amod
|
|
|
|
db ?
|
|
|
|
bb ukp1
|
|
|
|
db ?
|
|
|
|
bb cod
|
|
|
|
|
|
|
|
var2 db ($-var) dup(?)
|
1998-05-10 21:14:44 +02:00
|
|
|
|
1998-09-23 16:48:58 +02:00
|
|
|
IFNDEF compak
|
|
|
|
undata
|
|
|
|
ENDIF
|
|
|
|
|
1998-09-14 11:48:16 +02:00
|
|
|
t_lab db l_lab dup(?)
|
1998-05-10 21:14:44 +02:00
|
|
|
|
2002-04-06 20:51:52 +02:00
|
|
|
IFDEF EXE
|
|
|
|
stak db 400h dup(?)
|
|
|
|
staken = $
|
|
|
|
ENDS
|
|
|
|
STACK 100h
|
|
|
|
ENDIF
|
|
|
|
|
1998-05-10 21:14:44 +02:00
|
|
|
ENDS
|
|
|
|
END start
|