TW480445B - Method for downloading application programs on the compiler system platform of an electronic communication device - Google Patents

Method for downloading application programs on the compiler system platform of an electronic communication device Download PDF

Info

Publication number
TW480445B
TW480445B TW89127944A TW89127944A TW480445B TW 480445 B TW480445 B TW 480445B TW 89127944 A TW89127944 A TW 89127944A TW 89127944 A TW89127944 A TW 89127944A TW 480445 B TW480445 B TW 480445B
Authority
TW
Taiwan
Prior art keywords
address
instruction
electronic communication
communication device
program
Prior art date
Application number
TW89127944A
Other languages
Chinese (zh)
Inventor
Jen-Shing Lai
Shiau-Lung Fan
Jing-Sung Wu
Original Assignee
Inventec Appliances Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inventec Appliances Corp filed Critical Inventec Appliances Corp
Priority to TW89127944A priority Critical patent/TW480445B/en
Application granted granted Critical
Publication of TW480445B publication Critical patent/TW480445B/en

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The present invention provides a method for downloading application programs on the compiler system platform of an electronic communication device. In the method, the compiler system of an electronic communication device defines a blanket area in its memory space for an application program, so that the application program can be stored in any address of the area, thereby fully and flexibly utilizing the memory space. When downloading the application program, the compiler system is able to modify the direct addressing command to obtain the correct address to perform an addressing operation, and use the software interrupt (hereinafter abbreviated as SWI) as a bridge to replace the indirect addressing command, so as to obtain the correct address required by the compiler system for performing an indirect addressing operation, thereby effectively increasing the efficiency and speed of application program. Furthermore, the size and number of downloaded application program are not restricted by the reserved space, thereby greatly improving the convenience in usage.

Description

480445 A7 B7 經濟部智慧財產局員工消費合作社印製 i、發明說明(1 ) 發明背景: 近年來,個人數位助理器(Personal Digital Assistance,簡稱PDA)之設計及 發展,不僅朝著輕薄短小之市場趨勢,大步邁進,其功能及用途之規劃,更爲滿 足消費大眾之需求,而逐漸與一般電子消費產品相結合,成爲一機多用途之電子 通訊產品,如與一般行動電話相結合,即成爲一具備行動電話功能之個人數位助 理器’如麵據機相結合,即成爲一具備網際網路傳訊功能之個人數位助理器, 諸如此類之構想,實不勝枚舉。目前,在該等電子通訊裝置中,許多產品已具備 可網際網路_h下載應用程式之功能,而該等電子通訊裝置之編譯系統,在下載應 用程式時,其處理方法一般可分爲下列兩種: 1·針對每個被下載之應用程式,均會提供多種可進行下載之連接位址,令編 譯系統可根據實際需要,自應用程式下載相對應之位址代碼。 2·需在系統記憶空間中預留一段區域,俾編譯系統要執行所下載之應用€ 式時,可將其拷貝至該區域,再予以執行。 按’前述傳統電子通訊裝置之編譯系統,在其對應用程式進行下載之作業 過程中’其處理方法存在有若干不甚理想,且令人話病之缺點,其中利用前述第 -¾¾¾ ’進行下®處理時’由於編譯系統需爲該等應用程式分S頓留不同之位~ 址段,令每一應用程式均可針對不同之位址段,生成相對應之位址代碼,意即, 若編譯系統分配了十個位址段,供十個應用程式使用,貝[|每一應用程式均需要針 對該十個位址對應生成十種代碼,以供編譯系統在下載該等應用程式時使用,尤 其是,在對所下載之應用程式進行後續整理時,若需將應用程式挪移到另外之位 a:段’尙需重新下載與該另外位址段相匹配之其它代碼,造成應用程式之維護整 理上極大之不便;另,利用前述第二種方法所下載之應用程式,由於每次執行時, 均需將其拷貝至預留之區域上,再予以執行,導致應用程式執行之速度極慢,此 -2- (請先閱讀背面之注意事項再填寫本頁), Φ480445 A7 B7 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs i. Invention Description (1) Background of the Invention: In recent years, the design and development of Personal Digital Assistance (PDA) has not only moved towards thin, light and short markets The trend, stride forward, its functions and uses are planned to better meet the needs of the consumer, and gradually combined with general electronic consumer products to become a multi-purpose electronic communication product. If combined with general mobile phones, Becoming a personal digital assistant with a mobile phone function. If combined with a personal computer, it becomes a personal digital assistant with an Internet messaging function. The concept of such things is endless. At present, among these electronic communication devices, many products already have the function of downloading applications on the Internet, and the compilation system of these electronic communication devices, when downloading applications, the processing methods can generally be divided into the following Two types: 1. For each downloaded application program, a variety of connection addresses can be provided for downloading, so that the compilation system can download the corresponding address code from the application program according to actual needs. 2. A certain area needs to be reserved in the system memory space. When the compilation system wants to execute the downloaded application, it can be copied to this area and then executed. According to the aforementioned compilation system of the traditional electronic communication device, in the process of downloading the application program, there are some unsatisfactory and troublesome shortcomings in its processing method. ® When processing ', because the compilation system needs to leave different positions for these applications ~ address segments, so that each application can generate corresponding address codes for different address segments, which means that if The compilation system allocates ten address segments for use by ten applications. Each application needs to generate ten types of code corresponding to the ten addresses for the compilation system to use when downloading these applications. In particular, during subsequent collation of the downloaded application, if the application needs to be moved to another position a: segment '尙 need to re-download other codes that match the other address segment, causing the application to It is extremely inconvenient to maintain and organize. In addition, the application downloaded by the second method mentioned above needs to be copied to the reserved area every time it is executed, and then executed. , Resulting in a very slow pace of implementation of the application, this 2- (please read the back of the precautions to fill out this page), Φ

訂---------線J -1 L* ϋ 1· n 1« n I n n ϋ ϋ ϋ ϋ n I ϋ ϋ I ϋ ϋ _ 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐)Order --------- line J -1 L * ϋ 1 · n 1 «n I nn ϋ ϋ ϋ ϋ n I ϋ ϋ I ϋ ϋ _ This paper size applies to China National Standard (CNS) A4 specifications ( 210 X 297 mm)

、發明說明 外’因預留區域之空間大小有其限制,故所下載之應用程式之大小亦因而受限 無法太大。 發明綱要: 有鑑於前述傳統電子通訊裝置之編譯系統,在其對應用程式進行下載之作 業過程中’所存在之諸多缺點,發明人經過長久努力硏究與實驗,終於開發設計 出本發明之一種在電子通訊裝置之編譯系統平台上下載應用程式之方法,該方法 係令一電子通訊裝置之編譯系統,在其記憶空間中劃分出一塊總括之區域,供被 下載之一應用程式使用’俾該應用程式可被存放至該區域內之任意位址,以充分 且靈活地使用系統記憶空間,並令該編譯系統在下載應用程式時,針對直接尋址 之操作指令5可直接將其修改成正確位址,行尋址作業,而對於間接尋址之操 作指令,則可藉軟體中斷(Software Interrupt,以下簡稱SWI )作爲橋樑,替 換該等指令)從臓得編譯系統所需之正確位址,進行離尋址作業。 本發明之一目的,係令編譯系統僅需在記憶空間中劃分出一塊總括之區域, 供被下載之應用程式使用,俾該應用程式可被存放在該區域內之任意位址,而無 需預留一塊專門用來執行下載應用程式之空間,如此,在執行應用程式時,即無 需拷貝之動作,可有效提高執行效率及速度,同時,令所下載之應用程式不受該 預留空間之大小限制。 本發明之另一目的,係令編譯系統無需爲所下載之應用程式另外分配多個 位址段,俾該等應用程式之安排不僅不受位址之約束,且在該總括區域容許之範 圍內,該等應用程式之下載個數亦可不受限制,大幅改善了使用上之方便性。 本發明之又一目的,係令編譯系統可將所下載之應用程式存放在該區域內 之任意位址,故在對該等應用程式進行整理時,可更輕而易舉’令空間之利用性 -3- 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) (請先閱讀背面之注意事項再填寫本頁)、 Explanation of the invention Outside ”Because the space size of the reserved area has its limitation, the size of the downloaded application cannot be too large. Summary of the invention: In view of the many shortcomings in the aforementioned compilation system of the traditional electronic communication device in the process of downloading application programs, the inventor finally developed and designed one of the inventions after a long period of research and experiment. A method for downloading an application program on a compiling system platform of an electronic communication device. The method is to make an compiling system of an electronic communication device divide a block area in its memory space for one of the downloaded application programs to use. The application program can be stored at any address in the area, in order to fully and flexibly use the system memory space, and make the compilation system directly modify the operation instruction 5 for direct addressing when downloading the application program Address, line addressing operations, and for indirect addressing operation instructions, software interrupts (hereinafter referred to as SWI) can be used as a bridge to replace these instructions) to obtain the correct address required by the compilation system, Perform off-addressing jobs. An object of the present invention is to make the compiling system only need to divide an integrated area in the memory space for the downloaded application program. The application program can be stored at any address in the area without pre-planning. Reserve a space dedicated to downloading application programs. In this way, when the application program is executed, there is no need to copy, which can effectively improve the execution efficiency and speed. At the same time, the downloaded application program is not subject to the size of the reserved space. limit. Another object of the present invention is to make the compilation system not need to allocate multiple address segments for the downloaded application programs. The arrangement of these application programs is not only restricted by the address, but also within the allowable range of the general area. , The number of downloads of these applications is also unlimited, which greatly improves the convenience of use. Another object of the present invention is to make the compiling system store the downloaded applications at any address in the area, so it is easier to make use of the space when organizing the applications-3 -This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) (Please read the precautions on the back before filling this page)

訂---------線II 經濟部智慧財產局員工消費合作社印製Order --------- Line II Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs

-ϋ n H ϋ IV H ϋ ϋ I n I n ϋ ϋ ϋ I ϋ I ϋ ϋ ϋ I 480445 A7 B7 五、發明說明) 發揮到最大。此外,由於本發明係利用軟體中斷,故無需增加額外之硬體設備, 即可輕易實現。 圖示簡單說明: 第1圖所示乃本發明之指令替換之流程示意圖。 第2圖所示乃本發明之中斷服務之流程示意圖。 詳細說明: 本發明主要係應用於一電子通訊裝置中,用以在網路上或電腦(personal computer)上下載應用程式之方法,該電子通訊裝置可爲一行動電話(cellar phone)、個人數位助理器(Personal Digital Assistant)或其它電子通訊裝置,該電 子通訊裝置內設有一微處理器(Processor),該微處理器係用以操控通訊裝置上之 電子元件,令該等元件得以正常運作,以與一網際網路之伺服器(server)或電腦 (personal computer)相連線,並透過該微處理器之編譯系統,自網路上下載應用 程式。本發明係令該編譯系統可在其記憶體中劃分出一塊總括之區域,供被下載 之應用程式使用,俾該應用程式可被存放至該區域內之任意位址,以充分且靈活 地使用系統記憶空間,並令該編譯系統在下載應用程式時,針對直接尋址之操作 指令 > 職接將其修改成正確位址,行尋址作業,對於酿尋址之操作指令> 則可藉軟體中斷(Software Interrupt,以下簡稱SWI )作爲橋樑,替換該等指 令,從而取得編譯系統所需之正確位址,進行間接尋址作業。 在本發明之一較佳實施例中,係以曰本TOSHIBA公司設計生產之編號T900 之微處理器爲例,說明本發明之設計理念及作業流程如下: 在該微處理器所使用之編譯系統之各指令中,與位址有關之指令有三類, -4- 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) (請先閱讀背面之注意事項再填寫本頁) --------訂---------線—▲ 經濟部智慧財產局員工消費合作社印製 480445 A7 B7 經濟部智慧財產局員工消費合作社印製 五、發明說明) 即LD、JP及CALL·等三類,其中LD類指令包含系統之全局變量及常數,JP 類指令係用以直接修改IP(instructi〇n pointer),來改變處理流程之指令,CALL· 類指令則係用以將當前IP壓入堆棧(Stack),然後藉修改IP,令其指向至調用位 址,再於返回主程序時,從堆棧中取回IP原値,恢復指向原來之位址,該JP類 與CALL類指令間之差別,係在CALL類指令多了 IP之保存及恢復。由於,該 等指令對數據操作及處理流程有極大之影響,故若能妥善處理該三類指令,該編 譯系統即可順利且正確地自網路上下載應用程式。 在本發明中,對於LD類指令,可在程序執行時,將全局變量及常數存放至 固定之區域裡,如此,即可很容易地對LD類指令進行妥善之處理。至於JP及 CALL類之指令,依其尋址方式之不同,可區分爲直接尋址(如:JP 400000H、 CALL 440000H···)及間接尋址(如:JP XWA、CALL XHL···)等二種,其中直接 尋址之指令,可在下載應用程式或搬移應用程式之程序中,直接將代碼中之位址 修改成正確之位址,且在下載過程中,令程序自動產生一索引文件,以用來記錄 該指令所尋找之位址,如此,即可令程序執行之速度較陕。 由於,在該T900微處理器中,JP類與CALL類指令間,因CALL類指令 需要返回主程序,故多了對IP之保存及恢復動作,故該微處理器之編譯系統, 將轉換成彙編程序,該程序執行時先將參數逐一入棧,執行CALL之動作> 返回主程序後,接著再令該等參數逐一出棧。本發明即利用此一觀念,於編譯系 統中提供一指令SWI,俾藉由該指令SWI產生一軟體中斷,該軟體中斷之執行 過程係將IP壓棧,並令標誌暫存器(SR)壓棧後,再將指標指向相對應之中斷入 口位址,且在返回主程序時,令該標誌暫存器(SR)出棧後,再令IP出棧。 本發明對於間接尋址之指令,可利用暫存器之尋址方式,加以說明,該類 指令有JP<CC>,MEM及CALL<CC>,MEM等,其中MEM係表示暫存器, -5· 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) ""~" (請先閱讀背面之注意事項再填寫本頁) · 訂---------線! ' I n 1 H ϋ I I I -1 I- ϋ ϋ n ϋ n - 480445 A7 B7 經濟部智慧財產局員工消費合作社印製 五、發明說明( _+1¾度係2〜5個位元組(byte),由於在已鏈接好之二進制檔之應用程式 中’並藉由插入一 2位元組長度之指令,來修改暫存器之內容,以達成修改該 等位址之目的,故若本發明欲利用一具2個位元組長度之指令,來解決此一問題, 即需先對其進行下列二離理: 1、 指令替換處理:參閱第1圖所示,在應用程式之下載過程中,完成對所 下載之二進制碼進行掃描,當發現JP<CC>,MEM或CALL<CC>,MEM時, 以SWI來替代,並於其後放入類型號,該類型號係本發明預先設定之編號,以 藉不同之類型號定義不同之指令,俾本發明在執行後續處理時,知道原來之操作 模式。至於,空餘之字節貝似NOP塡入。 2、 中斷服務處理:參閱第2圖所示,提供一中斷服務函數,令程序執行到 SWI後,跳轉至對應之中斷入口位址,執行該服務函數,並根據類型號,取出對 應暫存器內之內容,將其修改成正確之値,如:加上一偏移量,該偏移量可根據 應用程式被置放之位址算出,再將該値作爲SWI之返回位址,放入堆棧內,如 此,在中斷返回時,就會跳轉至本發明所需之位址上。如果係CALL類指令, 本發明尙需在堆棧裡先插入CALL·之返回位址,如:沒修改前在堆棧內SWI之 原返回位址上加1,或可根據類型號計算出。 本發明在前述指令替換處理之流程中,主要係先對所下載之二進制代碼進 行掃描,並依下列步驟,復參閱第1圖所示,進行相關指令之替換: (1.1) 讀取一條指令; (1.2) 判斷該指令之尋址方式是否係絕對跳轉或絕對調用,即是否係屬直接 尋址,若是,則繼續下列步驟,否則,進入步驟(1.4); (1.3) 若是直接尋址,即將該指令所要跳轉之位址直接修改成正確位址,並 進入步驟(1.8); 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) • 訂---------線d (請先閱讀背面之注意事項再填寫本頁) ---^---------------------- 抑0445 A7 B7 五、發明說明(g ) (1.4)若不是直接尋址,則再判斷是否係暫存器之間接跳轉或調用?若是, 則繼續下列步驟,否則,進入步驟(1.8); (1·5)若是暫存器之間接尋址,則把不同之指令轉換成不同之類型號,該類 型號係本發明預先設定之編號,以藉不同之類型號定義不同之指令; (1·6)將指令之第一個字節改成軟體中斷之標記SWI ; (1.7)將指令之第二個字節改成類型號; (1·8)判斷對該二進制代碼之掃描是否結束?若尙未結束,則返回步驟(1.1), 取下一條指令,直到掃描結束爲止,否則,即結束替換指令之程序。 本發明在前述中斷服務處理之流程中,主要係藉提供一中斷服務函數,在 程序執行到SWI後,跳轉至對應之中斷入口,並依下列步驟,復參閱第2圖所 示,執行該中斷服務函數: (2.1)首先,將所有暫存器之內容保存至自定義之變量中,意即可將其存放 至記憶空間中,以便保持中斷返回後之程序,仍能正確運行; (2.2) 將標誌暫存器(SR)彈出堆棧,俾保存該値,以便在後續程序中回復 之,嗣,再將中斷返回位址彈出堆棧,以便在後續程序中修改成新的返回位址入 棧; (2.3) 讀取出類型號; (2.4) 根據該類型號,判斷指令是否係屬CALL·類指令?若是,則繼續下列 步驟,否則,進入步驟(2·6); (2.5) 若是CALL指令,丰赚前述說明,因CALL指令需在執行完畢後返 回原程序,故,此時需將其返回位址,該位址即原先沒修改前其在堆棧內SWI 之返回位址加1,遲入堆棧,予以保存; (2.6) 根據類型號讀取出對應暫存器內之値,並將其修改爲正確位址’即加 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) (請先閱讀背面之注意事項再填寫本頁)-ϋ n H ϋ IV H ϋ ϋ I n I n ϋ ϋ ϋ I ϋ I ϋ ϋ ϋ ϋ I 480445 A7 B7 V. Description of the invention). In addition, since the present invention uses software interruption, it can be easily implemented without adding additional hardware equipment. Brief description of the figure: Figure 1 is a schematic diagram of the instruction replacement process of the present invention. Figure 2 is a schematic diagram of the interrupt service process of the present invention. Detailed description: The present invention is mainly applied to an electronic communication device for downloading application programs on a network or a personal computer. The electronic communication device may be a cellar phone or a personal digital assistant. Personal Digital Assistant or other electronic communication device. The electronic communication device is provided with a microprocessor. The microprocessor is used to control the electronic components on the communication device so that these components can operate normally. It is connected to a server or personal computer of the Internet, and an application program is downloaded from the network through a compilation system of the microprocessor. The invention enables the compilation system to divide an overall area in its memory for use by downloaded applications, and the application can be stored at any address in the area for full and flexible use The system memory space, and when the compiler downloads the application program, it can modify the operation instructions for direct addressing to the correct address, perform the addressing operation, and the operation instructions for addressing can be used. Software Interrupt (SWI) is used as a bridge to replace these instructions, so as to obtain the correct address required by the compilation system for indirect addressing operations. In a preferred embodiment of the present invention, a microprocessor numbered T900 designed and produced by Toshiba Co., Ltd. is used as an example to illustrate the design concept and operation flow of the present invention as follows: The compiler system used in the microprocessor Among the various instructions, there are three types of address-related instructions. -4- This paper size applies to the Chinese National Standard (CNS) A4 specification (210 X 297 mm) (Please read the precautions on the back before filling this page)- ------- Order --------- line— ▲ Printed by the Employees 'Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 480445 A7 B7 Printed by the Employees' Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 5. Description of the invention) LD There are three types: JP, CALL, and others. Among them, LD instructions include global variables and constants of the system. JP instructions are used to directly modify the IP (instructioon pointer) to change the processing flow. CALL · instructions are It is used to push the current IP into the stack, and then modify the IP to point it to the calling address. When it returns to the main program, it retrieves the IP address from the stack and restores the original address. The JP The difference between CALL and CALL instructions is the CALL instruction More IP of preservation and restoration. Since these instructions have a great impact on the data operation and processing flow, if the three types of instructions can be handled properly, the compilation system can smoothly and correctly download applications from the Internet. In the present invention, for LD-type instructions, global variables and constants can be stored in a fixed area during program execution. In this way, LD-type instructions can be properly processed easily. As for the instructions of JP and CALL, they can be divided into direct addressing (such as: JP 400000H, CALL 440000H ...) and indirect addressing (such as: JP XWA, CALL XHL ...) There are two kinds of instructions. Among them, the direct addressing instruction can directly modify the address in the code to the correct address in the process of downloading or moving the application, and during the downloading process, the program automatically generates an index. A file is used to record the address sought by the instruction. In this way, the program can be executed faster than Shaanxi. Because in the T900 microprocessor, between the JP and CALL instructions, the CALL instruction needs to return to the main program, so there are more actions for saving and restoring IP. Therefore, the compiler system of the microprocessor will be converted into Assembler. When the program is executed, the parameters are pushed into the stack one by one, and the action of CALL is executed. After returning to the main program, the parameters are pushed out of the stack one by one. The present invention utilizes this concept to provide an instruction SWI in the compilation system, and a software interrupt is generated by the instruction SWI. The execution process of the software interrupt is to push the IP stack and press the flag register (SR). After the stack, the pointer is pointed to the corresponding interrupt entry address, and when returning to the main program, the flag register (SR) is popped from the stack, and then the IP is popped from the stack. For the indirect addressing instructions of the present invention, the addressing mode of the register can be used to explain. Such instructions include JP < CC >, MEM and CALL < CC >, MEM, etc., where MEM is a register,- 5 · This paper size applies to China National Standard (CNS) A4 (210 X 297 mm) " " ~ " (Please read the precautions on the back before filling this page) · Order ------- --line! 'I n 1 H ϋ III -1 I- ϋ ϋ n ϋ n-480445 A7 B7 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economy In the application program of the linked binary file, and by inserting a 2-byte length instruction to modify the contents of the register to achieve the purpose of modifying these addresses, if the present invention intends to To solve this problem by using a 2-byte length instruction, you need to perform the following two separations first: 1. Instruction replacement processing: Refer to Figure 1, during the download process of the application, Scanning the downloaded binary code is completed. When JP < CC >, MEM or CALL < CC >, MEM is found, it is replaced by SWI, and a type number is placed after the type number. This type number is preset by the present invention. The number is used to define different instructions by different type numbers. When the present invention performs subsequent processing, it knows the original operation mode. As for the remaining bytes, it is like a NOP input. 2. Interrupt service processing: see Figure 2 As shown, provide an interrupt service function to make the program After going to SWI, jump to the corresponding interrupt entry address, execute the service function, and take out the contents of the corresponding register according to the type number, and modify it to the correct one, such as: add an offset, The offset can be calculated based on the address where the application is placed, and then put the stack as the return address of the SWI into the stack, so that when the interrupt returns, it will jump to the address required by the present invention If it is a CALL type instruction, the present invention does not need to insert the return address of CALL · into the stack first, for example, add 1 to the original return address of SWI in the stack before modification, or it can be calculated based on the type number. In the process of the foregoing instruction replacement process, the present invention mainly scans the downloaded binary code, and performs the following steps, referring to FIG. 1, to replace the related instructions: (1.1) reading an instruction; (1.2) Determine whether the addressing mode of the instruction is an absolute jump or absolute call, that is, whether it is direct addressing. If so, continue with the following steps, otherwise, go to step (1.4); (1.3) If it is direct addressing, Required by the directive Change the jumped address directly to the correct address, and enter step (1.8); This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 mm) • Order --------- line d (Please read the precautions on the back before filling this page) --- ^ ---------------------- Suppress 0445 A7 B7 V. Description of the invention (g) (1.4) If it is not direct addressing, then determine whether it is a jump or call between registers? If yes, continue with the following steps, otherwise, go to step (1.8); (1 · 5) If it is a register search Address, different instructions are converted into different type numbers. The type number is a preset number of the present invention to define different instructions by different type numbers; (1 · 6) change the first byte of the instruction It becomes a software interrupt mark SWI; (1.7) Change the second byte of the instruction to the type number; (1.8) Determine whether the scanning of the binary code is finished? If 尙 is not completed, return to step (1.1) and take the next instruction until the scan is finished, otherwise, the procedure of replacing the instruction is ended. In the aforementioned interrupt service processing flow, the present invention mainly provides an interrupt service function. After the program executes SWI, it jumps to the corresponding interrupt entry and executes the interrupt according to the following steps, referring to FIG. 2 again. Service functions: (2.1) First, save all the contents of the register to a custom variable, which means that it can be stored in the memory space, so that the program can still run correctly after the interrupt return; (2.2) Pop the flag register (SR) out of the stack, save it, so that it can be restored in subsequent programs, and then pop the interrupt return address out of the stack, so that it can be modified into a new return address and put into the stack in subsequent programs; (2.3) Read the type number; (2.4) According to the type number, determine whether the instruction is a CALL · type instruction? If yes, continue with the following steps, otherwise, go to step (2 · 6); (2.5) If it is a CALL instruction, make a profit as described above, because the CALL instruction needs to return to the original program after execution, so it needs to be returned at this time. The address is the return address of the SWI in the stack before it was originally modified. It is added to the stack later, and is saved later. (2.6) Read out the corresponding register in the register according to the type number and modify it. For the correct address, that is, the size of the paper is applicable to the Chinese National Standard (CNS) A4 specification (210 X 297 mm) (Please read the precautions on the back before filling this page)

JAW--------訂—------線I 經濟部智慧財產局員工消費合作社印製 480445 經濟部智慧財產局員工消費合作社印製 A7 B7 五、發明說明) 上一偏移量,偏移量可讎應用程式所放置之位址計算出; (2.7) 將修改後之値作爲SWI之返回位址,壓入堆棧內,俾中斷返回時,程 序可跳轉至該位址,繼繊行,相當完成了 JP或CALL指令,亦完成了位址之 正確修改; (2.8) 將標誌暫存器(SR)內容壓入堆棧,此時,由於該標誌暫存器係未經 修改之標誌暫存器,故可確保標誌暫存器內容値之正確性; (2.9) 最後,再將步驟(2.1)中所保存之暫存器內容恢復原値,意即將該原値 從變量中再傳回暫存器,以確保該暫存器中之內容在經過中斷後能回復至未經改 變之原値,並結束中斷,返回主程序。 如此,該電子通訊裝置之編譯系統僅需在記憶空間中劃分出一塊總括之區 域,令所下載之應用程式被存放至該區域內之任意位址,而無需預留一塊專門空 間,執行所下載之應用程式,如此,在執行應用程式時,即無需拷貝之動作,可 有效提高執行效率及速度,同時,令所下載之應用程式不受該預留空間之大小限 制。另,由於該編譯系統無需爲所下載之應用程式另分配多個位址段’故該等應 用程式之安排不僅不受位址之約束,且在該總括區域之範圍內’應用程式之下載 個數亦不受限制,大幅改善了使用上之方便性。此外,由於該編譯系統係利用軟 體中斷方式,完成間接尋址作業,故完全無需增加額外之硬體設備,即可輕易實 現。 ’ 以上所述,僅爲本發明所列舉之最佳具體實施例,惟本發明之特徵並不侷 限於此,任何熟悉該項技藝者在本發明領域內,可輕易思及之變化或修飾,皆應 涵蓋在以下本發明之申請專利範圍中。 __-8- 本紙張尺度刺+ S ®家標準(CNS)A4規格(210 X 297公爱) (請先閱讀背面之注意事項再填寫本頁) IAW--------訂---------線.JAW -------- Order ------- line I Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs 480445 Printed by the Employee Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs A7 B7 V. Invention Description) The amount of shift and offset can be calculated by the address placed by the application; (2.7) The modified address is pushed into the stack as the return address of the SWI. When the interrupt returns, the program can jump to the address. Following the instructions, the JP or CALL instruction was quite completed, and the correct modification of the address was also completed; (2.8) The contents of the flag register (SR) were pushed onto the stack. At this time, because the flag register is not The modified flag register can ensure the correctness of the contents of the flag register; (2.9) Finally, the content of the register saved in step (2.1) is restored to the original state, which means that the original element is a variable China Retransmits the register to ensure that the contents of the register can be restored to the original state after the interruption, and the interruption is ended and the main program is returned. In this way, the compiling system of the electronic communication device only needs to divide an overall area in the memory space, so that the downloaded application program can be stored at any address in the area, without having to reserve a special space to execute the download In this way, when the application is executed, there is no need to copy it, which can effectively improve the execution efficiency and speed. At the same time, the downloaded application is not limited by the size of the reserved space. In addition, because the compilation system does not need to allocate multiple address segments for downloaded applications, the arrangement of these applications is not only subject to address constraints, but also within the scope of the umbrella area. The number is not limited, which greatly improves the convenience in use. In addition, because the compilation system uses software interrupts to complete the indirect addressing operation, it can be easily implemented without adding additional hardware equipment. 'The above descriptions are only the best specific examples of the present invention, but the features of the present invention are not limited to this. Any person skilled in the art can easily think of changes or modifications in the field of the present invention. All should be covered by the following patent application scope of the present invention. __- 8- This paper size thorn + S ® home standard (CNS) A4 specification (210 X 297 public love) (Please read the precautions on the back before filling this page) IAW -------- Order-- -------line.

Claims (1)

480445 A8 B8 C8 D8 六、申請480445 A8 B8 C8 D8 VI. Application (請先閱讀背面之注意事項再填寫本頁) :電子通訊裝置之編譯系統平台上下載應用程式之方法’該方法係在一 電子通訊裝置與一網際網路之伺服器相連線,並透過該電子通訊裝置上之一微處 理器之編譯系統,自網路上下載應用程式時,可令該編譯系統在其記憶體中劃分 出一塊總括之區域,供被下載之應用程式使用,俾該應用程式可被存放至該區域 內之任意位址,並令該編譯系統在下載應用程式時,針對直接尋址之操作指令, 直接將其修改成正確位址,再進行尋址作業,而對於間接尋址之操作指令,則可 藉一軟體中斷作爲橋樑,替換該等指令,從而取得該編譯系統所需之正確位址, 進行間接尋址作業。 2 ·如申請專利範圍第1項所述之在電子通訊裝置之編譯系統平台上下載 應用程式之方法,其中直接尋址之指令,可在下載應用程式之程序中,直接將代 碼中之位址修改成正確之位址,且令程序自動產生一索引文件,以用來記錄該指 令所尋找之位址° 3 ·如申請專利範圍第1項所述之在電子通訊裝置之編譯系統平台上下載 應用程式之方法,其中對於間接尋址之指令,可在應用程式之下載過程中,完成 對所下載之二進制碼進行掃描,當發現間接尋址之指令時,以該軟體中斷來替代, 並於其雛入一類型號,做執行後續處理時,知道原來之操作模式。 經濟部智慧財產局員工消費合作社印製 4·如申請專利範圍第3項所述之在電子通訊裝置之編譯系統平台上下載應 用程式之方法,其中當程序執行到該軟體中斷後,將跳轉至對應之中斷入口位址, 執行一中斷服務函數,並根據該類型號,取出對應暫存器內之內容,將其修改成 正確之値再將該値作爲該軟體中斷之返回位址,放入堆棧內,如此,在中斷返回 時,就會跳轉至所需之位址上。 5 ·如申請專利範圍第4項所述之在電子通訊裝置之編譯系統平台上下載 應用程式之方法,其中該正確値係將自該對應暫存器內所取出之內容,力口上一偏 -9 私紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) 480445 A8B8C8D8 六、申請專利範圍 移量 > 該偏移量可讎應用程式被置放之位址算出。 (請先閱讀背面之注意事項再填寫本頁) 6 ·如申請專利範圍第3項所述之在電子通訊裝置之編譯系統平台上下載 應用程式之方法,其中在對間接尋址之指令進行替換處理時,係先對所下載程式 之二進制代碼進行掃描,並依下列步驟,進行相關指令之_: 首先,讀取一條指令; 判斷該指令之尋址方式是否係絕對跳轉或絕對調用? 若是直接尋址,即將該指令所要跳轉之位址直接修改成正確位址,並判斷 對該二進制代碼之掃描是否結束?若尙未結束,貝IJ重新讀取取下一條指令,直到 掃描結束爲止,否則,即結束替換指令之程序。 7 ·如申請專利範圍第6項所述之在電子通訊裝置之編譯系統平台上下載應 用程式之方法,其中若不是直接尋址,則再判斷是否係暫存器之間接跳轉或調用; 若是暫存器之間接尋址,則把不同之指令轉換成不同之類型號,該類型號 係本發明預先設定之編號,以藉不同之類型號定義不同之指令; 將指令之第一個字節改成軟體中斷之標記; 將指令之第二個字節改成類型號; 最後,判斷對該二進制代碼之掃描是否結束?若尙未結束,則重新讀取取 下一條指令,直到掃描結束爲止,否則,即結束替換指令之程序。 經濟部智慧財產局員工消費合作社印製 8·如申請專利範圍第4項所述之在電子通訊裝置之編譯系統平台上下載應 用程式之方法,其中在對間接尋址之指令進行中斷服務處理時,係藉提供一中斷 月β務函數,在程序執行到_體中斷後,跳轉至對應之中斷入口,並依下列步驟, 執行該中斷服務函數: . 首先,將所有暫存器之內容保存至自定義之變量中,意即可將其存放至記 憶空間中,以便保持中斷返回後之裎序,仍能正確運行; -10__ 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐) 480445 經濟部智慧財產局員工消費合作社印製 A8 B8 C8 D8 __ 六、申請專利範圍 再將標誌暫存器彈出堆棧,俾保存該値,以便在後續程序中回復之,嗣, 再將中斷返回位址彈出堆棧,以便在後續程序中修改成新的返回位址入棧; 讀取出類型號;並根據該類型號,判斷指令是否係屬一需返回主程序之指 令,若是,即將其返回位址,該位址係原先沒修改前其在堆棧內該軟體中斷之返 回位址加1,並壓入堆棧,予以保存; 再根據類型號讀取出對應暫存器內之値,並將其修改爲正確位址,即加上 一偏移量,該偏移量可讎應用程式所放置之位址計算出; 將修改後之値作爲該軟體中斷之返回位址,壓入堆棧內,俾中斷返回時, 程序可跳轉至該位址,繼續執行; 最後,將標誌暫存器內容壓入堆棧,並將原保存之暫存器內容恢復原値, 並結束中斷,返回主程序。 9 ·如申請專利範圍第8項所述之在電子通訊裝置之編譯系統平台上下載應 用程式之方法,其中若判斷指令非屬一需返回主程序之指令,貝[J根據該類型號讀 取出對應暫存器內之値,並將其修改爲正確位址,即加上一偏移量,該偏移量可 根據應用程式所放置之位址計算出; 將修改後之値作爲該軟體中斷之返回位址,壓入堆棧內,俾中斷返回時, 程序可跳轉至該位址,繼續執行; 最後,將標誌暫存器內容壓入堆棧,並將原保存之暫存器內容恢復原値, 並結束中斷,返回主程序。 10 ·如申請專利範圍第3或4項所述之在電子通訊裝置之編譯系統平台上 下載應用程式之方法,其中該類型號係預先設定之編號,以藉不同之類型號定義 不同之指令。 11 ·如申請專利範圍第1、2、3或4項所述之在電子通訊裝置之編譯系統 -11- 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公爱7 (請先閱讀背面之注意事項再填寫本頁)(Please read the precautions on the back before filling this page): Method for downloading application programs on the compiling system platform of electronic communication device 'This method is a connection line between an electronic communication device and an Internet server, and A compilation system of a microprocessor on the electronic communication device, when downloading an application program from the Internet, the compilation system can be made to divide an integrated area in its memory for the downloaded application program to use. The program can be stored at any address in the area, and make the compilation system directly modify the direct addressing operation instruction to the correct address when downloading the application program, and then perform the addressing operation. The addressing operation instructions can be replaced by a software interrupt as a bridge to obtain the correct address required by the compilation system for indirect addressing operations. 2 · The method for downloading an application program on the compiling system platform of an electronic communication device as described in item 1 of the scope of patent application, wherein the direct addressing instruction can directly address the address in the code in the program for downloading the application program Modify the correct address, and make the program automatically generate an index file to record the address sought by the instruction ° 3 · Download on the compiling system platform of the electronic communication device as described in item 1 of the scope of patent application Application method, in which the indirect addressing instruction can be scanned during the download of the application program. When an indirect addressing instruction is found, the software interrupt is used instead. It enters a type number and knows the original operation mode when performing subsequent processing. Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs4. The method of downloading an application program on the compilation system platform of an electronic communication device as described in item 3 of the scope of the patent application, where the program will jump to The corresponding interrupt entry address executes an interrupt service function, and according to the type number, takes out the contents of the corresponding register, changes it to the correct one, and then uses this as the return address of the software interrupt and puts it in On the stack, when the interrupt returns, it will jump to the required address. 5 · The method for downloading an application program on the compiling system platform of an electronic communication device as described in item 4 of the scope of patent application, wherein the correctness is the content that will be taken out from the corresponding register, and the bias- 9 The size of the private paper is applicable to the Chinese National Standard (CNS) A4 (210 X 297 mm) 480445 A8B8C8D8 6. The range of the patent application shift> This offset can be calculated based on the address where the application is placed. (Please read the precautions on the back before filling this page) 6 · The method of downloading the application program on the compiling system platform of the electronic communication device as described in item 3 of the scope of patent application, in which the indirect addressing instructions are replaced When processing, first scan the binary code of the downloaded program, and perform the following instructions according to the following steps: First, read an instruction; determine whether the addressing mode of the instruction is an absolute jump or absolute call? If it is direct addressing, directly modify the address jumped by the instruction to the correct address, and judge whether the scan of the binary code is finished? If 尙 is not finished, Bay IJ rereads and fetches the next instruction until the scan is finished, otherwise, it ends the procedure of replacing instructions. 7 · The method for downloading an application program on the compiling system platform of an electronic communication device as described in item 6 of the scope of the patent application, if it is not direct addressing, then determine whether it is a jump or call between temporary registers; if it is temporarily Indirect addressing of registers, different instructions are converted into different type numbers. The type numbers are preset numbers in the present invention to define different instructions by different type numbers. Change the first byte of the instruction. It becomes a software interrupt mark; changes the second byte of the instruction to a type number; Finally, determines whether the scan of the binary code is finished? If 尙 is not completed, re-read the next instruction until the scan is finished, otherwise, the procedure of replacing the instruction is ended. Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs By providing an interrupt month β service function, after the program execution is interrupted, jump to the corresponding interrupt entry and execute the interrupt service function according to the following steps: First, save the contents of all the registers to In the custom variable, it means that it can be stored in the memory space, so as to maintain the sequence after the interruption and return, and still run correctly; -10__ This paper size applies the Chinese National Standard (CNS) A4 specification (210 X 297 public (%) 480445 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs A8 B8 C8 D8 __ Sixth, the scope of the patent application, then pop the logo register out of the stack, save this, so that it can be restored in subsequent procedures, and then interrupt The return address pops out of the stack, so that it can be modified into a new return address to be pushed into the stack in subsequent programs; read the type number; and according to the type number, Whether the interrupt instruction is an instruction that needs to return to the main program. If it is, it will return the address. The address is the return address of the software interrupt in the stack which was not modified before. ; Then read out the corresponding register in the corresponding register according to the type number, and modify it to the correct address, that is, add an offset, which can be calculated based on the address placed by the application; The modified 値 is pushed into the stack as the return address of the software interrupt. When the 返回 returns, the program can jump to the address and continue execution. Finally, push the contents of the flag register into the stack and save the original The contents of the scratchpad are restored, and the interruption is ended, and the main program is returned. 9 · The method for downloading an application program on the compiling system platform of an electronic communication device as described in item 8 of the scope of the patent application, wherein if it is judged that the instruction is not an instruction that needs to return to the main program, [J read according to the type number Take out the 値 in the corresponding register and modify it to the correct address, that is, add an offset, which can be calculated based on the address placed by the application; use the modified 値 as the software The return address of the interrupt is pushed into the stack. When the interrupt returns, the program can jump to that address and continue execution. Finally, push the contents of the flag register into the stack and restore the original saved register contents to the original値, and end the interrupt, and return to the main program. 10 · The method for downloading an application program on the compiling system platform of an electronic communication device as described in item 3 or 4 of the scope of patent application, wherein the type number is a preset number to define different instructions by different type numbers. 11 · Compiling system for electronic communication device as described in the scope of application for patents 1, 2, 3 or 4-11- This paper size applies to China National Standard (CNS) A4 (210 X 297 Public Love 7 (please first (Read the notes on the back and fill out this page) 480445 A8 B8 C8 D8 六、申請專利範圍 平台上下載應用程式之方法,其中該電子通訊裝置可爲一行動電話。 (請先閱讀背面之注意事項再填寫本頁) 12 ·如申請專利範圍第1、2、3或4項所述之在電子通訊裝置之編譯系統 平台上下載應用程式之方法,其中該電子通訊裝置可爲一個人數位助理器。 經濟部智慧財產局員工消費合作社印製 ____12· 本紙張尺度適用中國國家標準(CNS)A4規格(210 X 297公釐)480445 A8 B8 C8 D8 6. Scope of Patent Application Method for downloading application programs on the platform, wherein the electronic communication device can be a mobile phone. (Please read the precautions on the back before filling this page) 12 · The method of downloading the application program on the compiling system platform of the electronic communication device as described in item 1, 2, 3 or 4 of the scope of patent application, where the electronic communication The device can be a personal assistant. Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs ____ 12 · This paper size applies to China National Standard (CNS) A4 (210 X 297 mm)
TW89127944A 2000-12-27 2000-12-27 Method for downloading application programs on the compiler system platform of an electronic communication device TW480445B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW89127944A TW480445B (en) 2000-12-27 2000-12-27 Method for downloading application programs on the compiler system platform of an electronic communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW89127944A TW480445B (en) 2000-12-27 2000-12-27 Method for downloading application programs on the compiler system platform of an electronic communication device

Publications (1)

Publication Number Publication Date
TW480445B true TW480445B (en) 2002-03-21

Family

ID=21662508

Family Applications (1)

Application Number Title Priority Date Filing Date
TW89127944A TW480445B (en) 2000-12-27 2000-12-27 Method for downloading application programs on the compiler system platform of an electronic communication device

Country Status (1)

Country Link
TW (1) TW480445B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI425419B (en) * 2010-12-10 2014-02-01 Inst Information Industry Low power program compiling method, device and computer readable storage medium for storing thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI425419B (en) * 2010-12-10 2014-02-01 Inst Information Industry Low power program compiling method, device and computer readable storage medium for storing thereof

Similar Documents

Publication Publication Date Title
US9690604B2 (en) Language-based model for asynchronous operations
RU2473111C1 (en) Method for dynamic program assembling on embedded platform and embedded platform
TW484099B (en) Method and apparatus for efficient invocation of Java methods from native code
JP4485198B2 (en) Processor system with Java accelerator
US7246346B2 (en) System and method for persisting dynamically generated code in a directly addressable and executable storage medium
US7596783B2 (en) Methods and apparatus to implement annotation based thunking
TWI279715B (en) Method, system and machine-readable medium of translating and executing binary of program code, and apparatus to process binaries
WO2013192104A2 (en) Optimized execution of dynamic languages
JP2001216169A (en) Method, system, program and data structure for converting instruction of first bit architecture into instruction of second bit architecture
US6892379B2 (en) Methods and apparatus for use in aiding stack unwinding
JPH01310441A (en) Data processor
CN109032572B (en) Method for Java program method internal connection based on byte code
US20110173595A1 (en) Language-based model for asynchronous operations
CN112698867A (en) Method and device for dynamically modifying annotation information, electronic equipment and medium
TW480445B (en) Method for downloading application programs on the compiler system platform of an electronic communication device
JP2007226784A (en) Calling method of in-lined method, and java virtual machine using it
RU2554509C2 (en) System and method of distributed computations
JP2005267640A (en) Method and device for calling function
JP2004030224A (en) Processor, method for retracting register and method for designating register
Adobe Systems Inc PostScript language reference
CN109857380B (en) Workflow file compiling method and device
JP4833792B2 (en) Data analysis system
US20100169872A1 (en) Use of Name Mangling Techniques To Encode Cross Procedure Register Assignment
JP2004287618A (en) Starting control method of operating system, program making computer execute its method, and starting control device of operating system
JP6639238B2 (en) Programs and computers

Legal Events

Date Code Title Description
GD4A Issue of patent certificate for granted invention patent
MM4A Annulment or lapse of patent due to non-payment of fees