Minggu, 24 April 2011

Binary program

     
        Binary Programs are special programs consisting of pure object code. Binary programs are generally used as extensions to the BASIC interpreter, i.e. they implement one or more new BASIC statements. Actually, binary programs are simply machine language programs which were normally written in assembler and which can be used for any purpose, either as complete, self-contained program or as extension to the BASIC command set.
The approach how binary programs are used with BASIC program was different to the standard way how it was normally done in other BASIC dialects. One of the differences was, that HP9845 BASIC was quite well protected against any kind of machine address reference, including direct jumps to arbitrary machine addresses. Instead, HP provided means to load object code modules into memory and to add those routines together with the associated keywords to the BASIC instructions set which was already provided by the 9845 LPU firmware.

For a calling BASIC program, there was no difference whether the routine belonging to a special keyword was implemented permanently in ROM or temporarily loaded into R/W memory. Probably, the HP way was a bit more sophisticated and secure than the standard approach with the SYS and USR statements, since the ROM BASIC could be extended with real new instructions and it was'nt too easy to freeze the system accidentally through a jump to the wrong address. On the other side, through the complete abandonment of standard BASIC direct access statements like PEEK, POKE, ADR, SYS and USR, any access from within BASIC to the system resources was completely blocked.

Binary programs can also be used to implement complete applications. The TBIN system test binary is such an example, it works just like any other program, with the difference that it is completely in machine code. The functions provided by this program are driven my menus and keyboard short-cuts.

Binary programs had to meet some rules. The first rule was that it was not possible to specify a certain memory location where the object code should be installed. As a consequence, the object code module had to be designed with fully relocatable code. Another speciality was that each binary module had to have a defined header which holds information about the keyword(s) with which each module routine was invoked, the version information of the module, and the way how the statements can be syntaxed, listed and executed inside a BASIC program.

Binary modules could be saved and loaded in different ways, either alone (with the LOAD BIN command) or in combination with a BASIC program (see the Software Architecture section for more information about the the usage and structure of binary routines). All binary programs could include a special routine which was automatically executed after loading.

Since binary programs could be used to extend the set of statements which was implemented in firmware, it was the ideal way to implement some special functionality which couldn't be performed in BASIC. This includes even low level functionality, which is intentionally not provided by the normal BASIC implementation. One of the most useful example is the PHYREC binary program, which added the PHYREAD and the PHYWRITE statements, through which a direct sector access for any mass storage device was available. Other binary programs provided means to read standard SIF tapes or to access, test and diagnose selected memory areas. Because they - for certain applications - added very useful functionality to the standard BASIC, they are generally still of high interest. The funny side is, that keyword usage in BASIC programs was intentionally protected by 'secured lines' in many cases, in order to hide both purpose and usage for the normal user.

Special importance is due to the TBIN test binary program. This program was generally used by the service personnel in combination with the 09845-65520 Test ROM cartridge. It provides a number of highly useful diagnostics for exercising the different functional areas of a 9845 system and for the identification and isolation of defects.


Program binary


        Program Binary adalah program khusus yang terdiri dari kode obyek murni. program biner biasanya digunakan sebagai ekstensi untuk interpreter BASIC, yaitu mereka melaksanakan satu atau lebih laporan baru DASAR. Sebenarnya, program biner hanya program bahasa mesin yang biasanya ditulis dalam assembler dan yang dapat digunakan untuk tujuan apapun, baik sebagai lengkap, program mandiri atau sebagai perpanjangan perintah DASAR ditetapkan.

Pendekatan bagaimana program biner digunakan dengan program BASIC berbeda dengan cara standar bagaimana hal itu biasanya dilakukan dalam dialek BASIC lainnya. Salah satu perbedaan adalah, bahwa HP9845 DASAR cukup baik dilindungi terhadap segala jenis mesin referensi alamat, termasuk melompat langsung ke alamat mesin sewenang-wenang. Sebaliknya, HP menyediakan sarana untuk me-load modul kode objek ke dalam memori dan untuk menambah rutinitas mereka bersama-sama dengan kata kunci yang berhubungan dengan set instruksi DASAR yang sudah disediakan oleh firmware LPU 9845.

Untuk program BASIC panggilan, tidak ada perbedaan apakah rutin milik kata kunci khusus diimplementasikan secara permanen dalam ROM atau sementara dimuat ke R / W memori. Mungkin, cara HP adalah sedikit lebih canggih dan aman dibandingkan dengan pendekatan standar dengan laporan SYS dan USR, karena DASAR ROM dapat diperpanjang dengan instruksi baru yang nyata dan was'nt terlalu mudah untuk membekukan sistem tanpa sengaja melalui melompat ke alamat yang salah. Di sisi lain, melalui pengabaian laporan lengkap dari standar akses langsung DASAR seperti MENGINTIP, aduk, ADR, SYS dan USR, setiap akses dari dalam BASIC ke sumber daya sistem benar-benar diblokir.

program biner juga dapat digunakan untuk mengimplementasikan aplikasi lengkap. Sistem biner TBIN uji adalah seperti contoh, bekerja seperti program lain, dengan perbedaan bahwa itu benar-benar dalam kode mesin. Fungsi yang disediakan oleh program ini didorong menu saya dan shortcut keyboard.

program biner harus memenuhi beberapa aturan. Aturan pertama adalah bahwa tidak mungkin untuk menentukan lokasi memori tertentu di mana kode objek harus dipasang. Sebagai akibatnya, kode objek modul harus dirancang dengan kode sepenuhnya relokasi. Keistimewaan lain adalah bahwa setiap modul biner harus memiliki header pasti yang menyimpan informasi tentang kata kunci (s) yang masing-masing dengan rutin modul itu dipanggil, informasi versi dari modul, dan cara bagaimana laporan bisa syntaxed, terdaftar dan dijalankan dalam sebuah program BASIC.

modul biner dapat disimpan dan dimuat dengan cara yang berbeda, baik sendirian (dengan perintah LOAD BIN) atau dalam kombinasi dengan program BASIC (lihat bagian Perangkat Lunak Arsitektur untuk informasi lebih lanjut tentang penggunaan dan struktur rutinitas biner). Semua program biner dapat mencakup rutin khusus yang secara otomatis dijalankan setelah loading.

Karena program biner dapat digunakan untuk memperluas set pernyataan yang dilaksanakan di firmware, itu adalah cara ideal untuk mengimplementasikan beberapa fungsi khusus yang tidak dapat dilakukan di BASIC. Ini termasuk bahkan fungsionalitas tingkat rendah, yang sengaja tidak disediakan oleh pelaksanaan DASAR normal. Salah satu contoh yang paling berguna adalah program PHYREC biner, yang menambah PHYREAD dan laporan PHYWRITE, melalui mana sektor akses langsung untuk setiap perangkat penyimpanan massal yang tersedia. program biner lain yang disediakan berarti membaca standar SIF kaset atau untuk mengakses, menguji dan mendiagnosis daerah memori yang dipilih. Karena mereka - untuk aplikasi tertentu - menambahkan fungsionalitas yang sangat berguna bagi BASIC standar, mereka umumnya masih bunga yang tinggi. Sisi lucu adalah, bahwa penggunaan kata kunci dalam program BASIC sengaja dilindungi oleh 'baris dijamin' dalam banyak kasus, untuk menyembunyikan tujuan dan penggunaan baik untuk pengguna biasa.

Khusus pentingnya adalah karena program uji TBIN biner. Program ini umumnya digunakan oleh petugas servis dalam kombinasi dengan cartridge ROM 09845-65520 Test. Ini menyediakan sejumlah diagnostik yang sangat berguna untuk melaksanakan bidang fungsional yang berbeda dari sistem 9845 dan untuk identifikasi dan isolasi cacat.



Tidak ada komentar:

Posting Komentar