mirror of
https://github.com/pfusik/xasm.git
synced 2024-12-22 00:29:15 +00:00
xasm 2.4.-7.
This commit is contained in:
parent
e22a4aadc3
commit
323634d856
68
xasm.asm
68
xasm.asm
@ -5,10 +5,10 @@
|
|||||||
MODEL TINY
|
MODEL TINY
|
||||||
CODESEG
|
CODESEG
|
||||||
|
|
||||||
; comment out to turn off
|
; comment out to disable
|
||||||
SET_WIN_TITLE = 1
|
SET_WIN_TITLE = 1
|
||||||
|
|
||||||
compak = 1c00h
|
compak = 1d00h
|
||||||
|
|
||||||
l_icl = 1024
|
l_icl = 1024
|
||||||
l_org = 4096
|
l_org = 4096
|
||||||
@ -60,6 +60,12 @@ m_skit = 80h
|
|||||||
b_enve = 8
|
b_enve = 8
|
||||||
m_enve = 100h
|
m_enve = 100h
|
||||||
m_wobj = 200h
|
m_wobj = 200h
|
||||||
|
m_times = 400h
|
||||||
|
m_first = 800h
|
||||||
|
b_skif = 12
|
||||||
|
m_skif = 1000h
|
||||||
|
b_repl = 13
|
||||||
|
m_repl = 2000h
|
||||||
|
|
||||||
;[swits]
|
;[swits]
|
||||||
m_swc = 1
|
m_swc = 1
|
||||||
@ -558,7 +564,12 @@ s_one: dec si
|
|||||||
s_cmd: cmp [skflag], 0
|
s_cmd: cmp [skflag], 0
|
||||||
jnz skip1
|
jnz skip1
|
||||||
mov [times], cx
|
mov [times], cx
|
||||||
testfl m_norg
|
resfl m_times
|
||||||
|
setfl m_first
|
||||||
|
cmp cx, 1
|
||||||
|
je jone
|
||||||
|
setfl m_times
|
||||||
|
jone: testfl m_norg
|
||||||
jnz nlorg
|
jnz nlorg
|
||||||
call phorg
|
call phorg
|
||||||
nlorg: mov [cmdvec], si
|
nlorg: mov [cmdvec], si
|
||||||
@ -622,17 +633,17 @@ fncmd: test al, 80h
|
|||||||
jopcod ntopco ; nie ma opcoda
|
jopcod ntopco ; nie ma opcoda
|
||||||
ckcmd1: test al, 40h
|
ckcmd1: test al, 40h
|
||||||
jz ckcmd2
|
jz ckcmd2
|
||||||
cmp [times], 1 ; nie mozna powtarzac ...
|
testfl m_times ; nie mozna powtarzac ...
|
||||||
jne ntrep
|
jnz ntrep
|
||||||
testfl m_pair ; ... ani parowac
|
testfl m_pair ; ... ani parowac
|
||||||
jnz ntpair
|
jnz ntpair
|
||||||
ckcmd2: test al, 20h
|
ckcmd2: test al, 20h ; dyrektywa?
|
||||||
jz ckcmd3
|
jz ckcmd3
|
||||||
test al, 10h ; nie mozna generowac skoku przez dyrektywe
|
test al, 10h ; nie mozna generowac skoku przez dyrektywe
|
||||||
jz rncmd2 ; (dyrektywa neutralna)
|
jz rncmd3 ; (dyrektywa neutralna)
|
||||||
resfl m_repa ; skok zabroniony
|
resfl m_repa ; skok zabroniony
|
||||||
testfl m_skit
|
testfl m_skit
|
||||||
jz rncmd2
|
jz rncmd3
|
||||||
eskit: error e_skit
|
eskit: error e_skit
|
||||||
ckcmd3: jopcod ckcmd4
|
ckcmd3: jopcod ckcmd4
|
||||||
testfl m_skit
|
testfl m_skit
|
||||||
@ -640,14 +651,17 @@ ckcmd3: jopcod ckcmd4
|
|||||||
inc [origin] ; robimy miejsce na argument skoku
|
inc [origin] ; robimy miejsce na argument skoku
|
||||||
inc [curorg]
|
inc [curorg]
|
||||||
inc [obufpt]
|
inc [obufpt]
|
||||||
|
mov cx, m_pair+m_times
|
||||||
|
mov dx, offset w_skif
|
||||||
|
call skirew
|
||||||
ckcmd4: test al, 08h
|
ckcmd4: test al, 08h
|
||||||
jz ckcmd5
|
jz ckcmd5
|
||||||
testfl m_repa ; pseudo instrukcja powtarzania
|
testfl m_repa ; pseudo instrukcja powtarzania
|
||||||
jz ntrepa
|
jz ntrepa
|
||||||
mov ax, [origin]
|
mov cx, m_repl
|
||||||
xchg ax, [reporg]
|
mov dx, offset w_repl
|
||||||
call bra0
|
call skirew
|
||||||
jmp encmd1
|
jmp rncmd2
|
||||||
|
|
||||||
ckcmd5: setfl m_repa
|
ckcmd5: setfl m_repa
|
||||||
test al, 04h
|
test al, 04h
|
||||||
@ -660,9 +674,13 @@ ckcmd5: setfl m_repa
|
|||||||
call savbyt
|
call savbyt
|
||||||
jmp encmd2
|
jmp encmd2
|
||||||
|
|
||||||
rncmd2: mov al, [cod]
|
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]
|
||||||
call [(com di+bx).c_vec] ; wywolaj procedure
|
call [(com di+bx).c_vec] ; wywolaj procedure
|
||||||
encmd1: btr [flags], b_skit
|
btr [flags], b_skit
|
||||||
jnc encmd2
|
jnc encmd2
|
||||||
mov ax, [origin]
|
mov ax, [origin]
|
||||||
sub ax, [reporg]
|
sub ax, [reporg]
|
||||||
@ -670,6 +688,7 @@ encmd1: btr [flags], b_skit
|
|||||||
call calcbr
|
call calcbr
|
||||||
mov [obuf], al
|
mov [obuf], al
|
||||||
encmd2: call oflush
|
encmd2: call oflush
|
||||||
|
resfl m_first
|
||||||
mov cx, [scdvec]
|
mov cx, [scdvec]
|
||||||
jcxz encmd3
|
jcxz encmd3
|
||||||
mov si, cx
|
mov si, cx
|
||||||
@ -680,6 +699,17 @@ encmd3: call linend
|
|||||||
mov si, [cmdvec]
|
mov si, [cmdvec]
|
||||||
jmp rdcmd1
|
jmp rdcmd1
|
||||||
|
|
||||||
|
skirew: jpass1 skiret
|
||||||
|
testfl cx
|
||||||
|
jz skiret
|
||||||
|
testfl m_first
|
||||||
|
jz skiret
|
||||||
|
pusha
|
||||||
|
push dx
|
||||||
|
call warln
|
||||||
|
popa
|
||||||
|
skiret: ret
|
||||||
|
|
||||||
; ERROR
|
; ERROR
|
||||||
errln: call ppline
|
errln: call ppline
|
||||||
erron: call prname
|
erron: call prname
|
||||||
@ -1562,7 +1592,6 @@ v_sal: test ecx, ecx ; <<
|
|||||||
v_sl1: add eax, eax
|
v_sl1: add eax, eax
|
||||||
jo oflow
|
jo oflow
|
||||||
loop v_sl1
|
loop v_sl1
|
||||||
p_rep:
|
|
||||||
p_skp:
|
p_skp:
|
||||||
v_ret: ret
|
v_ret: ret
|
||||||
|
|
||||||
@ -1898,6 +1927,11 @@ p_cpi: call getadr
|
|||||||
mov al, 4
|
mov al, 4
|
||||||
jmp putcod
|
jmp putcod
|
||||||
|
|
||||||
|
p_rep:
|
||||||
|
mov ax, [origin]
|
||||||
|
xchg ax, [reporg]
|
||||||
|
jmp bra0
|
||||||
|
|
||||||
p_bra: call onemod
|
p_bra: call onemod
|
||||||
and al, 0feh
|
and al, 0feh
|
||||||
cmp al, 2
|
cmp al, 2
|
||||||
@ -2701,7 +2735,7 @@ cndvec dw pofend,0,p_ift,0,p_eli,0,p_els,0,p_eif
|
|||||||
|
|
||||||
swilet db 'UTSONLIEC'
|
swilet db 'UTSONLIEC'
|
||||||
|
|
||||||
hello db 'X-Assembler 2.4.-8'
|
hello db 'X-Assembler 2.4.-7'
|
||||||
ifdef SET_WIN_TITLE
|
ifdef SET_WIN_TITLE
|
||||||
titfin db 0
|
titfin db 0
|
||||||
else
|
else
|
||||||
@ -2735,6 +2769,8 @@ wartxt db 'WARNING: $'
|
|||||||
w_bugjp db 'Buggy indirect jump',eol
|
w_bugjp db 'Buggy indirect jump',eol
|
||||||
w_bras db 'Branch would be sufficient',eol
|
w_bras db 'Branch would be sufficient',eol
|
||||||
w_ulab db 'Unused label',eol
|
w_ulab db 'Unused label',eol
|
||||||
|
w_skif db 'Skipping only first instruction',eol
|
||||||
|
w_repl db 'Repeating only last instruction',eol
|
||||||
errtxt db 'ERROR: $'
|
errtxt db 'ERROR: $'
|
||||||
e_open db 'Can''t open file',cr
|
e_open db 'Can''t open file',cr
|
||||||
e_read db 'Disk read error',cr
|
e_read db 'Disk read error',cr
|
||||||
|
Loading…
Reference in New Issue
Block a user