home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Serious Magazine 12
/
Serious_Magazine_12_2003_01_07_Dial_pl_Side_B.atr
/
stuff1.arc
/
TCP.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-09-01
|
9KB
|
1 lines
* Thunder Command Processor v1.0¢* for WORDMARK's MYDOS 4.50T¢* written by epi/Allegresse '2k1¢* ------------------------------¢* public domain¢¢* Witaj, koderze!!¢* pare slow od epi-ego specjalnie dla¢* Ciebie:¢* kod wydaje mi sie na tyle¢* nieskomplikowany, ze nie ma zadnych¢* komentarzy (oprocz tego wstepu¢* i "dead links" w linii 675 ;)))¢* Jezeli jestes PRAWDZIWYM koderem¢* (a nie takim wypierdkiem, jak ja),¢* to nie bedziesz mial problemow¢* z przeanalizowaniem go.¢¢program equ 8169¢¢boot equ $0009¢dosrun equ $000A¢dosini equ $000C¢runad equ $02E0¢initad equ $02E2¢memlo equ $02E7¢memhi equ $02E5¢iocb equ $0340¢fr0 equ $00D4¢lbuff equ $0580¢dspflg equ $02FE¢portb equ $D301¢vbreak equ $0206¢path equ $0400¢ctpath equ $0480¢command equ $0500¢param equ $0530¢lcnt equ $0080¢ccode equ $0081¢addr equ $0082¢_init equ $07E0¢_run equ $1B48¢putln equ $C642¢ciov equ $E456¢ifp equ $D9AA¢fasc equ $D8E6¢basic equ $A000¢¢ opt %00100101¢ org program¢¢tit_1 dta c' Thunder Command Processor v1.0beta',b($9B)¢tit_2 equ *¢ dta c' by epi/Allegresse ''2k1 -- PD',b($9B)¢drnm_ org *+20¢enam_ dta c'E:',b($9B)¢default dta c'D1:',b($9B)¢dirmask dta c'D1:*.*',b($9B)¢drmsk2 equ dirmask+3¢ext_ dta c'.COM',b($9B)¢error_ dta c'Error- ...',b($9B)¢erc_ equ error_+8¢sxer_ dta c'Syntax error',b($9B)¢cntdo_ dta c'That',b(39),c's impossible!',b($9B)¢break_ dta c'BRK at $....',b($9B)¢bra_ equ break_+8¢mem_ dta c'Memlo=$.... Memhi=$....',b($9B)¢mlo_ equ mem_+7¢mhi_ equ mem_+20¢ipcblk equ *¢p_trk dta b(40)¢ dta b(0)¢p_sec dta a(18)¢p_sid dta b(0)¢p_psw dta b(4)¢p_byt dta a(256)¢ dta d' '¢¢cmds_ dta c'MEM',b($9B)¢ dta c'RUN',b($9B)¢ dta c'CLS',b($9B)¢ dta c'CAR',b($9B)¢ dta c'DIR',b($9B)¢ dta c'LOCK',b($9B)¢ dta c'UNL',b($9B)¢ dta c'DEL',b($9B)¢ dta c'REN',b($9B)¢ dta c'MD',b($9B)¢ dta c'CD',b($9B)¢ dta c'INIT',b($9B)¢ dta c'SYS',b($9B)¢ dta c'PATH',b($9B)¢ dta c'VIEW',b($9B)¢ dta c'MON',b($9B)¢ dta c'1',b($9B),c'2',b($9B),c'3',b($9B)¢ dta c'4',b($9B),c'5',b($9B),c'6',b($9B)¢ dta c'7',b($9B),c'8',b($9B),c'*',b($9B)¢ dta b($FF)¢jmptab dta a(c_mem-1) ; jump table¢ dta a(c_run-1)¢ dta a(c_cls-1)¢ dta a(c_car-1)¢ dta a(c_dir-1)¢ dta a(c_lock-1)¢ dta a(c_unl-1)¢ dta a(c_del-1)¢ dta a(c_ren-1)¢ dta a(c_md-1)¢ dta a(c_cd-1)¢ dta a(c_init-1)¢ dta a(c_sys-1)¢ dta a(c_path-1)¢ dta a(c_view-1)¢ dta a(c_mon-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢ dta a(c_sdir-1)¢¢ brk¢¢title equ *¢ ldx <tit_1¢ ldy >tit_1¢ jsr putln¢ ldx <tit_2¢ ldy >tit_2¢ jmp putln¢¢eol lda #$9B¢putchar equ *¢ ldx #0¢ tay¢ lda iocb+7,x¢ pha¢ lda iocb+6,x¢ pha¢ tya¢ rts¢¢prompt equ *¢ lda #$9B¢ jsr putchar¢ lda #0¢ sta lcnt¢p1 ldy lcnt¢ lda path,y¢ cmp #$9B¢ beq p2¢ jsr putchar¢ inc lcnt¢ bpl p1¢p2 lda #'>'¢ jmp putchar¢¢getln equ *¢ ldx #0¢_gtl sta iocb+4,x¢ tya¢ sta iocb+5,x¢ lda #40¢ sta iocb+9,x¢ lda #5¢ sta iocb+2,x¢ jsr ciov¢ bpl _rt1¢ cpy #136¢ beq _rt1¢ jmp error¢_rt1 rts¢¢stdpth equ *¢ ldy #0¢p14 lda default,y¢ sta path,y¢ iny¢ cmp #$9B¢ bne p14¢ rts¢¢sntxerr equ *¢ ldx <sxer_¢ ldy >sxer_¢ jmp putln¢¢impsbl equ *¢ ldx <cntdo_¢ ldy >cntdo_¢ jmp putln¢¢getcmd equ *¢ lda #$9B¢ sta command¢ sta param¢ lda <command¢ ldy >command¢ jsr getln¢ lda command¢ cmp #$9B¢ bne p4¢p3 lda #$9b¢ rts¢p4 cmp #$20¢ beq p3¢ ldy #0¢p5 lda command,y¢ iny¢ cmp #$20¢ beq p6¢ cmp #$9B¢ bne p5¢ sta param¢ lda command-2,y¢ cmp #':'¢ bne p8¢ jmp xpth¢p6 lda #$9B¢ sta command-1,y¢ ldx #0¢p7 lda command,y¢ sta param,x¢ iny¢ inx¢ cmp #$9B¢ bne p7¢¢p8 ldy #0¢ sty lcnt¢p9 ldx #0¢p10 lda cmds_,y¢ cmp #$FF¢ beq p13¢ cmp command,x¢ bne p11¢ cmp #$9B¢ beq p12¢ iny¢ inx¢ bpl p10¢p11 lda cmds_,y¢ iny¢ cmp #$9B¢ bne p11¢ inc lcnt¢ bpl p9¢p12 lda lcnt¢p13 rts¢¢pwor equ *¢ ldy #3¢ jsr phex¢ txa¢phex pha¢ jsr pxdig¢ pla¢ lsr @¢ lsr @¢ lsr @¢ lsr @¢pxdig and #%00001111¢ ora #'0'¢ cmp #'9'+1¢ bcc *+4¢ adc #6¢ sta (addr),y¢ dey¢ rts¢¢close equ *¢ lda #12¢ sta iocb+2,x¢ jsr ciov¢ bmi error¢ rts¢¢error equ *¢ sty fr0¢ lda #0¢ sta fr0+1¢ jsr ifp¢ jsr fasc¢ ldy #2¢e1 lda lbuff+1,y¢ and #$7F¢ sta erc_,y¢ dey¢ bpl e1¢ ldx #$70¢ jsr close¢ lda #0¢ sta dspflg¢ ldx <error_¢ ldy >error_¢ pla¢ pla¢ jmp putln¢¢open equ *¢ sta iocb+10,x¢ lda #3¢ sta iocb+2,x¢ lda addr¢ sta iocb+4,x¢ lda addr+1¢ sta iocb+5,x¢ jsr ciov¢ bmi error¢ rts¢¢c_mem equ *¢ lda <mlo_¢ sta addr¢ lda >mlo_¢ sta addr+1¢ lda memlo¢ ldx memlo+1¢ jsr pwor¢ lda <mhi_¢ sta addr¢ lda >mhi_¢ sta addr+1¢ lda memhi¢ ldx memhi+1¢ jsr pwor¢ ldx <mem_¢ ldy >mem_¢ jmp putln¢¢xpth lda command,y¢ sta param,y¢ dey¢ bpl xpth¢¢c_path equ *¢ lda param¢ cmp #$9B¢ bne p15¢ jmp sntxer¢p15 lda param+1¢ cmp #$9B¢ bne p16¢ jmp sntxer¢p16 lda param+1¢ cmp #':'¢ bne p17¢ jmp sntxer¢p17 lda param+2¢ cmp #':'¢ beq p18¢ jmp sntxer¢p18 ldy #0¢p19 lda param,y¢ sta path,y¢ iny¢ cmp #$9B¢ bne p19¢_nrm lda path-2,y¢ cmp #':'¢ beq p20¢ lda #':'¢ sta path-1,y¢ lda #$9B¢ sta path,y¢p20 rts¢¢ras equ *¢ ldx #$10¢ jsr close¢ lda <enam_¢ sta addr¢ lda >enam_¢ sta addr+1¢ lda #12¢ jsr open¢ jmp close¢¢c_cls equ *¢ lda #125¢ jmp putchar¢¢c_cd equ *¢ lda param¢ cmp #$9B¢ bne p21¢ jmp sntxerr¢p21 cmp #'.'¢ bne p25¢ lda param+1¢ cmp #'.'¢ bne p25¢ lda param+2¢ cmp #$9B¢ bne p25¢ lda path+3¢ cmp #$9B¢ bne p22¢ jmp impsbl¢p22 ldy #0¢p23 lda path,y¢ iny¢ cmp #$9B¢ bne p23¢ dey¢ dey¢p24 dey¢ lda path,y¢ cmp #':'¢ bne p24¢ iny¢ lda #$9B¢ sta path,y¢ rts¢p25 ldy #0¢p26 lda path,y¢ iny¢ cmp #$9B¢ bne p26¢ dey¢ ldx #0¢p27 lda param,x¢ sta path,y¢ iny¢ inx¢ cmp #$9B¢ bne p27¢ jmp _nrm¢¢cpypth equ *¢ ldy #0¢p28 lda path,y¢ sta ctpath,y¢ iny¢ cmp #$9B¢ bne p28¢ dey¢ rts¢¢cpmpth equ *¢ ldx #0¢p29 lda param,x¢ sta ctpath,y¢ iny¢ inx¢ cmp #$9B¢ bne p29¢ rts¢¢c_dir equ *¢ jsr cpypth¢ lda param¢ cmp #$9B¢ beq *+8¢ jsr cpmpth¢ jmp p31¢ ldx #0¢p30 lda drmsk2,x¢ sta ctpath,y¢ inx¢ iny¢ cmp #$9B¢ bne p30¢¢p31 ldx #$70¢ lda <ctpath¢ sta addr¢ lda >ctpath¢ sta addr+1¢¢dir jsr eol¢ ldx #$70¢ jsr close¢ lda #6¢ jsr open¢p32 ldx #$70¢ lda <drnm_¢ ldy >drnm_¢ jsr _gtl¢ cpy #136¢ beq p33¢ ldx <drnm_¢ ldy >drnm_¢ jsr putln¢ bpl p32¢p33 ldx #$70¢ jmp close¢¢c_sdir equ *¢ lda ccode¢ cmp #24¢ beq p35¢ clc¢ adc #$21¢p34 sta dirmask+1¢ lda <dirmask¢ sta addr¢ lda >dirmask¢ sta addr+1¢ jmp dir¢p35 lda path+1¢ bne p34¢¢d_spc equ *¢ pha¢ lda param¢ cmp #$9B¢ bne p36¢ jmp sntxer¢p36 jsr cpypth¢ jsr cpmpth¢ ldx #$70¢ lda <ctpath¢ sta iocb+4,x¢ lda >ctpath¢ sta iocb+5,x¢ pla¢ sta iocb+2,x¢ jsr ciov¢ bpl p33¢ jmp error¢¢c_del equ *¢ lda #33¢ jsr d_spc¢ rts¢¢c_ren equ *¢ lda #32¢ jsr d_spc¢ rts¢¢c_lock equ *¢ lda #35¢ jsr d_spc¢ rts¢¢c_unl equ *¢ lda #36¢ jsr d_spc¢ rts¢¢c_md equ *¢ lda #42¢ jsr d_spc¢ rts¢¢c_view equ *¢ jsr *+4¢ rts¢ lda param¢ cmp #$9B¢ bne p37¢ jmp sntxerr¢p37 ldy #0¢p38 lda param,y¢ iny¢ cmp #$9B¢ beq p39¢ cmp #'@'¢ bne p38¢ lda #$9B¢ sta param-1,y¢ lda #1¢ sta dspflg¢p39 jsr cpypth¢ jsr cpmpth¢ jsr eol¢ ldx #$70¢ jsr close¢ lda <ctpath¢ sta addr¢ lda >ctpath¢ sta addr+1¢ lda #4¢ jsr open¢p40 ldx #$70¢ lda <drnm_¢ sta iocb+4,x¢ lda >drnm_¢ sta iocb+5,x¢ lda #1¢ sta iocb+8,x¢ lda #0¢ sta iocb+9,x¢ lda #7¢ sta iocb+2,x¢ jsr ciov¢ bpl p41¢ cpy #136¢ beq p42¢ jmp error¢p41 lda drnm_¢ jsr putchar¢ jmp p40¢p42 ldx #$70¢ jsr close¢ lda #0¢ sta dspflg¢ jmp eol¢¢c_mon jmp $E480¢¢binload equ *¢ ldy #0¢p43 lda command,y¢ iny¢ cmp #$9B¢ beq p44¢ cmp #'.'¢ beq p46¢ bne p43¢p44 dey¢ ldx #0¢p45 lda ext_,x¢ sta command,y¢ inx¢ iny¢ cmp #$9B¢ bne p45¢p46 jsr cpypth¢ ldx #0¢p47 lda command,x¢ sta ctpath,y¢ inx¢ iny¢ cmp #$9B¢ bne p47¢ ldx #$70¢ jsr close¢ lda <ctpath¢ sta iocb+4,x¢ lda >ctpath¢ sta iocb+5,x¢ lda #39¢ sta iocb+2,x¢ jsr ciov¢ bpl p48¢ jsr error¢p48 rts¢¢c_run equ *¢ lda param¢ cmp #$9B¢ beq p53¢ lda param+4¢ cmp #$9B¢ beq p49¢ jmp sntxer¢p49 ldy #0¢ sty runad¢ sty runad+1¢p50 lda param,y¢ cmp #'A'¢ bcc p51¢ sbc #7¢p51 sec¢ sbc #'0'¢ ora runad¢ sta runad¢ cpy #3¢ beq p53¢ ldx #3¢p52 asl runad¢ rol runad+1¢ dex¢ bpl p52¢ iny¢ bpl p50¢p53 jmp (runad)¢¢c_car equ * ;dead links¢c_sys equ *¢c_init equ *¢ rts¢¢brkctl equ *¢ pla¢ pla¢ sta lcnt¢ pla¢ sta addr¢ pla¢ sta addr+1¢ sec¢ lda addr¢ sbc #2¢ sta addr¢ lda addr+1¢ sbc #0¢ sta addr+1¢ lda addr¢ ldx addr+1¢ lda <bra_¢ sta addr¢ lda >bra_¢ sta addr+1¢ jsr pwor¢ lda #$9B¢ jsr putchar¢ ldx <break_¢ ldy >break_¢ jsr putln¢ lda >loop¢ pha¢ lda <loop¢ pha¢ lda lcnt¢ pha¢ rti¢¢dos equ *¢ jsr _init¢ lda <dos¢ sta dosrun¢ sta dosini¢ lda >dos¢ sta dosrun+1¢ sta dosini+1¢ lda <brkctl¢ sta vbreak¢ lda >brkctl¢ sta vbreak+1¢ lda <_end_¢ sta memlo¢ lda >_end_¢ sta memlo+1¢¢ jsr stdpth¢ jsr ras¢ jsr title¢loop jsr prompt¢ jsr getcmd¢ sta ccode¢ cmp #155¢ beq loop¢ cmp #$FF¢ bne l1¢ jsr binload¢ jmp loop¢l1 asl @¢ tax¢ jsr do¢ jmp loop¢¢do equ *¢ lda jmptab+1,x¢ pha¢ lda jmptab,x¢ pha¢ rts¢¢ brk¢¢_end_ equ *¢¢ org initad¢ dta a(dos)¢¢ end of file¢¢