{"id":2020,"date":"2025-09-07T10:35:22","date_gmt":"2025-09-07T08:35:22","guid":{"rendered":"https:\/\/pockemul.com\/?p=2020"},"modified":"2025-09-07T10:41:48","modified_gmt":"2025-09-07T08:41:48","slug":"lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262","status":"publish","type":"post","link":"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/","title":{"rendered":"LC-3 Compiler User Manual for SHARP PC-1261\/PC-1262"},"content":{"rendered":"\n<p>This is a compiler for Pocket Computer created around 1987~1988.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Compiler and Runtime Library are very compact and can coexist in memory.\n<ul class=\"wp-block-list\">\n<li>You can edit, compile, and run source code in memory.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>A lot of useful instructions for the game.<\/li>\n\n\n\n<li>The generated code is small and fast because variables are stored in RAM.<\/li>\n<\/ul>\n\n\n\n<p>I recently made <strong>PockEmul compatible with the LC-3 Compiler<\/strong> for the Sharp PC-1261\/1262. It will be part of <strong>PockEmul 2.10.0<\/strong><\/p>\n\n\n\n<p>This required extensive groundwork, as the compiler relies heavily on undocumented features of the <strong>SC61860 processor<\/strong>, many of which had not yet been implemented in the emulator.<\/p>\n\n\n\n<p>The compiler enables developers to write programs directly in BASIC, using special instructions, and then compile the code into <strong>LM format<\/strong>, all within the pocket computer itself.<\/p>\n\n\n\n<p>It is particularly well-suited for creating fast-paced graphical games.<\/p>\n\n\n\n<p>Originally developed in Japan, the compiler had <strong>no existing English documentation<\/strong> available until now.<\/p>\n\n\n\n<p>To address this, I\u2019ve translated the <a href=\"https:\/\/x.com\/poyokoma_danna\/status\/1932077143309369610\">X thread by @poyokoma_danna<\/a>, which details LC-3 functionalities, and supplemented it with a translation of the official documentation (<a href=\"https:\/\/github.com\/hiroog\/LC3_Compiler\">hiroog\/LC3_Compiler: LC-3 Compiler for SHARP PC-1261\/PC-1262<\/a>).<\/p>\n\n\n\n<!--more-->\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_78 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Installation\" >Installation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#About_ERRORS\" >About ERRORS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Expression_definition\" >Expression definition<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Constant_0-255\" >Constant 0-255<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Character_constant_%E2%80%9C1_Character%E2%80%9D\" >Character constant &#8220;1 Character&#8221;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Variables_A-Z\" >Variables A-Z,@<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Array_Variable_%E2%88%9Aexpression\" >Array Variable \u221aexpression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Functions\" >Functions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Operators\" >Operators<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Functions-2\" >Functions<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#INKEY\" >INKEY$<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#INPUT\" >INPUT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#INT\" >INT<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#AREAD\" >AREAD<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#READ\" >READ<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#RND_exp\" >RND exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#PEEK_exp\" >PEEK exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#PI_exp1exp2\" >PI exp1,exp2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#LOG_exp\" >LOG exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#EXP_exp\" >EXP exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#ABS_exp\" >ABS exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#SGN_exp\" >SGN exp<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Instructions\" >Instructions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Memory_and_Data_instructions\" >Memory and Data instructions<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Variable_expression\" >Variable = expression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Array_variable_expression_constant_2_constant_3_%E2%80%A6\" >Array variable = expression, [constant 2, constant 3, \u2026<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Array_variable_hexadecimal_data\" >Array variable; hexadecimal data~<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#CLEAR_exp\" >CLEAR exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#VAL\" >VAL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#DIM_exp\" >DIM exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#RESTORE_label\" >RESTORE label<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#DATA_constant_constant_2_constant_3_%E2%80%A6\" >DATA constant, [constant 2, constant 3, \u2026 ]<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#_Hexadecimal_data\" >! Hexadecimal data<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Control_Instructions\" >Control Instructions<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Label\" >Label<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#GOTO_label\" >GOTO label<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#GOSUB_label_RETURN\" >GOSUB label RETURN<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#ASN\" >ASN<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#IF\" >IF<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#RUN\" >RUN<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#WAIT_n\" >WAIT n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#PAUSE_n\" >PAUSE n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#STOP\" >STOP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#REM\" >REM ~<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#END\" >END<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-46\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#_period\" >. (period)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-47\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#GRAPHICS\" >GRAPHICS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-48\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Display_Commands\" >Display Commands<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-49\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#CLS_n\" >CLS n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-50\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#CURSOR_exp\" >CURSOR exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-51\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#PRINT_expression\" >PRINT expression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-52\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#LPRINT_expression\" >LPRINT expression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-53\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#CHR_expression\" >CHR$ expression<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-54\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#DEG_Two-digit_hexadecimal%E2%80%A6\" >DEG Two-digit hexadecimal&#8230;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-55\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#POKE_expression\" >POKE expression<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-56\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Graphics_Instructions\" >Graphics Instructions<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-57\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#ON_xy\" >ON x,y<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-58\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#GRAD_hexadecimal_data\" >GRAD hexadecimal data~<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-59\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#COS_mn\" >COS m,n<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-60\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#TRON_xy\" >TRON x,y<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-61\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#TROFF_xy\" >TROFF x,y<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-62\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#Sound_Instructions\" >Sound Instructions<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-63\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#BEEP_exp\" >BEEP exp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-64\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#SIN_exp1exp2\" >SIN exp1,exp2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-65\" href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/#DMS_%E2%80%9Cstring%E2%80%9D\" >DMS &#8220;string&#8221;<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n\n<h1 class=\"wp-block-heading\" id=\"installation\"><span class=\"ez-toc-section\" id=\"Installation\"><\/span>Installation<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>First, it&#8217;s essential to <strong>reserve a memory area for the LC-3 compiler<\/strong> to ensure it remains intact while entering BASIC code.<\/p>\n\n\n\n<p>This is done using the EQU # instruction, originally designed to allocate memory for the \u201cEasy Simulation Program\u201d (refer to chapter 9 in the official documentation).<br>To prepare the space needed by LC-3, <strong>enter EQU#43<\/strong>, which reserves 44 \u00d7 128 bytes.<\/p>\n\n\n\n<p>Next, <strong>load the LC-3 binary at address 0x4000<\/strong> \u2014 there&#8217;s a convenient entry in the contextual menu that automates this process.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2072\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"257\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/08\/image-1024x257.png\" alt=\"\" class=\"wp-image-2072\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/08\/image-1024x257.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/08\/image-300x75.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/08\/image-768x193.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/08\/image.png 1074w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<p>\ud83d\udcdd <strong>Important:<\/strong> It\u2019s recommended to use the <strong>Japanese version of the PC-1262<\/strong>, as the compiler relies on the <strong>Yen (\u00a5) character<\/strong>, which is absent from export models.<\/p>\n\n\n\n<p>Now you&#8217;re ready to <strong>enter your LC-3 source code as if writing a BASIC program<\/strong>.<br>In <strong>PRO mode<\/strong>, follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter your source code<\/li>\n\n\n\n<li>Compile it with : CALL &amp;4000<\/li>\n\n\n\n<li>If the compilation completes without errors then : CALL &amp;4900 will launch execution<\/li>\n\n\n\n<li>Use BRK to exit the program<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"About_ERRORS\"><\/span>About ERRORS<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>If an error (Table 2) occurs during compilation, the type of error is displayed, and when you press (up arrow) in PRO mode, the location of the error is displayed (except for ERROR 4).<\/p>\n\n\n\n<p>In the following case, do not press up or down arrow but <strong>turn the power OFF first.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After the error number, IN~ and the line number is displayed.<\/li>\n\n\n\n<li>It stopped when it displayed anything other than the prompt &#8220;&gt;&#8221;.<\/li>\n\n\n\n<li>An error was displayed while running the program, not while compiling.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2024\"><img loading=\"lazy\" decoding=\"async\" width=\"579\" height=\"448\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-1.png\" alt=\"\" class=\"wp-image-2024\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-1.png 579w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-1-300x232.png 300w\" sizes=\"(max-width: 579px) 85vw, 579px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>0<\/td><td>Syntax Error, such as a missing operand. A value other than a constant was used in the DATA statement.<\/td><\/tr><tr><td>1<\/td><td>\u221aformula;~, No data for DMS,DEG, GRAD If you specify null for &#8220;character string&#8221;<\/td><\/tr><tr><td>3<\/td><td>There is an error in the DMS *~* data<\/td><\/tr><tr><td>4<\/td><td>The object does not fit in the object area. In this case, increase the EQU# value and recompile<\/td><\/tr><tr><td>9<\/td><td>There is no IF condition &gt;==<\/td><\/tr><tr><td>10<\/td><td>A label was defined twice or inn IF statement<\/td><\/tr><tr><td>&nbsp;<\/td><td>Common syntax error, undefined instruction, incorrect label name, etc.<\/td><\/tr><tr><td>?<\/td><td>An undefined label was used<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Expression_definition\"><\/span>Expression definition<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Constant_0-255\"><\/span>Constant 0-255<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you write a value greater than 255, the reminder when you divide it by 256 will be used.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Character_constant_%E2%80%9C1_Character%E2%80%9D\"><\/span>Character constant &#8220;1 Character&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This value is the ASCII code of the character (one character). In the case of a string, only the last character is valid.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Variables_A-Z\"><\/span>Variables A-Z,@<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>There are 27 of them.<br>You can switch between the &#8220;front&#8221; and &#8220;hidden&#8221; variables using the VAL command.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Array_Variable_%E2%88%9Aexpression\"><\/span>Array Variable \u221a<em>expression<\/em><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can use 256 variables, from \u221a0 to \u221a255.<br>Example:<br><strong>\u221a1=2 <\/strong>\u2192 Stores 2 in array variable 1.<br><strong>A=23:\u221aA=4:\u221aA+1=5<\/strong> \u2192 Stores 4 in array variable 23 and 5 in array variable 24.<\/p>\n\n\n\n<p>The array \u221a96-\u221a255 is also used as the data area for defined characters. Five arrays correspond to one character, and are written in reverse order:<br>\u221a96-\u221a100 are No 0 and a maximum of 32 characters can be defined.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Functions\"><\/span>Functions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can omit parentheses for functions that require arguments.<br>However, be careful about how you handle the arguments.<br>Example:<br>EXP 2 + 1 -&gt; 8<br>EXP 2 ) + 1 -&gt; 5<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Operators\"><\/span>Operators<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\uff0b\u30fc\uff0a\uff0f are the usual arithmetic operations.<\/li>\n\n\n\n<li>\uff05 gets the remainder<\/li>\n\n\n\n<li>OR, AND can perform logical operations<\/li>\n<\/ul>\n\n\n\n<p>Overflow is ignored, and the lower 8-bit value is returned.<br>Fractions from division are rounded down.<br>Dividing by 0 returns 255.<br>There is <strong>no operator precedence<\/strong>, and operations are executed from left to right<br><strong>A=3+5*2<\/strong> becomes 16<br>To follow operator precedence, use parentheses<br><strong>A=3+(5*2) <\/strong>becomes 13<\/p>\n\n\n\n<p>If you use multiple layers of arrays, functions and parentheses, the stack may run out of space and the program crash.<br>Keep the number of layers, including arrays,function and parentheses, to three or less.<br>A = \u221a ( ABS B ) ) )     Correct<br>( \u221a A + SGN \u221a B ) ) )   not correct<br>( \u221a A ) + SGN \u221a B ) ) )     Correct<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Functions-2\"><\/span>Functions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"INKEY\"><\/span>INKEY$<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Returns the character code of the key pressed during real-time key scanning<br>If no input is detected, it returns 0<br>It cannot detect multiple keys simultaneously<br>If multiple keys are pressed, it returns 1<\/p>\n\n\n\n<p>Since it returns a character code, let\u2019s talk about characters<br>A &#8220;single character&#8221; corresponds to a 1-byte numerical character code<br>If multiple characters are specified, it returns the code of the last single character<\/p>\n\n\n\n<p>Some keys not included in the character code are also specified<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2025\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"208\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-2.png\" alt=\"\" class=\"wp-image-2025\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-2.png 560w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-2-300x111.png 300w\" sizes=\"(max-width: 560px) 85vw, 560px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>0<\/td><td>No input<\/td><\/tr><tr><td>1<\/td><td>Multiple keys<\/td><\/tr><tr><td>2<\/td><td>CL<\/td><\/tr><tr><td>4<\/td><td>Up arrow<\/td><\/tr><tr><td>5<\/td><td>Down Arrow<\/td><\/tr><tr><td>13<\/td><td>ENTER<\/td><\/tr><tr><td>14<\/td><td>Right arrow<\/td><\/tr><tr><td>15<\/td><td>Left arrow<\/td><\/tr><tr><td>16<\/td><td>SHIFT<\/td><\/tr><tr><td>18<\/td><td>DEF<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Sample:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>10 CLS 0:X=0:Y=0<br>20 %A:TRON X,Y:WAIT 30<br>30 A=INKEY$:IF A=\"4\":X=X-1:IF X=255:X=119<br>40 IF A=\"6\":X=X+1:IF X=120:X=0<br>50 IF A=\"2\":Y=Y+1:IF Y=14:Y=0<br>60 IF A=\"8\":Y=Y-1:IF Y=255:Y=13<br>70 GOTO %A<\/code><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2026\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-3-1024x541.png\" alt=\"\" class=\"wp-image-2026\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-3-1024x541.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-3-300x158.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-3-768x406.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-3.png 1125w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"INPUT\"><\/span>INPUT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Wait for one character to be entered, SHIFT characters and kana can also be entered.<br>When pressed, it returns the character code.<br>The code is almost the same as INKEY$, but some keys can be obtained while others cannot.<br>The functions and special keys are as shown in table below<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2027\"><img loading=\"lazy\" decoding=\"async\" width=\"549\" height=\"251\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-4.png\" alt=\"\" class=\"wp-image-2027\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-4.png 549w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-4-300x137.png 300w\" sizes=\"(max-width: 549px) 85vw, 549px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>2<\/td><td>CL<\/td><\/tr><tr><td>3<\/td><td>CA<\/td><\/tr><tr><td>4<\/td><td>Up arrow<\/td><\/tr><tr><td>5<\/td><td>Down arrow<\/td><\/tr><tr><td>6<\/td><td>P &lt;-&gt; NP<\/td><\/tr><tr><td>8<\/td><td>Mode switching<\/td><\/tr><tr><td>10<\/td><td>OFF<\/td><\/tr><tr><td>11<\/td><td>INS<\/td><\/tr><tr><td>12<\/td><td>DEL<\/td><\/tr><tr><td>13<\/td><td>ENTER<\/td><\/tr><tr><td>14<\/td><td>Right Arrow<\/td><\/tr><tr><td>15<\/td><td>Left arrow<\/td><\/tr><tr><td>20<\/td><td>HELP<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"INT\"><\/span>INT<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Simultaneous key input:<br>When a key in Table 4 is pressed, the bit becomes &#8220;1&#8221;.<br>For example, if 8 and 6 are pressed, <strong>2+128=130<\/strong> is returned<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2028\"><img loading=\"lazy\" decoding=\"async\" width=\"1025\" height=\"510\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-5.png\" alt=\"\" class=\"wp-image-2028\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-5.png 1025w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-5-300x149.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-5-768x382.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>0 (1)<\/td><td>SHIFT<\/td><\/tr><tr><td>1 (2)<\/td><td>8<\/td><\/tr><tr><td>2 (4)<\/td><td>2<\/td><\/tr><tr><td>3 (8)<\/td><td>4<\/td><\/tr><tr><td>4 (16)<\/td><td>DEF<\/td><\/tr><tr><td>5 (32)<\/td><td>ENTER<\/td><\/tr><tr><td>6 (64)<\/td><td>0<\/td><\/tr><tr><td>7 (128)<\/td><td>6<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"AREAD\"><\/span>AREAD<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Pops a byte value from the data stack.<br>Equivalent to POP (PUSH is DIM)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"READ\"><\/span>READ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Read the data specified by RESTORE in order.<br>Even if it is the very first data, it must be specified with RESTORE beforehand.<br>If there is no data for READ, the value read is undefined.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"RND_exp\"><\/span>RND exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Give a random number in the range of 0 to exp-1 (expression number)<br>If expression is 0, a random number between 0 and 255 is given.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PEEK_exp\"><\/span>PEEK exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When exp is 0 to 239, the corresponding contents of V-RAM (video RAM) are read.<br>V-RAM is 0 to 119 from the top left of the screen, and 120 to 239 from the bottom left.<br>When the expression is 240 or greater, the result is 0.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PI_exp1exp2\"><\/span>PI exp1,exp2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Check the coordinates of the point (exp1,exp2) on the screen.<br>When the dot in ON, the value is 1, when it is OFF, the value is 0, and when it is off the screen, the value is 225.<br>PI itself cannot be used in an expression<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"LOG_exp\"><\/span>LOG exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Return the value of LOG2 exp, truncated to the nearest integer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"EXP_exp\"><\/span>EXP exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Return the value of 2 power exp. For bit operations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ABS_exp\"><\/span>ABS exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Treats the expression as signed and gives it absolute value.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SGN_exp\"><\/span>SGN exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Gives the sign of the expression as signed: 1 for positive, 255 for negative, 0 for zero.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Instructions\"><\/span>Instructions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>You can write multiple command on one line by separating them with a colon.<br>This colon is optional and it is a good idea to group the same commands together to make them easier to understand<br>Example: DIM A DIMB : GOTO ~<\/p>\n\n\n\n<p>You can also omit :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The = when assigning to a normal variable.<\/li>\n\n\n\n<li>The , after PI, ON, COS, TRON, TROFF and SIN<\/li>\n\n\n\n<li>The &#8220;&#8221; after the DMS and ~ commands<\/li>\n<\/ul>\n\n\n\n<p>This is useful when you are short of memory<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Memory_and_Data_instructions\"><\/span>Memory and Data instructions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Variable_expression\"><\/span>Variable = expression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can&#8217;t use LET to assign a value to a variable.<br>Instead, use a colon in an IF statement<br>Example: IF A &lt; 8 : A = A + 1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Array_variable_expression_constant_2_constant_3_%E2%80%A6\"><\/span>Array variable = expression, [constant 2, constant 3, \u2026<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>&nbsp;Assigning to an array variable. In this case, the array name does not need to be enclosed in parentheses, and consecutive assignments can be made.<br>Example: \u221a0=7:\u221a1=5:\u221a2=0<br>can be entered as: \u221a0=7,5,9<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Array_variable_hexadecimal_data\"><\/span>Array variable; hexadecimal data~<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Assign consecutive hexadecimal values. This can be used in defining characters directly in an array.<br><strong>When assigning consecutive values to an array, be careful not to exceed \u221a255<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CLEAR_exp\"><\/span>CLEAR exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Clear an array variable with the value of an expression.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"VAL\"><\/span>VAL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Replace 27 variables with hidden variables.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"DIM_exp\"><\/span>DIM exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Write a byte value to the data stack.<br>The data stack as a total of 128 levels, connected like a ring and can be PUSHed (DIM) and POPed (AREAD) as many times as you like.<br>Also, even if you stop the execution, the contents remain.<br>If you press CLEAR ENTER directly, it will become 0, so it can used for high scores, etc \u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"RESTORE_label\"><\/span>RESTORE label<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Specify the data to be read with READ. Use the DATA statement when the data is in decimal, and !~ when it is in hexadecimal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"DATA_constant_constant_2_constant_3_%E2%80%A6\"><\/span>DATA constant, [constant 2, constant 3, \u2026 ]<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Write the value of a constant (character constant) directly to the object. When executed, it will be treated as machine code, so place it after END.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"_Hexadecimal_data\"><\/span>! Hexadecimal data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Write the hexadecimal value directly to the object.<br>There are sub commands<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&lt; Go back one address<\/li>\n\n\n\n<li>&gt; Advance one address<\/li>\n\n\n\n<li>+Label&nbsp;&nbsp;&nbsp; Write the label value.<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Control_Instructions\"><\/span>Control Instructions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Label\"><\/span>Label<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The label consists of 2 characters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The 1st character is one of #, $, &amp;, % (4 options)<\/li>\n\n\n\n<li>The 2nd character is one of A-Z, @, ;, &lt;, =, &gt;, ? (32 options)<\/li>\n<\/ul>\n\n\n\n<p>These are combined for use.<br>Personally, I find that mixing in symbols that could be mistaken for other uses makes the program harder to read, so I mainly use # with A-Z. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GOTO_label\"><\/span>GOTO label<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When using GOTO, you can use ^ as a label.<br>This represents the start of the definition line.<br>By setting the start of a line as the beginning of a loop or similar, you can save labels without needing to define them.<br>10 GOTO ^<br>This creates an infinite loop. (Note: The booklet explains the above, but in practice, running it will require stopping with a reset.)<\/p>\n\n\n\n<p>Sample using GOTO and variables:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 A=0\n20 #A:CURSOR A:\"(PC-1261\/2)\"\n30 A=A+1%64:WAIT 5:GOTO #A<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2037\"><img loading=\"lazy\" decoding=\"async\" width=\"1534\" height=\"311\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/lc3_1.gif\" alt=\"\" class=\"wp-image-2037\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GOSUB_label_RETURN\"><\/span>GOSUB <em>label<\/em> RETURN<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This is pretty standard.<br>It jumps to the label as a subroutine, and returns to the original process with RETURN.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ASN\"><\/span>ASN<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It\u2019s not used often, but it moves back one level of subroutine nesting.<\/p>\n\n\n\n<p>When you jump to a process with GOSUB but want to jump elsewhere with GOTO, the nesting of subroutines can become an issue.<\/p>\n\n\n\n<p>So, you can move back one level and continue processing without needing to RETURN.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sample:\n10 A=0\n20 %A:GOSUB &amp;A:A=A+1: WAIT 5: IF A&lt;65 GOTO ^\n30 GOSUB &amp;A:A=A-1: WAIT 5: IF A\u00a50 GOTO ^\n40 GOTO %A\n50 &amp;A: CURSOR A:\"(PC-1261\/2)\":RETURN<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"IF\"><\/span>IF<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The second aspect of control is IF and conditional expressions<\/p>\n\n\n\n<p>\u2460 IF <em>conditional expression<\/em> GOTO <em>label<\/em><br>If the conditional expression is true, it jumps to the label<\/p>\n\n\n\n<p>\u2461 IF <em>conditional expression<\/em>: <em>execution statement<\/em>&#8230;<br>If the conditional expression is true, it performs the processing from the execution statement onward<\/p>\n\n\n\n<p>The following four conditional expressions can be used:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>= : Both sides are the same<\/li>\n\n\n\n<li>\uffe5: Both sides are different (equivalent to \u2260, !=, &lt;&gt; in other languages)<\/li>\n\n\n\n<li>&lt; : The left side is smaller<\/li>\n\n\n\n<li>&gt;= : The left side is the same or larger<\/li>\n<\/ul>\n\n\n\n<p>When an expression or variable is used in the conditional expression, it is considered true if it is not 0<\/p>\n\n\n\n<p>\u2462 IF <em>conditional expression<\/em> GOTO <em>label<\/em>: <em>execution statement<\/em>&#8230;<br>Surprisingly, an ELSE function exists.<br>If the conditional expression is true, it jumps to the label<br>If the conditional expression is false, it performs the processing from the execution statement onward<\/p>\n\n\n\n<p>With the introduction of conditional expressions, it feels like we can somewhat achieve movements reminiscent of the Lummy-Bahn title<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 A=0\n20 $A: CURSOR A:\"(PC-1261\/2)\"\n30 A=A+1: WAIT 5: IF A&lt;65 GOTO <a href=\"https:\/\/x.com\/search?q=%24A&amp;src=cashtag_click\">$A<\/a>\n40 $B: CURSOR A:\"(PC-1261\/2)\"\n50 A=A-1: WAIT 5: IF A\u00a50 GOTO <a href=\"https:\/\/x.com\/search?q=%24B&amp;src=cashtag_click\">$B<\/a>\n60 GOTO <a href=\"https:\/\/x.com\/search?q=%24A&amp;src=cashtag_click\">$A<\/a><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2038\"><img loading=\"lazy\" decoding=\"async\" width=\"1534\" height=\"311\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/lc3_2.gif\" alt=\"\" class=\"wp-image-2038\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"RUN\"><\/span>RUN<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This command initializes the program and re-executes it from the beginning (replay command).<\/p>\n\n\n\n<p>The &#8220;initialization&#8221; is exactly the same as when you call CALL &amp;4900, and the details are as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the stack pointer<\/li>\n\n\n\n<li>Clear variables and hidden variables<\/li>\n\n\n\n<li>Settings the data stack pointer<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"WAIT_n\"><\/span>WAIT n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This creates a wait of approximately n*0.004 seconds<br>Additionally, pressing BRK will terminate the program<br>When n=0, only the BRK press is checked<br>Combined with the previous text display<\/p>\n\n\n\n<p>10 &#8220;ABC&#8221;:WAIT 100<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2039\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"764\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-7-1024x764.png\" alt=\"\" class=\"wp-image-2039\" style=\"width:343px;height:auto\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-7-1024x764.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-7-300x224.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-7-768x573.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-7.png 1125w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PAUSE_n\"><\/span>PAUSE n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If no key are pressed, WAIT for n*0.004 seconds<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"STOP\"><\/span>STOP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>I was using WAIT for display waiting, but I forgot there\u2019s a command for key waiting : STOP<br>It pauses until a key is pressed (except for SHIFT, DEF).<br>It seems to repeat if held for more than a second, but I don\u2019t understand the point of this feature.<br>In reality, if you keep holding a key, it seems to disable the key press just once.<br>You can\u2019t disable it again by holding for another second. (What\u2019s that about? Maybe a design choice?)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CURSOR 0:\"HELLO WORLD\":STOP<\/code><\/pre>\n\n\n\n<p>If you set it up like this, it waits for a key press.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"REM\"><\/span>REM ~<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>From now on, this line will be commented<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"END\"><\/span>END<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Stops execution and return to BASIC. Can be omitted at the end of the source code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"_period\"><\/span>. (period)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This mark the end of the source code. Anything after this point in the program will be ignored<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GRAPHICS\"><\/span>GRAPHICS<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>The LC-3 has several ways to display arbitrary graphics.<\/p>\n\n\n\n<p>The first is defined characters (pseudo-PCG).<\/p>\n\n\n\n<p>Regarding the description of &#8220;strings&#8221; in the display command, if you include the \u03c0 symbol in this string, you can switch between regular characters and defined characters.<\/p>\n\n\n\n<p>Defined characters can use the 32 characters &#8220;@ A-Z;&lt;=&gt;?&#8221;.<\/p>\n\n\n\n<p>Now, you might be wondering about switching, but how do you define the characters?<\/p>\n\n\n\n<p>In fact, array variables 96 to 255 are designated as the storage area for defined characters, and by storing graphic data there, you can easily display them.<\/p>\n\n\n\n<p>There\u2019s also a way to easily set defined characters in array variables.<br>How to use defined characters:<br>\u2460 Store the data for defined characters in array variables.<br>At this point, 1 character uses 5 bytes, set from the right to the lower indices of the array. (This part isn\u2019t very intuitive, but it\u2019s probably due to aligning with the layout of the font data in the ROM.)<br>Example:<br><strong>\u221a101:14555D7F551400140014<\/strong><br>\u221aArrayNumber:2-digitHex&#8230;<\/p>\n\n\n\n<p>In this format, values are continuously set in the array.<\/p>\n\n\n\n<p>\u2461 In the character display, insert \u03c0 to switch the display, then write the corresponding characters.<br>Example: <br>&#8220;\u03c0AB&#8221; (Character display always starts with regular characters, so there\u2019s no need to switch back to regular characters at the end of the string.)<br>It\u2019s a bit tricky to get the hang of, but you can easily display graphic characters this way.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2068\"><img loading=\"lazy\" decoding=\"async\" width=\"560\" height=\"309\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-14.png\" alt=\"\" class=\"wp-image-2068\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-14.png 560w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-14-300x166.png 300w\" sizes=\"(max-width: 560px) 85vw, 560px\" \/><\/a><\/figure>\n\n\n\n<p><br>Sample:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 \u221a101:14555D7F551400140014:\"\u03c0ABBB\":STOP<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2040\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"338\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-8.png\" alt=\"\" class=\"wp-image-2040\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-8.png 602w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-8-300x168.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Display_Commands\"><\/span>Display Commands<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CLS_n\"><\/span>CLS n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Clears the parts of the screen where the bit specified in n is 0<\/p>\n\n\n\n<p>Bit 0: Top left<br>Bit 1: Top right<br>Bit 2: Bottom left<br>Bit 3: Bottom right<\/p>\n\n\n\n<p>CLS 0 clears the entire screen<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2041\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"496\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-9.png\" alt=\"\" class=\"wp-image-2041\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-9.png 586w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-9-300x254.png 300w\" sizes=\"(max-width: 586px) 85vw, 586px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CURSOR_exp\"><\/span>CURSOR exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Once text can be displayed, the next step is specifying the display location.<\/p>\n\n\n\n<p>exp: 0 to 239<\/p>\n\n\n\n<p>The display position is specified in dot units, not character units, with n going up to 239.<br>The top-left is 0, the bottom-left starts from 120, and any portion exceeding the top-right will be displayed from the bottom-left, while any portion exceeding the bottom-right will be displayed from the top-left.<br>If exp is set to 240 or higher, the display will disappear until CURSOR is set to 239 or lower again. (Not sure what this is useful for, but maybe for debugging by moving the display position with a variable and turning the debug display ON\/OFF? )<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CURSOR 0:\"HELLO WORLD\"\n20 CURSOR 122:\"HELLO WORLD\":WAIT 255<\/code><\/pre>\n\n\n\n<p>You can see how it allows specifying in dot units like this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2042\"><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"358\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-10.png\" alt=\"\" class=\"wp-image-2042\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-10.png 866w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-10-300x124.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-10-768x317.png 768w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PRINT_expression\"><\/span>PRINT expression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Display the value of an expression at the cursor&#8217;s position<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"LPRINT_expression\"><\/span>LPRINT expression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>adds a leading 0 for single-digit numbers, displaying them as two digits.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sample:\n10 CLS 0\n20 CURSOR 0:\"COUNT:\":LPRINT A:A=A+1:WAIT 10:IF A&lt;100 GOTO ^:A=0:GOTO ^<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CHR_expression\"><\/span>CHR$ expression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Display the character corresponding to the value of the expression.<br>If expression value is between 0 and 31, the defined character is displayed.<br>Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CLS 0:CURSOR 120:\"PUSH ANY KEY\"\n20 A=INPUT:GOSUB %B:A=\" \":GOSUB %B:GOTO ^\n30 %B:X=55\n40 CURSOR X:CHR$ A:CURSOR 115-X:CHR$ A:X=X-5:WAIT 5:IF X&lt;240 GOTO ^: RETURN<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2043\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"551\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-11-1024x551.png\" alt=\"\" class=\"wp-image-2043\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-11-1024x551.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-11-300x161.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-11-768x413.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-11.png 1125w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"DEG_Two-digit_hexadecimal%E2%80%A6\"><\/span>DEG Two-digit hexadecimal&#8230;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Draw graphics at the position of the text cursor without using text display.<\/p>\n\n\n\n<p>With defined characters, you need to create characters in units of 5 dots, but this allows you to create them freely without worrying about the number of dots.<\/p>\n\n\n\n<p>Also, unlike defined characters, it sets the data from the left, so it might be easier to understand. Since it\u2019s treated as a text cursor, the handling of parts that exceed the right edge is the same as with text display.<\/p>\n\n\n\n<p>10 DEG 140014001414555D7F55<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"POKE_expression\"><\/span>POKE expression<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Write 1 byte of data at the text cursor position and display it.<\/p>\n\n\n\n<p>While DEG has a variable size but fixed data to write, and defined characters need to set data in an array in 5-dot character units, this allows writing arbitrary values one dot at a time.<\/p>\n\n\n\n<p>Also, since the text cursor wraps around from the right edge to the left edge for any overflow, it\u2019s not suitable for effects like appearing from off-screen.<\/p>\n\n\n\n<p>With POKE, you can achieve this by adjusting the number of displayed dots while displaying one dot at a time.<\/p>\n\n\n\n<p>Sample :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 %C:A=1:WAIT 19\n20 \u221a0:000000000000000000000000000000404060686C7F7F7F7F6F6741406020\n30 \u221a30:00020203060606070F0F0F0F0F2F2F2F6F7F7F6F2F2F2F0F0F0F07070F09\n40 GOSUB %B:A=A+1: WAIT 19: IF A&lt;30 GOTO ^\n50 GOSUB %B:A=A-1: WAIT 19: IF A&gt;=1 GOTO ^\n60 GOTO %C\n70 %B:B=A:C=0:CURSOR 120-A\n80 POKE \u221aC:C=C+1:B=B-1:IF B\\0 GOTO ^\n90 B=A:C=30: CURSOR 240-A\n100 POKE \u221aC:C=C+1:B=B-1:IF B\\0 GOTO ^\n110 RETURN<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2033\"><img loading=\"lazy\" decoding=\"async\" width=\"1534\" height=\"311\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/lc3_3.gif\" alt=\"\" class=\"wp-image-2033\"\/><\/a><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Graphics_Instructions\"><\/span>Graphics Instructions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ON_xy\"><\/span>ON x,y<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Specifies the coordinates of the graphic cursor.<br>The graphic cursor changes only with this command.<br>If x is 120 or more, subsequent GRAD or COS will not be executed.<br>X and y can use world coordinates from 0 to 255.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"GRAD_hexadecimal_data\"><\/span>GRAD hexadecimal data~<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Displays the graphics of the hexadecimal data at the x,y coordinates specified by ON (Can draw the same data as DEG with dot-level position specification)<\/p>\n\n\n\n<p>The y-direction is effective only within the screen display range in world coordinates<\/p>\n\n\n\n<p>The x-direction ranges from 0 to 119; values outside this range are ignored Additionally, any portion that extends beyond the right edge of the screen is displayed from the left edge<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"COS_mn\"><\/span>COS m,n<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>m: Value to take AND with the screen<br>n: Number of dots to erase &#8211; 1<\/p>\n\n\n\n<p>Takes AND with the value m from the x,y coordinates specified by ON, effectively erasing the graphics<br>Neither GRAD nor COS changes the coordinates set by ON when executed<br>Sample :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CLS 0:X=0:Y=0:Z=1\n20 %A:ON X,Y:GRAD 0106060202:WAIT 20:COS 248,4\n30 X=X+1:IF X&gt;=116:X=0\n40 Y=Y+Z:IF Y=252:Y=253:Z=1\n50 IF Y=14:Y=13:Z=255\n60 GOTO %A<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2044\"><img loading=\"lazy\" decoding=\"async\" width=\"1534\" height=\"311\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/lc3_4.gif\" alt=\"\" class=\"wp-image-2044\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TRON_xy\"><\/span>TRON x,y<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Draw a point on the screen at the x,y coordinates.<br>Sample :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CLS 0\n20 WAIT 0:TRON RND 120,RND 14:GOTO ^<\/code><\/pre>\n\n\n\n<p>(In such loops, make sure not to forget WAIT 0 to enable the BRK check. Otherwise you will have to reset the computer)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2045\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"554\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-12-1024x554.png\" alt=\"\" class=\"wp-image-2045\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-12-1024x554.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-12-300x162.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-12-768x416.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-12.png 1125w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TROFF_xy\"><\/span>TROFF x,y<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Erase a point on the screen.<br>World coordinates can be used, both x and y can be specified from 0 to 255<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Sound_Instructions\"><\/span>Sound Instructions<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"BEEP_exp\"><\/span>BEEP exp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>0: BEEP OFF<br>1: Output &amp;11 to C port<br>2: BEEP 2kHz<br>3: BEEP 4kHz<\/p>\n\n\n\n<p>There is no length specification, so you need to use WAIT yourself<br>Sample<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 BEEP 2:WAIT 100:BEEP 3:WAIT 100:BEEP 0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SIN_exp1exp2\"><\/span>SIN exp1,exp2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Plays a sound at frequency exp1 for duration exp2.<br>The value set for exp1 is from the table of values for DMS mentioned previously<br>Sample:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>10 CLS 0:CURSOR 0:\"PUSH 0-9 KEY\"\n20 \u221a0:70635751473E35332C26\n30 %A:K=INKEY$:IF K&lt;\"0\" GOTO ^:IF \"9\"&lt;K GOTO ^\n40 SIN \u221aK-\"0\"),5:GOTO %A<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"DMS_%E2%80%9Cstring%E2%80%9D\"><\/span>DMS &#8220;string&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This is a command to play music when an MML-like command is written in the string.<br>Processing stops until the playback is complete (You cannot perform other actions while playing BGM)<br>The MML is structured as shown in the diagram<br>Side note: The SC61860 Pocket Computer can only sustain buzzer sounds at 2kHz and 4kHz<br>Other frequencies require the CPU to manually turn the buzzer ON\/OFF to create the desired frequency<br>As a result, when the CPU is producing sound, it cannot perform other tasks<br>Sample:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1 DMS \"8ACEFEC9A6=8EFHJHF9E\"<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pockemul.com\/?attachment_id=2046\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"347\" src=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-13-1024x347.png\" alt=\"\" class=\"wp-image-2046\" srcset=\"https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-13-1024x347.png 1024w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-13-300x102.png 300w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-13-768x260.png 768w, https:\/\/pockemul.com\/wp-content\/uploads\/2025\/07\/image-13.png 1125w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This is a compiler for Pocket Computer created around 1987~1988. I recently made PockEmul compatible with the LC-3 Compiler for the Sharp PC-1261\/1262. It will be part of PockEmul 2.10.0 This required extensive groundwork, as the compiler relies heavily on undocumented features of the SC61860 processor, many of which had not yet been implemented in &hellip; <a href=\"https:\/\/pockemul.com\/index.php\/2025\/09\/07\/lc-3-compiler-user-manual-for-sharp-pc-1261-pc-1262\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;LC-3 Compiler User Manual for SHARP PC-1261\/PC-1262&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[53,54,29,7,37],"tags":[],"class_list":["post-2020","post","type-post","status-publish","format-standard","hentry","category-pc-1261","category-pc-1262","category-pockemullite","category-techdoc","category-user-guides"],"_links":{"self":[{"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/posts\/2020"}],"collection":[{"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":19,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"predecessor-version":[{"id":2084,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/posts\/2020\/revisions\/2084"}],"wp:attachment":[{"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pockemul.com\/index.php\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}