📜 ⬆️ ⬇️

Assembler in 30 lines on Excel

In the title, the word order is not confused.



Young programmer Adam Kiss lives in Hungary. He participates in something like the KöMaL online Olympiad. To solve tasks in computer science, it is proposed to use several ordinary programming languages: C, C ++, Python, and some others. In one of the tasks required to write a Minesweeper and a bot to play it. Such a problem is very easily solved by means of a table processor - the same Excel, for example, and macro bundles. However, macros cannot be used. Adam got out in an unusual way: he implemented a simple virtual computer in an Excel book that is programmed in Assembler - Excembler.

Formally, it fits the requirements of the Olympiad. Macros are not used, only built-in logic functions. The “computer” file is available for download, but it is in Hungarian. Google translate plus common sense seems to be allowed to figure it out. Implemented some simple invented assembler. Probably, someone from readers will specify a prototype. Briefly describe what happened. On the first sheet, the actual program code and the result of the execution. In the colored columns, the state of the registers before the execution of the corresponding operation, the code on the left and the arguments. The meaning of the OUT-assist column is not completely clear, it seems that changes in the result register are tracked there. Sheet Out - Results; Sheet Data - Input. They can be addressed by row and column number and loaded into the LD register with the LOAD command. Command set - help system commands. Hope that translated correctly. Examples are a few examples. It was not entirely clear where they were loading the data from. It is necessary to look directly on the code. For example, LOAD 2,3 is a query of the Data! B3 cell, if nothing messed up.
')
Conclusion: an interesting toy to play in the evening

Bibliography:
www.komal.hu/verseny/feladat.cgi?a=feladat&f=I358&l=en the task of the Olympiad
hackaday.io/project/3680-exembler proper project. Almost empty, but there you can download Excel file in Hungarian
hackaday.com/2014/12/25/writing-a-virtual-machine-in-excel news on Hackdey
www.dropbox.com/s/xjk5sqtarsgvnex/exembler_v0.2.xlsx?dl=0 (possibly crooked) translated table

Source: https://habr.com/ru/post/246975/


All Articles