星期四, 3月 12, 2009

Nokia 5800 mac address 尋找方法

基於確保無線網絡的安全,大部份無線網絡需要透過核對設備的MAC地址後才讓使用者連到網絡。但nokia 5800 xpressmusic 如何才能找到它的MAC地址?


1. 於機盒貼紙上標明

2. 輸入 *#62209526#

星期六, 3月 07, 2009

ESDA 安裝失敗

ESDA 可以說是 APASO 的新版本。

本來安裝EDB的ESDA一切正常,但到最後卻顯示了以下訊息:

make_sock: could not bind to port 0.0.0.0:80

No installed service named"Apache2"


初時懷疑是安裝設定問題,後來曾經嘗試重裝但情況一樣。
因為本機沒有安裝iis所以應該不會佔用 port 80,
但於 "執行" 中輸入 cmd,再輸入netstat -anb,
便發現有其他程式佔用了 port 80。

關掉該程序後,於命令提示字元cd至Apache的資料夾

cd C:\Program Files\Apache Group\Apache2
cd bin
apache -k install
apache -k start



這樣便成功了。

星期五, 3月 06, 2009

EE3120 (B) MP & ASSEMBLY LANGUAGE PROG (02EE3120) Quiz 3 Solution

Quiz 3 (Total 60 marks)

1.

Show the stack and stack content for the following code:

003B 120300 LCALL DELAY
003E 80F0 BACK: SJMP BACK ;keep doing this
0040
0040 ;----------------------this is the delay subroutine
0500 ORG 500H
0500 DELAY:
0500 7DFF MOV R5,#0FFH ;R5=255
0502 DDFE AGAIN: DJNZ R5,AGAIN ;stay here
0504 22 RET ;return [10 marks]

Ans:
Stack /Stack Content

003B 120300 / 09 / 00 3E
003E 80F0 /07
0040 /?
0040 /?
0500 /09 /00 3E
0500 /09 /00 3E
0500 7DFF /09 /00 3E
0502 DDFE /09 /00 3E
0504 22 /07


2. Find the value (in hex) loaded into TH in each of the following.
(a) MOV TH0,#110
(b) MOV TH0,#-30
[10 marks]
(a) 6EH

(b) E2H


3. Given the LCD command write routine COMNWRT. Assume connections P2.1 = RS, P2.2 =R/W, P2.3 = E, write i) a program to call the display the data and ii) a subroutine to display the data (iii) the data "Hello" is checked again its completion of write by a busy flag connected to P2.7. Use the instruction MOVC.
.
[20 marks]
Ans:

MAIN:
MOV DPTR, #MYDATA
HERE:
CLR A
MOVC A, @A+DPTR
JZ DONE
ACALL DISPLAY_DATA
INC DPTR
SJMP HERE
DONE: SJMP DONE [10 marks]

DISPLAY_DATA:
ACALL READY
MOV P1,A ; port 1 fort DATA
SETB P2.1 ;RS=1 FOR Control DATA
CLR P2.2 ;R/W=0 FOR Control WRITE
SETB P2.3 ;H-TO-L FOR Control Enable
CLR P2.3
RET
READY:
SETB P2.7
CLR P2.1
SETB P2.2
BACK:
CLR P2.3
SETB P2.3
CLR P2.3
JB P2.7, BACK
RET [10 marks]

;P2.7=INPUT TO READ BUSY FLAG
;RS=0
;R/W=-1 FOR READ
ORG 300H
MYDATA: DB "Hello",0

ORG 400H
COMNWRT:
MOV P2,A
CLR P2.1
CLR P2.2
SETB P2.3
CLR P2.3
RET

4. Program Timer 1 to be an event counter. Use mode 2 and display the decimal count on P2, P1, and P0 continuously. Set the initial count to 55.
Ans:
MOV TMOD, #60h ; 0110 0000 [timer 1 c/t = 1 time 1 =1]
MOV TL1, #-55 ; count value
MOV TH1, #-55 ; preload
SETB P3.5
AGAIN: SETB TR1
BACK: MOV A, TL1
ACALL CONVERT
JNB TF1, BACK
CLR TR1
CLR TF1
SJMP AGAIN [10 marks]
;--This will convert from, binary (hex)
;to decimal and send each digit to the port
CONVERT:
MOV B,#10
DIV AB
MOV P0,B
MOV B,#10
DIV AB
MOV P1,B
MOV P2,A
RET [10 marks]

[20 marks]