📄 anasm.asm
字号:
add word[pointer_read],cx
mov di,buffer_bef2
mov si,word[pointer_read]
call parse_line
add word[pointer_read],cx
cmp byte[failure],0
jne near .error_opcode
mov si,buffer_bef1
call translate_16bit_reg
cmp al,0xff
jne .op_arpl@reg
mov di,op_word
cmpsd
je .op_arpl@var
jmp near .end
.op_arpl@reg
mov dl,al
mov si,buffer_bef2
call translate_16bit_reg
cmp al,0xff
je near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0x63
inc si
shl al,3
or al,dl
or al,11000000b
mov byte[gs:si],al
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_arpl@var
call test_clips
and al,al
jnz near .error_no_clips
call format_address_16bit
cmp ax,0xffff
jne .op_arpl@addr
call look4label
and al,al
jnz near .error_label
mov si,buffer_bef2
call translate_16bit_reg
cmp al,0xff
je near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0x63
inc si
shl al,3
or al,6
mov byte[gs:si],al
inc si
add word[pointer_write],2
add word[act_offset],2
cmp bx,-1
je .op_arpl@var@no_offset
call .asm@offset
jmp near .end
.op_arpl@var@no_offset
mov al,1
call add_offset2offset_table
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_arpl@addr
mov bx,ax
mov si,buffer_bef2
call translate_16bit_reg
cmp al,0xff
je near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],bl
inc si
mov byte[gs:si],0x63
inc si
shl al,3
or al,bh
mov byte[gs:si],al
add word[pointer_write],3
add word[act_offset],3
jmp near .end
.op_enter
mov di,op_enter
call string_cmp
and ax,ax
jnz near .op_imul
mov si,word[pointer_read]
mov di,buffer_bef1
call parse_line
add word[pointer_read],cx
mov si,word[pointer_read]
mov di,buffer_bef2
call parse_line
add word[pointer_read],cx
cmp byte[failure],0
jne near .error_opcode
mov si,buffer_bef1
call format_numbers_16bit
jc near .error_opcode
mov bx,ax
mov si,buffer_bef2
call format_numbers_8bit
jc near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0xc8
inc si
mov word[gs:si],bx
add si,2
mov byte[gs:si],al
add word[pointer_write],4
add word[act_offset],4
jmp near .end
.op_imul
mov di,op_imul
call string_cmp
and ax,ax
jnz near .op_in
mov si,word[pointer_read]
mov di,buffer_opcode
call parse_line
add word[pointer_read],cx
cmp byte[failure],0
jne .op_imul@1operand
jmp near .end
.op_imul@1operand
jmp near .end
.op_in
mov di,op_in
call string_cmp
and ax,ax
jnz near .op_out
mov si,word[pointer_read]
mov di,buffer_bef1
call parse_line
add word[pointer_read],cx
mov si,word[pointer_read]
mov di,buffer_bef2
call parse_line
add word[pointer_read],cx
cmp byte[failure],0
jne near .error_opcode
mov si,buffer_bef1
call translate_8bit_reg
and al,al
jz .op_in@byte
call translate_16bit_reg
and al,al
jz .op_in@word
call translate_32bit_reg
and al,al
jz .op_in@dword
jmp near .error_opcode
.op_in@byte
mov si,buffer_bef2
call format_numbers_8bit
jc .op_in@byte@dx
mov si,word[pointer_write]
mov ah,0e4h
xchg al,ah
mov word[gs:si],ax
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_in@byte@dx
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0ech
inc word[pointer_write]
inc word[act_offset]
jmp near .end
.op_in@word
mov si,buffer_bef2
call format_numbers_8bit
jc .op_in@word@dx
mov si,word[pointer_write]
mov ah,0e5h
xchg al,ah
mov word[gs:si],ax
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_in@word@dx
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0edh
inc word[pointer_write]
inc word[act_offset]
jmp near .end
.op_in@dword
mov si,buffer_bef2
call format_numbers_8bit
jc .op_in@dword@dx
mov si,word[pointer_write]
mov word[gs:si],0x0e566
add si,2
mov byte[gs:si],al
add word[pointer_write],3
add word[act_offset],3
jmp near .end
.op_in@dword@dx
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov word[gs:si],0xed66
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_out
mov di,op_out
call string_cmp
and ax,ax
jnz near .asm_opcodes
mov si,word[pointer_read]
mov di,buffer_bef1
call parse_line
add word[pointer_read],cx
mov si,word[pointer_read]
mov di,buffer_bef2
call parse_line
add word[pointer_read],cx
cmp byte[failure],0
jne near .error_opcode
mov si,buffer_bef2
call translate_8bit_reg
and al,al
jz .op_out@byte
call translate_16bit_reg
and al,al
jz .op_out@word
call translate_32bit_reg
and al,al
jz .op_out@dword
jmp near .error_opcode
.op_out@byte
mov si,buffer_bef1
call format_numbers_8bit
jc .op_out@byte@al
mov si,word[pointer_write]
mov ah,0e6h
xchg al,ah
mov word[gs:si],ax
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_out@byte@al
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0eeh
inc word[pointer_write]
inc word[act_offset]
jmp near .end
.op_out@word
mov si,buffer_bef1
call format_numbers_8bit
jc .op_out@word@ax
mov si,word[pointer_write]
mov ah,0e7h
xchg al,ah
mov word[gs:si],ax
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.op_out@word@ax
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov byte[gs:si],0efh
inc word[pointer_write]
inc word[act_offset]
jmp near .end
.op_out@dword
mov si,buffer_bef1
call format_numbers_8bit
jc .op_out@dword@eax
mov si,word[pointer_write]
mov word[gs:si],0x0e766
add si,2
mov byte[gs:si],al
add word[pointer_write],3
add word[act_offset],3
jmp near .end
.op_out@dword@eax
call translate_16bit_reg
cmp al,2
jne near .error_opcode
mov si,word[pointer_write]
mov word[gs:si],0xef66
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.asm_opcodes
.instruc_set0
mov di,instruction_set0
.loop_set0
cmp di,instruction_set1
je .instruc_set1
call string_cmp
push si
mov si,di
call string_len
pop si
add di,cx
and ax,ax
jz .asm_set0
.loop_set0@1
add di,2
jmp .loop_set0
.asm_set0
inc di
push di
mov si,word[pointer_read]
mov di,buffer_bef1
call parse_line
add word[pointer_read],cx
pop di
cmp byte[failure],0
jne near .error_opcode
push di
mov si,word[pointer_read]
mov di,buffer_bef2
call parse_line
add word[pointer_read],cx
pop di
cmp byte[failure],0
je near .error_opcode
mov byte[failure],0
mov si,word[pointer_write]
.asm_set0@loop
mov al,byte[es:di]
mov byte[gs:si],al
inc word[pointer_write]
inc word[act_offset]
mov si,buffer_bef1
.instruc_set1
mov di,instruction_set1
.loop_set1
cmp di,instruction_set2
je .instruc_set2
call string_cmp
push si
mov si,di
call string_len
pop si
add di,cx
and ax,ax
jz .asm_set1
.loop_set1@1
mov al,byte[es:di]
inc di
and al,al
jz .loop_set1
jmp .loop_set1@1
.asm_set1
inc di
mov si,word[pointer_write]
.asm_set1@loop
mov al,byte[es:di]
inc di
and al,al
jz near .end
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
jmp short .asm_set1@loop
.instruc_set2
mov di,instruction_set2
.loop_set2
cmp di,instruction_set3
je near .instruc_set3
call string_cmp
push si
mov si,di
call string_len
pop si
add di,cx
and ax,ax
jz .asm_set2
.loop_set2@1
mov al,byte[es:di]
inc di
and al,al
jz .loop_set2
jmp .loop_set2@1
.asm_set2
inc di
push di
mov di,buffer_bef1
mov si,word[pointer_read]
call parse_line
add word[pointer_read],cx
pop di
cmp byte[failure],0
jne near .error_opcode
push di
mov si,buffer_bef1
mov di,op_byte
cmpsd
pop di
je near .asm_set2@var_byte
push di
mov si,buffer_bef1
mov di,op_word
cmpsd
pop di
je near .asm_set2@var_word
push di
mov si,buffer_bef1
mov di,op_dword
mov cx,5
rep cmpsb
pop di
je near .asm_set2@var_dword
mov si,buffer_bef1
call translate_8bit_reg
cmp al,0xff
jne .asm_set2@reg8bit
call translate_16bit_reg
cmp al,0xff
jne .asm_set2@reg16bit
call translate_32bit_reg
cmp al,0xff
je near .error_opcode
.asm_set2@reg32bit
mov si,word[pointer_write]
push ax
mov ah,0x66
mov al,byte[es:di]
inc di
inc al
xchg al,ah
mov word[gs:si],ax
add si,2
add word[pointer_write],2
add word[act_offset],2
jmp short .asm_set2@reg_asm
.asm_set2@reg16bit
mov si,word[pointer_write]
push ax
mov al,byte[es:di]
inc di
inc al
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
jmp short .asm_set2@reg_asm
.asm_set2@reg8bit
mov si,word[pointer_write]
push ax
mov al,byte[es:di]
inc di
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
.asm_set2@reg_asm
mov bl,byte[es:di]
inc di
pop ax
shl bl,3
or al,bl
or al,11000000b
mov byte[gs:si],al
inc word[pointer_write]
inc word[act_offset]
jmp near .end
.asm_set2@var_byte
mov si,buffer_bef1
add si,4
call test_clips
and al,al
jnz near .error_no_clips
call format_address_16bit
cmp ax,0xffff
jne .asm_set2@var_byte@addr
call look4label
and al,al
jne near .error_label
mov si,word[pointer_write]
mov al,byte[es:di]
inc di
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
jmp near .asm_set2@var_asm
.asm_set2@var_byte@addr
mov bx,ax
mov al,byte[es:di]
inc di
mov ah,byte[es:di]
mov si,word[pointer_write]
mov byte[gs:si],bl
inc si
mov byte[gs:si],al
inc si
shl ah,3
or ah,bh
mov byte[gs:si],ah
add word[pointer_write],3
add word[act_offset],3
jmp near .end
.asm_set2@var_word
mov si,buffer_bef1
mov si,buffer_bef1
add si,4
call test_clips
and al,al
jnz near .error_no_clips
call format_address_16bit
cmp ax,0xffff
jne .asm_set2@var_word@addr
call look4label
and al,al
jne near .error_label
mov si,word[pointer_write]
mov al,byte[es:di]
inc di
inc al
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
jmp near .asm_set2@var_asm
.asm_set2@var_word@addr
mov bx,ax
mov al,byte[es:di]
inc di
mov ah,byte[es:di]
mov si,word[pointer_write]
mov byte[gs:si],bl
inc si
inc al
mov byte[gs:si],al
inc si
shl ah,3
or ah,bh
mov byte[gs:si],ah
add word[pointer_write],3
add word[act_offset],3
jmp near .end
.asm_set2@var_dword
mov si,buffer_bef1
add si,5
call test_clips
and al,al
jnz near .error_no_clips
call format_address_16bit
cmp ax,0xffff
jne .asm_set2@var_dword@addr
call look4label
and al,al
jne near .error_label
mov si,word[pointer_write]
mov ah,0x66
mov al,byte[es:di]
inc di
inc al
xchg al,ah
mov word[gs:si],ax
add si,2
add word[pointer_write],2
add word[act_offset],2
jmp short .asm_set2@var_asm
.asm_set2@var_dword@addr
mov bx,ax
mov al,byte[es:di]
inc di
mov ah,byte[es:di]
mov si,word[pointer_write]
mov byte[gs:si],bl
inc si
mov byte[gs:si],0x66
inc si
inc al
mov byte[gs:si],al
inc si
shl ah,3
or ah,bh
mov byte[gs:si],ah
add word[pointer_write],4
add word[act_offset],4
jmp near .end
.asm_set2@var_asm
mov al,byte[es:di]
inc di
shl al,3
or al,00000110b
mov byte[gs:si],al
inc si
inc word[pointer_write]
inc word[act_offset]
cmp bx,-1
je .asm_set2@var@no_offset
call .asm@offset
jmp near .end
.asm_set2@var@no_offset
mov al,1
call add_offset2offset_table
add word[pointer_write],2
add word[act_offset],2
jmp near .end
.instruc_set3
mov di,instruction_set3
.loop_set3
cmp di,instruction_set4
je near .instruc_set4
call string_cmp
push si
mov si,di
call string_len
pop si
add di,cx
and ax,ax
jz .asm_set3
.loop_set3@1
mov al,byte[es:di]
inc di
and al,al
jz .loop_set3
jmp .loop_set3@1
.asm_set3
inc di
push di
mov si,word[pointer_read]
mov di,buffer_bef1
call parse_line
add word[pointer_read],cx
pop di
cmp byte[failure],0
jne near .error_opcode
mov si,buffer_bef1
call translate_8bit_reg
cmp al,0xff
jne near .asm_set3@reg
push di
mov di,op_byte
cmpsd
pop di
je .asm_set3@var
jmp near .error_opcode
.asm_set3@var
call test_clips
and al,al
jnz near .error_no_clips
call format_address_16bit
cmp ax,0xffff
jne .asm_set3@addr
call look4label
and al,al
jne near .error_label
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -