亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ide.asm

?? 8051和8255一起控制硬盤讀寫的程序
?? ASM
?? 第 1 頁 / 共 2 頁
字號:
; Simple communication with an IDE disk drive; see http://www.pjrc.com/tech/8051/ide/ for more info; Modified, January 2005:;   - Update for rev 4/5 8051 development board;   - Fix hold time bug when writing to some drives;   - Improve reporting of drive's model/serial/revision;   - Added (commented out) status output while waiting for drive;   - Other minor cleanup;  This code is an original work by Paul Stoffregen, written;  in December 1999 (modified 2005).  This code has been placed;  in the ;  public domain.  You may use it without any restrictions.;  You may include it in your own projects, even commercial;  (for profit) products.;  This code is distributed in the hope that they will be useful,;  but without any warranty; without even the implied warranty of;  merchantability or fitness for a particular purpose..equ	location, 0x2100	;where this program will exist.equ	buffer, 0x3000		;a 512 byte buffer;------------------------------------------------------------------; Hardware Configuration;8255 chip.  Change these to specify where the 8255 is addressed,;and which of the 8255's ports are connected to which ide signals.;The first three control which 8255 ports have the control signals,;upper and lower data bytes.  The last two are mode setting for the;8255 to configure its ports, which must correspond to the way that;the first three lines define which ports are connected..equ	ide_8255_lsb, 0xF800	;lower 8 bits.equ	ide_8255_msb, 0xF801	;upper 8 bits.equ	ide_8255_ctl, 0xF802	;control lines.equ	cfg_8255, 0xF803.equ	rd_ide_8255, 10010010b	;ide_8255_ctl out, ide_8255_lsb/msb input.equ	wr_ide_8255, 10000000b	;all three ports output;ide control lines for use with ide_8255_ctl.  Change these 8;constants to reflect where each signal of the 8255 each of the;ide control signals is connected.  All the control signals must;be on the same port, but these 8 lines let you connect them to;whichever pins on that port..equ	ide_a0_line, 0x01	;direct from 8255 to ide interface.equ	ide_a1_line, 0x02	;direct from 8255 to ide interface.equ	ide_a2_line, 0x04	;direct from 8255 to ide interface.equ	ide_cs0_line, 0x08	;inverter between 8255 and ide interface.equ	ide_cs1_line, 0x10	;inverter between 8255 and ide interface.equ	ide_wr_line, 0x20	;inverter between 8255 and ide interface.equ	ide_rd_line, 0x40	;inverter between 8255 and ide interface.equ	ide_rst_line, 0x80	;inverter between 8255 and ide interface;------------------------------------------------------------------; More symbolic constants... these should not be changed, unless of; course the IDE drive interface changes, perhaps when drives get; to 128G and the PC industry will do yet another kludge.;some symbolic constants for the ide registers, which makes the;code more readable than always specifying the address pins.equ	ide_data,	ide_cs0_line.equ	ide_err,	ide_cs0_line + ide_a0_line.equ	ide_sec_cnt,	ide_cs0_line + ide_a1_line.equ	ide_sector,	ide_cs0_line + ide_a1_line + ide_a0_line.equ	ide_cyl_lsb,	ide_cs0_line + ide_a2_line.equ	ide_cyl_msb,	ide_cs0_line + ide_a2_line + ide_a0_line.equ	ide_head,	ide_cs0_line + ide_a2_line + ide_a1_line.equ	ide_command,	ide_cs0_line + ide_a2_line + ide_a1_line + ide_a0_line.equ	ide_status,	ide_cs0_line + ide_a2_line + ide_a1_line + ide_a0_line.equ	ide_control,	ide_cs1_line + ide_a2_line + ide_a1_line.equ	ide_astatus,	ide_cs1_line + ide_a2_line + ide_a1_line + ide_a0_line;IDE Command Constants.  These should never change..equ	ide_cmd_recal, 0x10.equ	ide_cmd_read, 0x20.equ	ide_cmd_write, 0x30.equ	ide_cmd_init, 0x91.equ	ide_cmd_id, 0xEC.equ	ide_cmd_spindown, 0xE0.equ	ide_cmd_spinup, 0xE1;------------------------------------------------------------------;internal ram usage.equ	lba, 0x10		;4 bytes, 28 bit Logical Block Address.equ	stack, 0x40;routines within paulmon2.  To make this code stand-alone, just copy;and paste these bits of code from the paulmon2.asm file..equ    cout, 0x0030            ;Send Acc to serial port.equ    cin, 0x0032             ;Get Acc from serial port.equ    phex, 0x0034            ;Print Hex value of Acc.equ    pstr, 0x0038            ;Print string pointed to by DPTR,.equ    upper, 0x0040           ;Convert Acc to uppercase.equ    newline, 0x0048         ;print CR/LF (13 and 10).equ    pint8u, 0x004D          ;print Acc at an integer, 0 to 255.equ    pint16u, 0x0053         ;print DPTR as an integer, 0 to 65535.equ    cin_filter, 0x0062      ;get a character, but look for esc sequences;------------------------------------------------------------------; Main Program, a simple menu driven interface..org	location.db     0xA5,0xE5,0xE0,0xA5     ;signiture bytes.db     35,255,0,0              ;id, 35=program.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;reserved.db     0,0,0,0                 ;user defined.db     255,255,255,255         ;length and checksum (255=unused).db     "IDE Disk Drive Test",0.org    location+64             ;executable code begins herebegin:	mov	sp, #stack	mov	dptr, #msg_1	;print a welcome message	lcall	pstr	;reset the drive	acall	ide_hard_reset	;initialize the drive.  If there is no drive, this may hang	acall	ide_init	;get the drive id info.  If there is no drive, this may hang	acall	drive_id	; print the drive's model number	mov	dptr, #msg_mdl	lcall	pstr	mov	dptr, #buffer + 54	mov	r0, #20	acall	print_name	lcall	newline	; print the drive's serial number	mov	dptr, #msg_sn	lcall	pstr	mov	dptr, #buffer + 20	mov	r0, #10	acall	print_name	lcall	newline	; print the drive's firmware revision string	mov	dptr, #msg_rev	lcall	pstr	mov	dptr, #buffer + 46	mov	r0, #4	acall	print_name	lcall	newline	; print the drive's cylinder, head, and sector specs	mov	dptr, #msg_cy	lcall	pstr	mov	dptr, #buffer + 2	acall	print_parm	mov	dptr, #msg_hd	lcall	pstr	mov	dptr, #buffer + 6	acall	print_parm	mov	dptr, #msg_sc	lcall	pstr	mov	dptr, #buffer + 12	acall	print_parm	lcall	newline	lcall	newline	; default position will be first block (master boot record)	clr	a	mov	lba+0, a	mov	lba+1, a	mov	lba+2, a	mov	lba+3, amain_loop:				;print a 1-line prompt	mov	dptr, #msg_l	lcall	pstr	mov	a, lba+3	lcall	phex	mov	a, lba+2	lcall	phex	mov	a, lba+1	lcall	phex	mov	a, lba+0	lcall	phex	mov	dptr, #msg_pmt	lcall	pstr	lcall	cin	lcall	uppermain1:	cjne	a, #'R', main2		;read a sector	acall	read_sector	jz	main1b	push	acc	mov	dptr, #msg_err	lcall	pstr	pop	acc	lcall	phex	lcall	newline	ajmp	main_loopmain1b:	mov	dptr, #msg_rd	lcall	pstr	ajmp	main_loopmain2:	cjne	a, #'W', main3		;write a sector	mov	dptr, #msg_sure	lcall	pstr	lcall	cin	lcall	upper	cjne	a, #'Y', main2c	acall	write_sector	jz	main2b	push	acc	mov	dptr, #msg_err	lcall	pstr	pop	acc	lcall	phex	lcall	newline	ajmp	main_loopmain2b:	mov	dptr, #msg_wr	lcall	pstrmain2c: ajmp	main_loopmain3:	cjne	a, #'L', main4		;set the logical block address	mov	dptr, #msg_cyh	lcall	pstr	lcall	ghex32_lba	jc	main3b	mov	lba+0, r3	mov	lba+1, r4	mov	lba+2, r5	mov	lba+3, r6main3b:	lcall	newline	ajmp	main_loopmain4:	cjne	a, #'U', main5		;cause the drive to spin up	acall	spinup	ajmp	main_loopmain5:	cjne	a, #'D', main6		;cause the drive to spin down	acall	spindown	ajmp	main_loopmain6:	cjne	a, #'Q', main7		;quit	ljmp	0main7:	cjne	a, #'H', main8	acall	hexdump	ajmp	main_loopmain8:	ajmp	main_loopmsg_1:	.db	"IDE Disk Drive Test Program",13,10,13,10,0msg_mdl:.db	"Model: ",0msg_sn: .db	"S/N:   ",0msg_rev:.db	"Rev:   ",0msg_cy:	.db	"Cylinders: ", 0msg_hd:	.db	", Heads: ", 0msg_sc:	.db	", Sectors: ", 0msg_cyh:.db	"Enter LBA (in hex): ", 0msg_l:	.db	"LBA=0x",0msg_pmt:.db	", (R)ead (W)rite (L)BA (U)p (D)own (H)exdump (Q)uit",13,10,0msg_sure:.db	"Warning: this will change data on the drive, are you sure?",13,10,0msg_rd:	.db	"Sector Read OK",13,10,0msg_wr:	.db	"Sector Write OK",13,10,0msg_err:.db	"Error, code = ",0;------------------------------------------------------------------; Routines that talk with the IDE drive, these should be called by; the main program.	;read a sector, specified by the 4 bytes in "lba",	;Return, acc is zero on success, non-zero for an errorread_sector:	acall	ide_wait_not_busy	;make sure drive is ready	acall	wr_lba			;tell it which sector we want	mov	a, #ide_command	mov	r2, #ide_cmd_read	acall	ide_wr_8		;ask the drive to read it	acall	ide_wait_drq		;wait until it's got the data	jb	acc.0, get_err	mov	dptr, #buffer	acall	read_data		;grab the data	clr	a	ret	;when an error occurs, we get acc.0 set from a call to ide_drq	;or ide_wait_not_busy (which read the drive's status register).  If	;that error bit is set, we should jump here to read the drive's	;explaination of the error, to be returned to the user.  If for	;some reason the error code is zero (shouldn't happen), we'll	;return 255, so that the main program can always depend on a	;return of zero to indicate success.get_err:mov	a, #ide_err	acall	ide_rd_8	mov	a, r2	jz	gerr2	retgerr2:	mov	a, #255	ret	;write a sector, specified by the 4 bytes in "lba",	;whatever is in the buffer gets written to the drive!	;Return, acc is zero on success, non-zero for an errorwrite_sector:	acall	ide_wait_not_busy	;make sure drive is ready	acall	wr_lba			;tell it which sector we want	mov	a, #ide_command	mov	r2, #ide_cmd_write	acall	ide_wr_8		;tell drive to write a sector	acall	ide_wait_drq		;wait unit it wants the data	jb	acc.0, get_err	mov	dptr, #buffer	acall	write_data		;give the data to the drive	acall	ide_wait_not_busy	;wait until the write is complete	jb	acc.0, get_err	clr	a	ret	;do the identify drive command, and return with the buffer	;filled with info about the drivedrive_id:	acall	ide_wait_not_busy	mov	a, #ide_head	mov	r2, #10100000b	acall	ide_wr_8		;select the master device	acall	ide_wait_ready	mov	a, #ide_command	mov	r2, #0xEC	acall	ide_wr_8		;issue the command	acall	ide_wait_drq	mov	dptr, #buffer	acall	read_data	ret	;tell the drive to spin upspinup:	mov	r2, #ide_cmd_spinupspup2:	mov	a, #ide_command	acall	ide_wr_8	acall	ide_wait_not_busy	ret	;tell the drive to spin downspindown:	acall	ide_wait_not_busy	mov	r2, #ide_cmd_spindown	sjmp	spup2	;initialize the ide driveide_init:	mov	a, #ide_head	mov	r3, #0	mov	r2, #10100000b	acall	ide_wr_8		;select the master device	mov	a, #ide_status	acall	ide_rd_8	 ; uncomment these if the code hangs, waiting forever for	 ; the drive to respond.  This will at least let you see	 ; where it's waiting, and the value of the status register	 ;mov	a, #'*'	 ;lcall	cout	 ;mov	a, r2	 ;lcall	phex	mov	a, r2	;should probably check for a timeout here	jnb	acc.6, ide_init		;wait for RDY bit to be set	jb	acc.7, ide_init		;wait for BSY bit to be clear	; uncomment this section if you have a very old hard drive	; (probably win3.1 or early win95 era) that does not even	; allow LBA accesses until these CHS parameters are set up	;mov	a, #ide_head	;mov	r2, #10101111b	;acall	ide_wr_8		;what should this config parm be?	;mov	a, #ide_sec_cnt	;mov	r2, #64	;acall	ide_wr_8		;what should this config parm be?	;mov	a, #ide_command	;mov	r2, #ide_cmd_init	;acall	ide_wr_8		;do init parameters command	;acall	ide_wait_not_busy	;mov	a, #ide_command	ret; IDE Status Register:;  bit 7: Busy	1=busy, 0=not busy;  bit 6: Ready 1=ready for command, 0=not ready yet

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲日产国码二区| 亚洲欧美综合网| 99热精品一区二区| 蜜桃精品视频在线| 亚洲日本丝袜连裤袜办公室| 日韩欧美亚洲国产精品字幕久久久 | 日韩欧美黄色影院| 一本色道久久加勒比精品| 狠狠色综合色综合网络| 天涯成人国产亚洲精品一区av| 欧美激情在线免费观看| 欧美成人aa大片| 欧美日本国产一区| 91在线观看一区二区| 国产麻豆成人精品| 久久成人羞羞网站| 天天色天天爱天天射综合| 亚洲男人的天堂av| 国产欧美日韩不卡| 久久久精品一品道一区| 日韩一区二区三区免费看| 欧美性生交片4| 在线亚洲人成电影网站色www| 成人三级在线视频| 国产精品一区2区| 国内精品久久久久影院色| 日韩av网站免费在线| 五月婷婷另类国产| 亚洲成年人影院| 亚洲成年人网站在线观看| 亚洲亚洲人成综合网络| 亚洲综合在线免费观看| 亚洲男人天堂av| 亚洲美女屁股眼交| 亚洲激情男女视频| 洋洋av久久久久久久一区| 一区二区三区四区不卡视频| 亚洲欧美另类在线| 亚洲激情成人在线| 亚洲一二三四在线观看| 亚洲一区二区三区激情| 亚洲国产另类精品专区| 一区二区三区免费| 亚洲国产精品一区二区久久恐怖片 | 欧美日韩一卡二卡三卡 | 国产精品1024| 国产盗摄视频一区二区三区| 国产在线精品不卡| 成人永久免费视频| 91黄色激情网站| 欧美色图天堂网| 777久久久精品| 日韩美女一区二区三区| 欧美精品一区二区在线播放 | 久久人人超碰精品| 国产精品麻豆久久久| 亚洲视频免费观看| 亚洲国产精品天堂| 美女网站一区二区| 成人午夜激情片| 91久久精品国产91性色tv| 欧美日免费三级在线| 日韩女优毛片在线| 国产精品天美传媒| 一区二区三区国产豹纹内裤在线 | 精品一区二区三区在线观看国产| 国产米奇在线777精品观看| a级精品国产片在线观看| 欧亚洲嫩模精品一区三区| 欧美一级一区二区| 国产日产精品一区| 亚洲国产日日夜夜| 国产精品中文有码| 在线观看免费视频综合| 欧美videos大乳护士334| 亚洲欧洲成人自拍| 日本va欧美va精品发布| 成人av资源在线| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产精品久久久久久妇女6080| 亚洲最色的网站| 国产寡妇亲子伦一区二区| 91久久久免费一区二区| 精品99一区二区| 亚洲乱码国产乱码精品精的特点| 奇米综合一区二区三区精品视频| 成人动漫一区二区| 欧美精品在线观看播放| 国产精品丝袜91| 久久99国产精品麻豆| 91久久精品一区二区二区| 久久久久久久综合色一本| 午夜精品成人在线| www.av精品| 久久美女高清视频| 天天做天天摸天天爽国产一区 | 图片区小说区区亚洲影院| 成人午夜在线播放| 欧美va天堂va视频va在线| 亚洲精品欧美二区三区中文字幕| 韩国中文字幕2020精品| 欧美日韩免费一区二区三区| 国产精品免费观看视频| 蜜桃一区二区三区在线观看| 91激情在线视频| 国产精品人成在线观看免费 | 青青草成人在线观看| 99r精品视频| 国产视频911| 国产综合久久久久影院| 欧美精品99久久久**| 一区二区三区高清| 91蝌蚪porny| 18欧美亚洲精品| 成人综合在线观看| 国产女主播在线一区二区| 久久国产精品第一页| 制服丝袜激情欧洲亚洲| 亚洲成av人片在线观看无码| 91麻豆精品一区二区三区| 国产精品久久久久久久久久免费看| 国产在线精品一区二区不卡了| 欧美一级二级三级蜜桃| 午夜av电影一区| 欧美日韩一级黄| 午夜精品福利在线| 欧美精品在线观看播放| 午夜精品一区二区三区三上悠亚| 日本道精品一区二区三区| 玉米视频成人免费看| 色综合咪咪久久| 亚洲一区二区av在线| 欧美性高清videossexo| 亚洲午夜久久久久久久久久久| 日本韩国欧美一区| 一区二区三区视频在线看| 欧美午夜电影一区| 午夜成人免费电影| 日韩亚洲欧美成人一区| 日本不卡在线视频| 91精品国产综合久久精品性色| 七七婷婷婷婷精品国产| 久久综合色8888| 国产成人午夜精品影院观看视频 | 国产a精品视频| 国产精品看片你懂得| 99精品欧美一区二区三区小说| 国产精品动漫网站| 91麻豆免费观看| 婷婷中文字幕综合| 欧美精品一区二区三区很污很色的| 精品在线免费视频| 国产精品成人网| 在线免费视频一区二区| 五月婷婷欧美视频| 欧美videos中文字幕| 丁香婷婷综合激情五月色| 中文字幕一区二区三区视频 | 91丨porny丨在线| 亚洲图片欧美综合| 欧美成人vps| 成人黄色软件下载| 一区二区三区在线高清| 欧美一二三区精品| 成人国产在线观看| 亚洲一区二区欧美| 久久久久亚洲综合| 色偷偷成人一区二区三区91| 婷婷丁香久久五月婷婷| 国产三区在线成人av| 日本韩国一区二区三区视频| 日本va欧美va精品| 中文字幕日韩欧美一区二区三区| 欧美日韩视频不卡| 国产成人精品亚洲日本在线桃色| 一区二区三区在线播放| 欧美精品一区二区久久婷婷| 91女厕偷拍女厕偷拍高清| 日本中文字幕不卡| 国产精品动漫网站| 日韩一区二区三| 91亚洲国产成人精品一区二区三| 日韩专区在线视频| 国产精品免费aⅴ片在线观看| 欧洲一区二区三区在线| 国产成人亚洲综合a∨婷婷 | 久久精品视频在线免费观看| 欧美日韩综合在线免费观看| 国产高清不卡二三区| 午夜精品影院在线观看| 亚洲欧洲在线观看av| 欧美成人伊人久久综合网| 色综合欧美在线| 国产精品一区免费视频| 婷婷综合久久一区二区三区| 国产精品国产三级国产普通话蜜臀 | 成人性生交大片免费看在线播放 | 欧美xxxx在线观看| 欧美三日本三级三级在线播放| 国产不卡免费视频|