Keystroke programming

Keystroke programming describes a specific way of programming by which each keystroke on a device or application is recorded in some way and then played back so that the recorded key-presses can be repeated multiple times. Keystroke programming is most commonly but not exclusively found in programmable calculators, but there are keystroke-programmable software applications, too, for example Vim (text editor)[1]

Example: TI Calculators

The TI-58C

The Texas Instruments TI-58/TI-58C/TI-59 calculators were programmable, and program storage took the form of a sequence of codes which (mostly) corresponded to the position of keys on the calculator keypad. Here is a simplified diagram of the basic key layout:

  x1 x2 x3 x4 x5
1x  A   B   C   D   E 
2x 2nd INV lnx CE CLR
3x LRN x⇌t x2 x 1/x
4x SST STO RCL SUM yx
5x BST EE  (   )   ÷ 
6x GTO  7   8   9   × 
7x SBR  4   5   6   - 
8x RST  1   2   3   + 
9x R/S  0   .  +/-  = 

Each key is assigned a two-digit code; for most (but not all) keys, the tens digit comes from the row number (as indicated down the left of the table) and the units digit comes from the column number (as indicated across the top of the table).

Now consider a very simple program, which adds 2 to the number being displayed, and then stops. The program is entered starting from program location 000, and looks like this:

Location Contents Meaning Comments
000 85 +
001 02 2
002 95 = compute result
003 91 R/S stop program

To use this program, you would enter the number n to be operated on, press RST to ensure the current program location was 000, then R/S to start execution. When the program stops (which should happen quite quickly for such a simple program), the display will be showing the number n + 2.

You can see that the codes 85, 95 and 91 correspond to the positions of the keys labelled  + ,  =  and R/S on the grid above, but the code for the  2  is not 83 as you would expect from the grid position, but 02. This last code was chosen to be more easily understandable by a human trying to read the program. There is no row 0, so the codes 00 .. 09 are used to represent the keys  0  ..  9 .

Context-Dependent Interpretations

These TI calculators allowed for addressing up to 100 data memory locations, numbered 00 to 99 (some models had a lower limit than this). A keystroke sequence like STO  4   2  (store the currently-displayed number into memory 42) would be encoded as 42 42. In this case the first 42 is the key code for the STO key, but the second 42 is not a key code, but a memory register number. The calculator knows to interpret it as such because that's what has to follow the code for the STO key.

Program addresses were 3 digits, potentially allowing programs to consist of up to 1000 steps, numbered 000 to 999 (though in fact none of the models produced allowed for this maximum). A branch instruction, for example GTO  3   4   5  (unconditional branch to location 345) would be encoded as 61 03 45. In this case the hundreds digit of the branch destination is in the units digit of the second instruction byte (after the opcode), with a zero tens digit; and the remaining digits are in the third instruction byte.

A code sequence like 61 11, on the other hand, represents the keystrokes GTO  A , which is a branch to the location marked by the symbolic label  A . The calculator can tell this is a symbolic branch, rather than a branch to a numbered location, because the tens digit of the byte immediately following the opcode is not zero.

Most of the keys on the keypad can be used as symbolic labels. For example, sequences like GTO STO and GTO GTO are legitimate, provided that STO and GTO have in fact been defined as labels somewhere in the program.

Modifier Keys

Most of the keys had multiple functions, depending on whether INV or 2nd had been pressed beforehand. INV invoked the "inverse" (whatever that meant) of the following function, and was recorded in a program as a separate keystroke (code 22), while 2nd invoked a completely different function which was written on the keypad faceplate just above the key. For example, pressing 2nd x2 invoked the sin function, while INV 2nd x2 (or INV sin) gave you the arcsine.

The code for this alternate function is derived from that of the original key function by adding 5 to the units digit (without carry to the tens digit). Thus, the key codes corresponding to the position of the 2nd key itself (21 and 26) are never used as opcodes. Here is the table of the codes produced with the 2nd prefix:

  x6 x7 x8 x9 x0
1x  A'   B'   C'   D'   E' 
2x   INV log CP CLR
3x Pgm P→R sin cos tan
4x Ins CMs Exc Prd Ind
5x Del Eng Fix Int |x|
6x Pause x=t Nop Op Deg
7x Lbl x≥t Σx mean(x) Rad
8x St flg If flg D.MS π Grad
9x Write Dsz Adv Prt List

Merged Keystrokes

The Ind key allows for indirection: wherever a reference to a memory register or a program location is allowed, this key can be used to fetch the actual value from a memory register. For example, the key sequence RCL Ind  1   0  means to fetch the value in memory register 10, and use that value in turn as the number of a memory register whose contents are to be fetched as the current operand. However, in this case the Ind cannot be encoded as code 40, because the code sequence 43 40 would be interpreted as RCL  4   0 , not RCL Ind.

But, because of the use of the 00 .. 09 codes for the  0  ..  9  keys, the codes 62-64, 72-74, 82-84 and 92 are available for other uses. So most of these are reallocated to represent op Ind sequences:

  x2 x3 x4
6x Pgm Ind Exc Ind Prd Ind
7x STO Ind RCL Ind SUM Ind
8x   GTO Ind Op Ind
9x INV SBR    

Thus, the key sequence RCL Ind  1   0  would be encoded as 73 10.

Note the use of code 92 for INV SBR (return from subroutine); this was not necessary for reasons of ambiguity, but was done to save space with such a common sequence.

See also

References

Read other articles:

County of Romania County in Sud-Vest, RomaniaGorj County Județul GorjCounty Coat of armsCoordinates: 45°02′N 23°18′E / 45.04°N 23.3°E / 45.04; 23.3Country RomaniaDevelopment region1Sud-VestHistoric regionOlteniaCapital city (Reședință de județ)Târgu JiuGovernment • TypeCounty Board • President of the County BoardCosmin-Mihai Popescu • Prefect2Ciprian Adrian FlorescuArea • Total5,602 km2 (2,163 ...

 

Стиль этой статьи неэнциклопедичен или нарушает нормы литературного русского языка. Статью следует исправить согласно стилистическим правилам Википедии. Семья Чивелла Территория Различные районы Канзас-Сити, имеется влияние в Лас-Вегасе и Сент-Луисе. Этнический соста...

 

This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: Image placement. Please help improve this article if you can. (April 2023) (Learn how and when to remove this template message) This is a list of airports in Ontario. It includes all Nav Canada certified and registered water and land airports, aerodromes and heliports in the Canadian province of Ontario.[1][2] Airport names in italics are part of the National Airports System.[3...

Menàrguens Gemeente in Spanje    Situering Autonome regio Catalonië Provincie Comarca Lleida Noguera Coördinaten 41° 44′ NB, 0° 45′ OL Algemeen Oppervlakte 20,53 km² Inwoners (1 januari 2016) 847 (41 inw./km²) Provincie- engemeentecode 25.134 https://www.menarguens.cat/ Detailkaart Locatie in Catalonië Portaal    Spanje Menàrguens is een gemeente in de Spaanse provincie Lleida in de regio Catalonië met een oppervlakte van 21 km². Menàrguen...

 

Ethnic group Not to be confused with Crimean Tatars. Volga TatarsтатарларMöxämmät-Ämin, three-time ruler of Kazan Khanate, mentioned in the Tsar Book during 16th century.Total populationc. 6.2 millionRegions with significant populations Russia:  Tatarstan: 2,012,571 (Official)  Bashkortostan: 1,009,295  Moscow: 149,0435,310,649[1] Uzbekistan467,829[2] Kazakhstan203,371[3] Ukraine73,304[4] Turkmenistan36,355 ...

 

عدد المقالات الموجودة حاليا في ويكيبيديا العربية والمرتبطة بالإمارات العربية المتحدة هو : 4٬074 مقالة. محتويات البوابة: مقالة مختارة | مدينة مختارة | شخصية مختارة | صور مختارة | هل تعلم | إمارة مختارة | مشروع ويكي الإمارات العربية المتحدة | قوالب عن الإمارات العربية المتحدة | ب

ملخص معلومات الملف وصف هذا شعار: Plankton مصدر (http://villains.wikia.com/wiki/Plankton) تاريخ 1999 منتج SpongeBob SquarePants الإذن(إعادة الاستخدام) انظر أدناه ترخيص هذه الصورة هي توضيح لشخصية أو شخصيات خيالية من مجلة قصص مصورة، أو لعبة فيديو، أو برنامج رسوم متحركة تلفزيونيّ أو سينمائيّ. هذه الصور ذات حقوق ...

 

Francis TurretinFrancis TurretinLahir(1623-10-17)17 Oktober 1623Meninggal28 September 1687(1687-09-28) (umur 63)PekerjaanTeolog Francis Turretin (17 Oktober 1623 – 28 September 1687; juga dikenal sebagai François Turrettini ) adalah seorang teolog skolastik Reformed Jenewa keturunan Italia.[1] Turretin paling dikenal sebagai penentang teologi Calvinis moderat dari Akademi Saumur [2] (yang dipopulerkan oleh Moise Amyraut dan disebut sebagai Amyraldisme ). Ia adalah sala...

 

1923 film This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: The Love Nest 1923 film – news · newspapers · books · scholar · JSTOR (April 2019) (Learn how and when to remove this template message) The Love NestDirected byEdward F. Cline Buster KeatonWritten byBuster KeatonProduced byJoseph M. SchenckStarri...

Artikel ini memerlukan pemutakhiran informasi. Alasannya: 2021 data from EDGAR at https://edgar.jrc.ec.europa.eu/. Harap perbarui artikel dengan menambahkan informasi terbaru yang tersedia. Emisi karbon dioksida global menurut negara pada tahun 2015. Sumber: Basis Data Emisi untuk Penelitian Atmosfer Global. Halaman ini berisi artikel tentang only carbon dioxide. Untuk the carbon dioxide equivalent of all greenhouse gases combined, lihat List of countries by greenhouse gas emissions. Negara d...

 

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Hyperprism Varèse – news · newspapers · books · scholar · JSTOR (October 2015) (Learn how and when to remove this template message) Edgard Varèse, 1915 Hyperprism is a work for wind, brass, and percussion instruments by Edgard Varèse, composed in 1922 a...

 

Species of sea turtle See also: Olive ridley sea turtle and Ridley sea turtle Kemp's ridley sea turtle Lepidochelys kempii Conservation status Critically Endangered (IUCN 3.1)[1] CITES Appendix I (CITES)[2] Scientific classification Domain: Eukaryota Kingdom: Animalia Phylum: Chordata Class: Reptilia Order: Testudines Suborder: Cryptodira Superfamily: Chelonioidea Family: Cheloniidae Genus: Lepidochelys Species: L. kempii Binomial name Lepidochelys kempii(Garman...

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: grammar. Please help improve this article if you can. (August 2021) (Learn how and when to remove this template message) This article needs to be updated. Please help update this article to reflect recent events or newly available information. (A...

 

Elsässisches FahnenliedEnglish: The Alsatian Flag's songTraditional Flag of Alsace Instrumental version, 2023Regional anthem of  AlsaceLyricsEmil WoerthMusicEmil WoerthAdopted1911 Part of a series onAlsaceRot un Wiss, traditional flag of Alsace History Germania Superior (Pagus Alsatiae) (83–475) Alemanni (circa 213–496) Alamannia (3rd-century–911) Duchy of Alsace (circa 630–699) Treaty of Verdun (843) Prince-Bishopric of Strasbourg (982–1803) County of Ferrette (11th-cent...

 

У этого термина существуют и другие значения, см. Сектор Газа (значения). Сектор Газа Флаг 31°27′ с. ш. 34°24′ в. д.HGЯO Страна  Государство Палестина[1] Адм. центр Газа Глава Махмуд Аббас и Хания, Исмаил История и география Дата образования 1949 Площадь 360 км...

President of the Republic of Kosovo since 2021 Vjosa OsmaniOfficial portrait, 20215th President of KosovoIncumbentAssumed office 4 April 2021Prime MinisterAlbin KurtiPreceded byGlauk Konjufca (acting)Acting5 November 2020 – 22 March 2021Prime MinisterAvdullah HotiPreceded byHashim ThaçiSucceeded byGlauk Konjufca (acting)6th Speaker of the Assembly of KosovoIn office3 February 2020 – 22 March 2021PresidentHashim ThaçiPreceded byGlauk KonjufcaSucceeded byGlauk Konjuf...

 

American gridiron football player and executive (1930–2015) American football player Eddie LeBaronLeBaron in 1958No. 14Position:QuarterbackPersonal informationBorn:(1930-01-07)January 7, 1930San Rafael, California, U.S.Died:April 1, 2015(2015-04-01) (aged 85)Stockton, California, U.S.Height:5 ft 7 in (1.70 m)Weight:168 lb (76 kg)Career informationHigh school:Oakdale (Oakdale, California)College:Pacific (1946–1949) Quantico Marines (1950)NFL Draft:1950 / ...

 

Roque Ditro Nazionalità  Argentina Calcio Ruolo Difensore Termine carriera 1967 Carriera Giovanili 195?-1957 Argentinos Juniors Squadre di club1 1957-1961 Argentinos Juniors93 (0)1962-1964 River Plate23 (0)1965-1966 Boca Juniors6 (0)1967 Dep. Español17 (0) Nazionale 1963 Argentina3 (0) Palmarès  Campeonato Sudamericano Bronzo Bolivia 1963 1 I due numeri indicano le presenze e le reti segnate, per le sole partite di campionato.Il simbolo → indica un tras...

El último cartucho Año 1894Autor Juan LepianiTécnica Óleo sobre lienzoLocalización Museo de los Combatientes del Morro de Arica, Lima, Perú Perú[editar datos en Wikidata] El último cartucho es un óleo del pintor peruano Juan Lepiani realizado en 1894. Actualmente se conserva en el Museo de los Combatientes del Morro de Arica (Lima). Sobre el autor Juan Lepiani (1864-1932) fue un pintor natural de Lima, que desde la última década del siglo XIX se hizo conocido por sus...

 

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help to improve this article by introducing more precise citations. (July 2013) (Learn how and when to remove this template message) This article needs additional citations for verification....

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!