2022年11月27日 星期日

easyforth , easy6502

easyforth , easy6502

這兩個都是javascript github 的project,
是非常優秀的0安裝,連得上網頁,就可線上的互動學習課程.

easyforth 從堆疊,變數,定義,迴圈等,最後實作一個打start 就能玩的貪食蛇.

easy6502 甚至assemble,step,disasm,monitor data memory 都有做.

http://skilldrick.github.io/easyforth/
http://skilldrick.github.io/easy6502/

https://github.com/skilldrick/easyforth

標籤: , , , , ,

2022年11月24日 星期四

解決 snap store 的 notepad++ Icon/menubar 太小的問題

How to make notepad++ Icon/menu bar more large.
### 先備份一次原始的 user.reg, 而且只要備份一次 .
#### Method 1: 方法一
$ cp ~/snap/notepad-plus-plus/common/.wine/user.reg \
~/snap/notepad-plus-plus/common/.wine/user.reg_org
$ winecfg     ### to graphics tab , adjust a desired dpi, <apply>, <ok>
$ cp ~/.wine/user.reg  ~/snap/notepad-plus-plus/common/.wine/



#### Method 2: 方法二
# edit  your  ~/snap/notepad-plus-plus/common/.wine/user.reg
# 在該兩個 section  有找到 LogPixels 則直接改值,沒找到,則需添加.
# 若值 0A8 表示168 dpi, 090 表示  144dpi, 060 表示 96 dpi

[Control Panel\\Desktop] 1662713654
"LogPixels"=dword:00000090

[Software\\Wine\\Fonts] 1669332241
"LogPixels"=dword:00000090





標籤: , , ,

ubuntu 18.04,22.04 設置 hinet pppoe 連線的 script file

設置 hinet pppoe 連線的 script file

以下 紅色 Hinet 為連線名稱,使用者名,及密碼,請修正.
兩條虛線間,存成 hinet_pppoe.sh
然後 $ chmod +x hinet_pppoe.sh
$ ./hinet_pppoe.sh
-------
LINK_NAME="Hinet"

echo Build a internet pppoe to ${LINK_NAME}

nmcli connection delete ${LINK_NAME}

echo nmcli con edit type pppoe con-name ${LINK_NAME}
echo -e \
"set pppoe.username 1234567@hinet.net\n"\
"set pppoe.password xxxxxxx\n"\
"print pppoe\n"\
"save\n"\
"yes\n"\
"quit\n" | nmcli con edit type pppoe con-name ${LINK_NAME}

nmcli connection show
nmcli dev status

echo You can delete by command: $ nmcli connection delete ${LINK_NAME}

---------

標籤: , ,

2022年11月15日 星期二

lazarus freePascal install and cross compile, on Host 64bit linux ,and cross to build win32 program

 *** My host is  linux ubuntu 18.04 64bit, 
*** target is to build linux 64bit  , and cross build win32 program
* download and install 3 packages : fpc-src, fpc-laz and lazarus-project


fpc-src_3.2.2-210709_amd64.deb
fpc-laz_3.2.2-210709_amd64.deb
lazarus-project_2.2.4-0_amd64.deb


* install 
$ sudo dpkg -i fpc-src_3.2.2-210709_amd64.deb
$ sudo dpkg -i fpc-laz_3.2.2-210709_amd64.deb
sudo apt install ./lazarus-project_2.2.4-0_amd64.deb
* check if successful
$ apt-cache policy fpc-src fpc-laz lazarus-project
** not need if you want remove 
** $ apt remove fpc-src fpc-laz lazarus-project


* How to build win32 exe file from  linux 64bit host
[00.] copy /usr/share/fpcsrc/3.2.2 to your ~/fpcsrc/3.2.2
[01.] cd ~/fpcsrc/3.2.2
[02.] make clean all OS_TARGET=win32 CPU_TARGET=i386
[03.] sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=/usr
[04.] sudo ln -sf /usr/lib/fpc/3.2.2/ppcross386 /usr/bin/ppcross386
[05.] launch lazarus ,open a hello project,
     project options -- compiler options -- config and target
Target OS(-T) Win32
Target Cpu(-P) i386
Target processor 386/486(-cp80386)
[06.] Run -- clean up and build 



*** below is for 64bit host , to gen linux 32bit code

---- gedit i386-linux-ld ---
#!/bin/bash
# name this file /usr/bin/i386-linux-ld
ld -A elf32-i386 $@
----^^ and save to disk

----make file i386-linux-as ---
#!/bin/bash
# name this file /usr/bin/i386-linux-as
as --32 $@
----^^

* copy above 2 bash file to /usr/bin/ , and let it as exe file
$ chmod +x i386-linux-as
$ chmod +x i386-linux-ld

01. cd ~/fpcsrc/3.2.2
02. make clean all OS_TARGET=linux CPU_TARGET=i386
03. sudo make crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=/usr

標籤: , , , ,

2022年11月11日 星期五

Build Eclipse 32bit C/C++ projects on a 64-bit system

 [] In eclips project explorer,Add extra "-m32" for both compiler and linker

Project->Properties --> C/C++ Build --> Settings 

-->Tool settings 

  -->gcc c compiler --> command: gcc -m32

  -->gcc c linker --> command: gcc -m32


[] extra Required Packages: add some as you need

Installing the following packages enabled standard C/C++ library calls to work. If other libraries are used within the code, additional 32-bit packages might have to be installed. Installation via Linux Mint, based on Ubuntu, is via the standard apt-get install command.

$sudo apt-get install g++-multilib lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

$sudo apt-get install lib32asound2 lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev

This might also be required if the code still does not compile:

$sudo apt-get install ia32-libs-gtk

After adding the suggested package libc6-dbg, the error still occurred. Installing the 32-bit version of the package fixed the error:

$sudo apt-get install libc6-dbg:i386

[]rember clean project befor first time compile new bitwidth-archecture


標籤: , , , ,

2022年11月10日 星期四

[光想不作狂想曲] 狂想目標:wpwf

 [光想不作狂想曲]

狂想目標:wpwf (where python where forth),熟練 chipforth assembly code

[考慮點]:

python is open source,

build-in in linux,and easy get at mac,windows,etc

算是主流 interpreter,可吸引學生作專題寫報告,然後誤入符途,而終生不悔。

[回顧]:

想想入符半個甲子,除了用forth寫了一個 華容道的人機界面,和用forth 寫了一個 nec 4bit cpu simulator,就是玩玩meta 最佳化,追新系統的forth(dos->win->linux).也買過 rtx2000的,和 mpu f21 cpu 的kit board,除了跑跑 benchmark,試一試機車超跑,還真的沒用forth 幹過正事。


[緣起]:剛才看到網路上有人寫了 小hack/discompile/python

看了 opcode.h 似乎沒用完,夠塞 32+2個指令,這+2可能是 >forth 和 >python

這32個指令,可以塞 chipforth的指令集 如mup21,或 greenArray F18A

可能還需堆叠 to tuple 或 array 的資料交換機制。

https://blog.techbridge.cc/2017/12/01/pycon-2017-huan-le-xue-python-wei-yuan-zu-ma-byte-code/

又查了opcode

https://github.com/enthought/Python-2.7.3/blob/master/Include/opcode.h


[尾聲]:狂想永遠在實現前發生,雖然只會被厝邊頭尾,親朋好友,唸說 光說不作。


標籤: , ,