Tao ham macro trong keil cho 8051
xin cac cao thu chi giao cho em (ngohaibac ,queduong,MicroDuyphi ....)
em viet chuong trinh cho 8051 bang ngon ngu assembler tren KEIL
tao ham macro trong file co ten: HAM_MACRO.asm
viet chuong trinh thu 2 co ten goi la: MAIN.asm
ca hai chuong trinh deu o trong 1 project
lam sao de em goi duoc ham macro trong ct HAM_MACRO tu ct MAIN ?
(o trong file nay goi ham macro trong file kia)
neu dung chi dan public & exturn chi goi duoc bang lenh call (lcall) thoi chu khong goi ten ham macro duoc
vi du :
day la chuong trinh trong file main.asm :
;exturn code (push_dprt,pop_dprt) ;thu dung ham nay nhung khong duoc
org 0000
tiep:
push_dptr ;goi ham macro push_dptr
pop_dptr ;goi ham macro pop_dptr
sjmp tiep
end
sau day la ct thu 2
file ham_macro.asm nhu sau :
;public push_dprt,pop_dprt ; thu dung ham nay nhung khong duoc
push_dprt macro
push dph
push dpl
endm
pop_dprt macro
pop dpl
pop dph
endm
end
mong cac ban trong dien dan chi giup
xin cam on cac ban !
xin cac cao thu chi giao cho em (ngohaibac ,queduong,MicroDuyphi ....)
em viet chuong trinh cho 8051 bang ngon ngu assembler tren KEIL
tao ham macro trong file co ten: HAM_MACRO.asm
viet chuong trinh thu 2 co ten goi la: MAIN.asm
ca hai chuong trinh deu o trong 1 project
lam sao de em goi duoc ham macro trong ct HAM_MACRO tu ct MAIN ?
(o trong file nay goi ham macro trong file kia)
neu dung chi dan public & exturn chi goi duoc bang lenh call (lcall) thoi chu khong goi ten ham macro duoc
vi du :
day la chuong trinh trong file main.asm :
;exturn code (push_dprt,pop_dprt) ;thu dung ham nay nhung khong duoc
org 0000
tiep:
push_dptr ;goi ham macro push_dptr
pop_dptr ;goi ham macro pop_dptr
sjmp tiep
end
sau day la ct thu 2
file ham_macro.asm nhu sau :
;public push_dprt,pop_dprt ; thu dung ham nay nhung khong duoc
push_dprt macro
push dph
push dpl
endm
pop_dprt macro
pop dpl
pop dph
endm
end
mong cac ban trong dien dan chi giup
xin cam on cac ban !
Comment